From a821f74cb64dffef6931f93253841be35801c88c Mon Sep 17 00:00:00 2001 From: Joshua Kwan Date: Mon, 26 Jan 2004 16:37:16 +0000 Subject: [PATCH] use bison+flex if possible git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@174 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- Makefile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0a46f51..a159df3 100644 --- a/Makefile +++ b/Makefile @@ -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