- Old versions of flex did not support the -f flag, and did not provide a destroy function.
git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1139
e59a4935-1847-0410-ae03-
e826735625c1
TOP = ../..
include $(TOP)/scripts/Makefile.common
+# Workaround for flex < 2.5.20 which do not support the -f flag nor provide *_destroy functions
+OLD_FLEX=$(shell flex --version | awk -F '[ .]' '{ print ($$(NF-2) < 2 || $$(NF-2) == 2 && ($$(NF-1) < 5 || $$(NF-1) == 5 && $$NF < 20)) }')
+
+ifeq (1,$(OLD_FLEX))
+LEX=flex -Ce
+else
#`From the flex manual>: -Cfe' is often a good compromise between speed and size for production scanners.
LEX=flex -Cfe
+endif
+
YACC=bison --debug -v
SRCS = $(foreach foo,cvc smt smt2,lex$(foo).cpp parse$(foo).cpp) LetMgr.cpp
lex%.cpp: %.lex parse%.hpp ../AST/AST.h
$(LEX) -o$@ -P$* $<
+ifeq (1,$(OLD_FLEX))
+ echo "int $*lex_destroy(void) { return 0; }" >> $@
+endif
parse%.cpp parse%.hpp: %.y
$(YACC) -o parse$*.cpp -d -p $* $<