-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
51 lines (33 loc) · 1.2 KB
/
makefile
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
generator = x86_64gen.cc
translator_defns = translator.cc quads.cc types.cc symbols.cc expressions.cc
parser_defn = parser.tab.cc
scanner_defn = lex.yy.c
FILES = $(generator) $(translator_defns) $(parser_defn) $(scanner_defn)
FLAGS = -std=c++11 -O2 #-g
all : build mmstd.o clean
build : scanner_files parser_files translator_files quad_files expression_files symbols_files types_files
@(echo "This may take a few seconds...")
g++ $(FLAGS) $(FILES) -o ./compile
mmstd.o : mmstd.c
gcc -c mmstd.c
quad_files : quads.cc quads.hh
expression_files : expressions.cc expressions.hh
symbols_files : symbols.cc symbols.hh
types_files : types.cc types.hh
scanner_files : lex.yy.c
lex.yy.c : translator_files parser_files lexer.l
flex lexer.l
parser_files : parser.tab.cc
parser.tab.cc : parser.tab.hh
parser.tab.hh : translator_files parser.y
bison --language=c++ parser.y
translator_files : translator.hh translator.cc
clean : remove_generated_headers remove_tab_files remove_scanner_files remove_garbage
remove_generated_headers :
rm -f ./location.hh ./position.hh ./stack.hh
remove_tab_files :
rm -f ./parser.tab.hh ./parser.tab.cc
remove_scanner_files :
rm -f ./lex.yy.c
remove_garbage :
rm -f ./*~ ./.*~