From: Michael Stapelberg Date: Tue, 22 Nov 2011 00:01:01 +0000 (+0000) Subject: Makefiles: introduce $(FLEX) and $(BISON) X-Git-Tag: 4.2~228 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=acf29dbfd55ac006b83b8cea7095740108b977ec;p=i3%2Fi3 Makefiles: introduce $(FLEX) and $(BISON) --- diff --git a/Makefile b/Makefile index c0797839..f8ace071 100644 --- a/Makefile +++ b/Makefile @@ -55,23 +55,23 @@ loglevels.h: src/cfgparse.yy.o: src/cfgparse.l src/cfgparse.y.o ${HEADERS} echo "[i3] LEX $<" - flex -i -o$(@:.o=.c) $< + $(FLEX) -i -o$(@:.o=.c) $< $(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cfgparse.l/ { print NR }' loglevels.tmp))" -c -o $@ $(@:.o=.c) src/cmdparse.yy.o: src/cmdparse.l src/cmdparse.y.o ${HEADERS} echo "[i3] LEX $<" - flex -Pcmdyy -i -o$(@:.o=.c) $< + $(FLEX) -Pcmdyy -i -o$(@:.o=.c) $< $(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cmdparse.l/ { print NR }' loglevels.tmp))" -c -o $@ $(@:.o=.c) src/cfgparse.y.o: src/cfgparse.y ${HEADERS} echo "[i3] YACC $<" - bison --debug --verbose -b $(basename $< .y) -d $< + $(BISON) --debug --verbose -b $(basename $< .y) -d $< $(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cfgparse.y/ { print NR }' loglevels.tmp))" -c -o $@ $(<:.y=.tab.c) src/cmdparse.y.o: src/cmdparse.y ${HEADERS} echo "[i3] YACC $<" - bison -p cmdyy --debug --verbose -b $(basename $< .y) -d $< + $(BISON) -p cmdyy --debug --verbose -b $(basename $< .y) -d $< $(CC) $(CPPFLAGS) $(CFLAGS) -DLOGLEVEL="(1 << $(shell awk '/cmdparse.y/ { print NR }' loglevels.tmp))" -c -o $@ $(<:.y=.tab.c) diff --git a/common.mk b/common.mk index a9d16618..4394bc41 100644 --- a/common.mk +++ b/common.mk @@ -2,6 +2,8 @@ UNAME=$(shell uname) DEBUG=1 COVERAGE=0 INSTALL=install +FLEX=flex +BISON=bison ifndef PREFIX PREFIX=/usr endif diff --git a/i3-config-wizard/Makefile b/i3-config-wizard/Makefile index 27d5bf54..75d4684f 100644 --- a/i3-config-wizard/Makefile +++ b/i3-config-wizard/Makefile @@ -26,12 +26,12 @@ $(TOPDIR)/libi3/%.a: $(TOPDIR)/libi3/*.c cfgparse.yy.o: cfgparse.l cfgparse.y.o ${HEADERS} echo "[i3-config-wizard] LEX $<" - flex -i -o$(@:.o=.c) $< + $(FLEX) -i -o$(@:.o=.c) $< $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(@:.o=.c) cfgparse.y.o: cfgparse.y ${HEADERS} echo "[i3-config-wizard] YACC $<" - bison --debug --verbose -b $(basename $< .y) -d $< + $(BISON) --debug --verbose -b $(basename $< .y) -d $< $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $(<:.y=.tab.c)