Split CFLAGS/CPPFLAGS for c-utils
@@ -117,9 +117,11 @@ dirname = $(patsubst %/,%,$(dir $(1)))
CC = @CC@
DEP_CC = gcc
+CPPFLAGS := @CPPFLAGS@
CFLAGS := @CFLAGS@
LDFLAGS := @LDFLAGS@
-CFLAGS += -I $(srcdir) -I $(srcdir)/src $(STD) $(WARNS)
+CPPFLAGS += -I $(srcdir) -I $(srcdir)/src
+CFLAGS += $(STD) $(WARNS)
ifeq ($(ENABLE_SHARED),1)
PIC = $(PIC_FLAG)
CFLAGS += $(PIC)
@@ -139,7 +141,7 @@ deps: $(DEPS)
%.d: %.c
$(Q) " DEP $@"
$(E) CC="$(DEP_CC)" $(srcdir)/maint/depend.sh \
- $(call dirname, $*) $(CFLAGS) $< > $@
+ $(call dirname, $*) $(CPPFLAGS) $< > $@
ifeq (,$(filter clean deps,$(MAKECMDGOALS)))
-include $(DEPS)
@@ -171,7 +173,7 @@ TAGS: deps_contents.txt
%.o: %.c
# This line causes a false autoscan warning on token 'CC' (C++)
$(Q) " CC $@"
- $(E) $(CC) $(CFLAGS) -c $(<) -o $(@)
+ $(E) $(CC) $(CPPFLAGS) $(CFLAGS) -c $(<) -o $(@)
### LINK
