forked from dextercallender/blur
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·62 lines (49 loc) · 1.72 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
52
53
54
55
56
57
58
59
60
61
62
LIBDIR = clib
OBJS = ast.cmx parser.cmx scanner.cmx semantic_analyzer.cmx exceptions.cmx configuration.cmx generator.cmx prettyprint.cmx blur.cmx
blur: $(OBJS)
ocamlfind ocamlopt -linkpkg -package llvm -package llvm.analysis -package llvm.bitwriter -package llvm.bitreader -package llvm.linker $(OBJS) -o blur
scanner.ml : scanner.mll
ocamllex scanner.mll
parser.ml parser.mli : parser.mly
ocamlyacc parser.mly
%.cmo : %.ml
ocamlc -c $<
%.cmi : %.mli
ocamlc -c $<
%.cmx : %.ml
ocamlfind ocamlopt -c -package llvm $<
ast.cmo :
ast.cmx :
exceptions.cmo :
exceptions.cmx :
generator.cmo : ast.cmo exceptions.cmo
generator.cmx : ast.cmx exceptions.cmx
prog.cmo: scanner.cmo parser.cmi ast.cmo exceptions.cmo generator.cmo sast.cmi prettyprint.cmo semantic_analyzer.cmo
prog.cmx : scanner.cmx parser.cmx ast.cmx exceptions.cmx generator.cmx sast.cmx prettyprint.cmx semantic_analyzer.cmx
parser.cmo : ast.cmo parser.cmi
parser.cmx : ast.cmx parser.cmi
scanner.cmo: parser.cmi
scanner.cmx : parser.cmx
semantic_analyzer.cmo : ast.cmo sast.cmo
semantic_analyzer.cmx : ast.cmx sast.cmx
parser.cmi: ast.cmo
.PHONY: %.ll
%-ll:
./blur -ls < $(*F).blr > $(*F).ll
cd ${LIBDIR} && make clib && cd ../
llc $(*F).ll > $(*F).s
gcc -I ${LIBDIR} -o $(*F).blx $(*F).s -L${LIBDIR} -lclib -lGL -lglut -lGLU -lIL
# for including the Blur standard library.
.PHONY: %.ll
%-ls:
#./blur -ls < $(*D)/$(*F).blr > $(*D)/$(*F).ll
cd ${LIBDIR} && make stdlib && cd ../
llc $(*D)/$(*F).ll > $(*D)/$(*F).s
gcc -I ${LIBDIR} -o $(*D)/$(*F).blx $(*D)/$(*F).s -L${LIBDIR} -lclib -lGL -lglut -lGLU -lIL
.PHONY : libs
libs :
cd ${LIBDIR} && make clib
.PHONY : clean
clean :
rm -f scanner.ml parser.ml parser.mli blur
rm -f *.cmo *.cmi *.cmx *.o *.bc *.ll *.s *.out *.blx