-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
41 lines (28 loc) · 696 Bytes
/
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
LANG_NAME='ruby'
FILE_LEX='$(LANG_NAME).lex'
FILE_LEX_HEADER='Scanner.h'
FILE_LEX_OUTPUT='lex.cc'
FLEX='flexc++'
FILE_BISON='$(LANG_NAME).y'
FILE_BISON_OUTPUT='parse.cc'
BISON='bisonc++'
FILE_MAIN='main.cc'
FILE_ANALYZER='analyzer.cpp'
FILE_OUTPUT='$(LANG_NAME).run'
FILE_TEST='test.rb'
LIB_BOBCAT='-lbobcat'
default: compile
$(FILE_BISON):
$(BISON) $(FILE_BISON)
$(FILE_LEX):
$(FLEX) $(FILE_LEX)
compile: clean $(FILE_BISON) $(FILE_LEX)
g++ --std=c++0x -ggdb -o $(FILE_OUTPUT) $(LIB_BOBCAT) *.cc tokens/*.cc
chmod +x $(FILE_OUTPUT)
run:
cat $(FILE_TEST) | ./$(FILE_OUTPUT)
clean:
rm -rf *.o
rm -rf Parserbase.h Scannerbase.h
rm -rf lex.cc parse.cc
rm -f $(FILE_OUTPUT)