summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile13
1 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index a0d55bf..0de1919 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,6 @@ CC = $(CROSS_COMPILE)gcc
INSTALL = install
CPPFLAGS ?=
-CFLAGS ?= -W -Wall -O2 $(CPPFLAGS)
LDFLAGS ?=
ifeq ($(shell git rev-parse > /dev/null 2>&1; echo $$?), 0)
@@ -27,12 +26,14 @@ else
GIT_VERSION =
endif
-CFLAGS += -DVERSION_STRING=\"v$(VERSION)\" -DGIT_VERSION=\"$(GIT_VERSION)\"
-
+CFLAGS_MIN := -W -Wall -DVERSION_STRING=\"v$(VERSION)\" -DGIT_VERSION=\"$(GIT_VERSION)\"
ifeq ($(DEBUG), 1)
- CFLAGS += -g -DDEBUG
+ CFLAGS_MIN += -g -DDEBUG
endif
+CFLAGS ?= -O2
+override CFLAGS := $(CFLAGS_MIN) $(CFLAGS)
+
Q ?= @
ifeq ($(Q),)
CCQ = $(CC)
@@ -57,10 +58,10 @@ $(Q_P): $(Q_OBJS)
$(LDQ) $(LDFLAGS) -o $@ $(Q_OBJS) $(Q_LIBS)
%.o: %.c %.h
- $(CCQ) $(CFLAGS) -o $@ -c $<
+ $(CCQ) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
%.o: %.c
- $(CCQ) $(CFLAGS) -o $@ -c $<
+ $(CCQ) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
install_$(D_P): $(D_P)
@echo " INSTALL $(D_P)"