-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (65 loc) · 1.77 KB
/
Makefile
File metadata and controls
79 lines (65 loc) · 1.77 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
default: all
OBJS = ast.cmo parser.cmo scanner.cmo
ast_print: ast.cmo parser.cmo scanner.cmo ast_print.cmo
ocamlc -o ast_print ast.cmo parser.cmo scanner.cmo ast_print.cmo
scanner.ml : scanner.mll
ocamllex scanner.mll
parser.ml parser.mli : parser.mly
ocamlyacc parser.mly
%.cmo : %.ml
ocamlc -w A -c $<
%.cmi : %.mli
ocamlc -w A -c $<
.PHONY : compile
compile:
ocamlc -g ast.ml
ocamlyacc parser.mly
ocamlc -c parser.mli
ocamlc -c parser.ml
ocamllex scanner.mll
ocamlc -c scanner.ml
ocamlc -g sast.mli
ocamlc -g semantic_check.ml
ocamlc -g gen_python.ml
ocamlc -c compiler.ml
ocamlc -o compiler -g scanner.cmo parser.cmo semantic_check.cmo gen_python.cmo compiler.cmo
sc:
ocamlc -c sast.mli
ocamlc -c semantic_check.ml
#Tack on your own targets
.PHONY : clean
clean:
rm -f parser.ml parser.mli scanner.ml *.cmo *.cmi statemap compiler *.py a.out ast_print
.PHONY : all
all:
make clean
make compile
test:
make clean
make compile
./test_all.sh
run:
make all
./compiler < ./sample_programs/hello.sm
python output.py
# Generaetd by: ocamldep *.ml *.mli
ast.cmo :
ast.cmx :
ast_print.cmo : scanner.cmo parser.cmi ast.cmo
ast_print.cmx : scanner.cmx parser.cmx ast.cmx
compiler.cmo : semantic_check.cmo scanner.cmo parser.cmi gen_python.cmo
compiler.cmx : semantic_check.cmx scanner.cmx parser.cmx gen_python.cmx
gen_python.cmo : sast.cmi ast.cmo
gen_python.cmx : sast.cmi ast.cmx
parser.cmo : ast.cmo parser.cmi
parser.cmx : ast.cmx parser.cmi
scanner.cmo : parser.cmi
scanner.cmx : parser.cmx
semantic_check.cmo : sast.cmi ast.cmo
semantic_check.cmx : sast.cmi ast.cmx
statemap.cmo : scanner.cmo parser.cmi ast.cmo
statemap.cmx : scanner.cmx parser.cmx ast.cmx
parser.cmi : ast.cmo
sast.cmi : ast.cmo
lazy:
make clean && make compile && ocamlrun -b ./compiler < $(FILE)