makefiles: respect and use the CPPFLAGS variable (Thanks Kacper)

See also: http://stackoverflow.com/questions/2754966/cflags-vs-cppflags
This commit is contained in:
Michael Stapelberg
2011-07-13 13:22:15 +02:00
parent f1190bef44
commit 93f906308d
6 changed files with 16 additions and 16 deletions

View File

@ -11,7 +11,7 @@ HEADERS:=$(wildcard *.h)
# Depend on the specific file (.c for each .o) and on all headers
%.o: %.c ${HEADERS}
echo "CC $<"
$(CC) $(CFLAGS) -c -o $@ $<
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
all: cfgparse.y.o cfgparse.yy.o ${FILES}
echo "LINK i3-config-wizard"
@ -20,12 +20,12 @@ all: cfgparse.y.o cfgparse.yy.o ${FILES}
cfgparse.yy.o: cfgparse.l cfgparse.y.o ${HEADERS}
echo "LEX $<"
flex -i -o$(@:.o=.c) $<
$(CC) $(CFLAGS) -c -o $@ $(@:.o=.c)
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(@:.o=.c)
cfgparse.y.o: cfgparse.y ${HEADERS}
echo "YACC $<"
bison --debug --verbose -b $(basename $< .y) -d $<
$(CC) $(CFLAGS) -c -o $@ $(<:.y=.tab.c)
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(<:.y=.tab.c)
install: all