]> skyeroc.xyz Git - dgamelaunch/commitdiff
use bison+flex if possible
authorJoshua Kwan <joshk@triplehelix.org>
Mon, 26 Jan 2004 16:37:16 +0000 (16:37 +0000)
committerJoshua Kwan <joshk@triplehelix.org>
Mon, 26 Jan 2004 16:37:16 +0000 (16:37 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@174 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

Makefile

index 0a46f51b68e054ec197a37c922cabc3663ba34ae..a159df33e5c14bad3ad979f95c9d766969540d0a 100644 (file)
--- 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