-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (65 loc) · 2.13 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
all: saw_rust saw_f90 saw_c saw_clang_c saw_cc saw_clang_cc saw_em_c.js saw_em_cc.js
benchmark: all benchmark_rust benchmark_f90 benchmark_c benchmark_clang_c benchmark_cc benchmark_clang_cc benchmark_emjs_c benchmark_emjs_cc benchmark_julia benchmark_julia_opt benchmark_python benchmark_awk benchmark_php benchmark_js benchmark_elixir benchmark_lua benchmark_R
benchmark_rust:
@./timer.sh rust ./saw_rust
benchmark_f90:
@./timer.sh 'fortran90 (gcc)' ./saw_f90
benchmark_c:
@./timer.sh 'c (gcc)' ./saw_c
benchmark_clang_c:
@./timer.sh 'c (clang)' ./saw_clang_c
benchmark_cc:
@./timer.sh 'c++ (gcc)' ./saw_cc
benchmark_clang_cc:
@./timer.sh 'c++ (clang)' ./saw_clang_cc
benchmark_emjs_c:
@./timer.sh 'emcc/js (node)' './saw_em_c.js'
benchmark_emjs_cc:
@./timer.sh 'em++/js (node)' './saw_em_cc.js'
benchmark_julia:
@./timer.sh julia './saw.jl'
benchmark_julia_opt:
@./timer.sh 'julia (optimized)' './saw_opt.jl'
benchmark_python:
@./timer.sh python './saw.py'
benchmark_awk:
@./timer.sh 'awk (gawk)' './saw.awk'
benchmark_php:
@./timer.sh php './saw.php'
benchmark_js:
@./timer.sh 'node (js)' './saw.js'
benchmark_elixir:
@./timer.sh elixir './saw.ex'
benchmark_lua:
@./timer.sh lua './saw.lua'
benchmark_R:
@./timer.sh Rscript './saw.r'
saw_rust: saw.rs
rustc -C opt-level=3 -C lto -o saw_rust saw.rs
saw_f90: saw.f90
gfortran -Wall -Wextra -flto -O3 -o saw_f90 saw.f90
saw_c: saw.c
gcc -Wall -Wextra -std=c11 -flto -O3 -o saw_c saw.c
saw_clang_c: saw.c
clang -Wall -Wextra -std=c11 -flto -O3 -o saw_clang_c saw.c
saw_em_c.js: saw.c
emcc -Wall -Wextra -std=c11 -flto -O3 -o saw_em_c.js saw.c
@sed -i "1i #!/usr/bin/env node" saw_em_c.js
@chmod u+x saw_em_c.js
saw_cc: saw.cc
g++ -Wall -Wextra -std=c++11 -flto -O3 -o saw_cc saw.cc
saw_clang_cc: saw.cc
clang++ -Wall -Wextra -std=c++11 -flto -O3 -o saw_clang_cc saw.cc
saw_em_cc.js: saw.cc
em++ -Wall -Wextra -std=c++11 -flto -O3 -o saw_em_cc.js saw.cc
@sed -i "1i #!/usr/bin/env node" saw_em_cc.js
@chmod u+x saw_em_cc.js
clean:
-rm -f saw_rust
-rm -f saw_f90
-rm -f saw_c
-rm -f saw_cc
-rm -f saw_clang_c
-rm -f saw_clang_cc
-rm -f saw_em_c.js*
-rm -f saw_em_cc.js*