use bison+flex if possible

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@174 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Joshua Kwan 2004-01-26 16:37:16 +00:00
parent dbcf027490
commit a821f74cb6
1 changed files with 14 additions and 2 deletions

View File

@ -8,6 +8,18 @@ ifndef optimize
optimize = -O0
endif
ifneq (,$(shell which flex 2>/dev/null))
LEX = flex
else
LEX = lex
endif
ifneq (,$(shell which bison 2>/dev/null))
YACC = bison -y
else
YACC = yacc
endif
ifeq (Linux,$(shell uname -s))
LUTIL = -lutil
else
@ -48,10 +60,10 @@ indent:
rm -f *~
lex.yy.c: config.l
lex $<
$(LEX) $<
y.tab.c: config.y
yacc -d $<
$(YACC) -d $<
lex.yy.o: lex.yy.c
y.tab.o: y.tab.c