-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (27 loc) · 690 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (27 loc) · 690 Bytes
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
# Retain intermediate bitcode files
.PRECIOUS: %.bc
# The default target builds the plugin
plugin:
make -C lib/p3
# create .bc from source
%.bc: %.c
clang -emit-llvm -O0 -c $*.c -o $*.bc
# create human-readable assembly (.ll) from .bc
%.ll: %.bc
llvm-dis -f $^
# create executable from .bc
%.exe: %.bc
llc $^
gcc $*.s -o $*.exe
# create bitcode optimized to keep vars in registers
%.mem2reg: %.bc
opt -mem2reg $^ -o $@
# mv $*.mem2reg $*.bc
# run printCode on a .bc file
%.printCode: %.bc plugin
opt -load Debug/lib/P2.so -printCode $*.bc > /dev/null
# mv $*.loopInv $*.bc
# clean up generated files
clean:
make -C lib/p3 clean
rm -f *.bc *.exe *.ll *.s *.mem2reg *.loopInv