-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
51 lines (46 loc) · 1.42 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
# <help>
.PHONY: help
help:
@echo 'make all - dec + rec'
@echo 'make dec - decompile examples'
@echo 'make rec - recompile examples'
@echo 'make run - run examples'
@echo 'make clean - clean up'
@echo 'make help - this screen'
# </help>
# <all>
.PHONY: all
all: dec rec
# </all>
# <dec>
.PHONY: dec
dec:
cp -v impl/examples/csrc/fib.c fib.original.c
cd impl && ./run-x64-ir2c.sh fib.elf.x64 > ../fib.elf.x64.decomp.c
cd impl && ./run-x64-ir2c.sh fib.elf.x64.O3 > ../fib.elf.x64.O3.decomp.c
cd impl && ./run-x64-ir2c.sh fib.elf.x64.recomp > ../fib.elf.x64.recomp.decomp.c
cd impl && ./run-x64-ir2c.sh fib.elf.x64.recomp.recomp > ../fib.elf.x64.recomp.recomp.decomp.c
# </dec>
# <rec>
.PHONY: rec
rec:
gcc fib.elf.x64.decomp.c -o fib.elf.x64.decomp.recomp.bin -Wall
gcc fib.elf.x64.O3.decomp.c -o fib.elf.x64.O3.decomp.recomp.bin -Wall
gcc fib.elf.x64.recomp.decomp.c -o fib.elf.x64.recomp.decomp.recomp.bin -Wall
gcc fib.elf.x64.recomp.recomp.decomp.c -o fib.elf.x64.recomp.recomp.decomp.recomp.bin -Wall
# </rec>
# <run>
.PHONY: run
run:
time -p impl/examples/fib.elf.x64.O3/fib.elf.x64.O3 40
time -p ./fib.elf.x64.O3.decomp.recomp.bin 40
time -p impl/examples/fib.elf.x64/fib.elf.x64 40
time -p ./fib.elf.x64.decomp.recomp.bin 40
time -p ./fib.elf.x64.recomp.decomp.recomp.bin 40
time -p ./fib.elf.x64.recomp.recomp.decomp.recomp.bin 40
# </run>
# <clean>
.PHONY: clean
clean:
rm -f fib*.c fib*.bin
# </clean>