From acf29dbfd55ac006b83b8cea7095740108b977ec Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 22 Nov 2011 00:01:01 +0000 Subject: [PATCH] Makefiles: introduce $(FLEX) and $(BISON) --- Makefile | 8 ++++---- common.mk | 2 ++ i3-config-wizard/Makefile | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) 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) -- 2.39.5