about summary refs log tree commit diff homepage
path: root/lib/SMT/Makefile
blob: 031a6140b79fa26a3e357b9f6c04251593510ea5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
LIBRARY=libsmt.a

# Do not optimize the parser code - it compiles forever in some gcc versions
EXTRAFLAGS = -O0

TRANSIENT_CPP = parsesmtlib.cpp lexsmtlib.cpp
TRANSIENT_OBJ = $(TRANSIENT_CPP:.cpp=.o)

TRANSIENT = $(TRANSIENT_CPP) parsesmtlib_defs.h parsesmtlib.output

SRC = $(TRANSIENT_CPP) parser.cpp

HEADERS = parser_temp.h

# The actual source files for the parser that we want to include in a
# distribution
SRC_ORIG = smtlib.lex smtlib.y parser.cpp

#include ../../Makefile.local

#lex
LEX = flex
LFLAGS = # -i  use this for a case-insensitive scanner

#yacc
YACC = bison
YFLAGS = -d -y


##################################################
# Rules for transient files
##################################################

all: $(TRANSIENT_OBJ)

%.o: %.cpp
	$(CXX) $(CFLAGS) -c $< -o $@

lexsmtlib.cpp:  smtlib.lex parsesmtlib_defs.h
		$(LEX) $(LFLAGS) -I -Psmtlib -olexsmtlib.cpp smtlib.lex

parsesmtlib_defs.h: parsesmtlib.cpp

parsesmtlib.cpp: smtlib.y
		$(YACC) $(YFLAGS) -o parsesmtlib.cpp -p smtlib --debug -v smtlib.y
		@if [ -f parsesmtlib.cpp.h ]; then mv parsesmtlib.cpp.h parsesmtlib.hpp; fi
		@mv parsesmtlib.hpp parsesmtlib_defs.h

clean:
	rm -f $(TRANSIENT) *~ *.o