-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (34 loc) · 2.58 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
.PHONY : clean
clean:
find . -name "*~" -exec rm {} \;
aes:
./src/translate.pl -in test-cases/aes/aes-ctr.q -out test-cases/aes/aes-ctr.c -ext-variables "aes_tablex:ucp;aes_table2:ucp;aes_table1:ucp;aes_table0:ucp;aes_table3:uip;lr_table0:uip;lr_table1:uip"
sed -i '1i #include "constants.h"\n#include "macros.h"\n' test-cases/aes/aes-ctr.c
gcc -Wall -O3 -S test-cases/aes/aes-ctr.c
mv aes-ctr.s test-cases/aes/aes-ctr.s
aes-safe:
./src/translate.pl -in test-cases/aes/aes-ctr.q -out test-cases/aes/aes-ctr-safe.c -map-file "./config/map-safe" -ext-variables "aes_tablex:ucp;aes_table2:ucp;aes_table1:ucp;aes_table0:ucp;aes_table3:uip;lr_table0:uip;lr_table1:uip"
sed -i '1i #include "constants.h"\n#include "macros.h"\n' test-cases/aes/aes-ctr-safe.c
gcc -Wall -O3 -S test-cases/aes/aes-ctr-safe.c
mv aes-ctr-safe.s test-cases/aes/aes-ctr-safe.s
aes-direct:
./src/translate.pl -in test-cases/aes/aes-ctr.q -out test-cases/aes/aes-ctr-direct.c -map-file "./config/map-direct" -ext-variables "aes_tablex:vp;aes_table2:vp;aes_table1:vp;aes_table0:vp;aes_table3:vp;lr_table0:vp;lr_table1:vp"
sed -i '1i #include "constants-direct.h"\n#include "macros.h"\n' test-cases/aes/aes-ctr-direct.c
gcc -Wall -O3 -S test-cases/aes/aes-ctr-direct.c
mv aes-ctr-direct.s test-cases/aes/aes-ctr-direct.s
aes-translate-only:
./src/translate.pl -in test-cases/aes/aes-ctr.q -out test-cases/aes/aes-ctr.c -ext-variables "aes_tablex:ucp;aes_table2:ucp;aes_table1:ucp;aes_table0:ucp;aes_table3:uip;lr_table0:uip;lr_table1:uip"
sed -i '1i #include "constants.h"\n#include "macros.h"\n' test-cases/aes/aes-ctr.c
aes-indent:
indent -orig -l150 -nut -ts0 -sob test-cases/aes/aes-ctr.c
aes-print-parsed:
./src/translate.pl -print-parsed -print-parsed-exit -in test-cases/aes/aes-ctr.q -ext-variables "aes_tablex:ucp;aes_table2:ucp;aes_table1:ucp;aes_table0:ucp;aes_table3:uip;lr_table0:uip;lr_table1:uip"
profile:
perl -d ./src/translate.pl -in test-cases/aes/aes-ctr.q -out test-cases/aes/aes-ctr.c -ext-variables "aes_tablex:ucp;aes_table2:ucp;aes_table1:ucp;aes_table0:ucp;aes_table3:uip;lr_table0:uip;lr_table1:uip"
#rc4:
# ./src/translate.pl -in test-cases/rc4/rc4.q -out test-cases/rc4/rc4.h -in-variables "in:rucp;" && \
# indent -sob -prs -br -ce -nut -ts3 -i4 -l150 test-cases/rc4/rc4.h && \
# sed -i 's/@ \*/@\*/g' test-cases/rc4/rc4.c && \
# sed -i 's/[ ]@/@/g' test-cases/rc4/rc4.c
# make aes && make aes-indent && make aes-copy && make aes-bench-original && make aes-bench-translated && make aes-diff
# make aes-direct && make aes-indent && make aes-copy && make aes-bench-original && make aes-bench-translated && make aes-diff