-
Notifications
You must be signed in to change notification settings - Fork 256
/
Makefile
136 lines (100 loc) · 2.64 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
include ../common/commands.mk
.DEFAULT_GOAL := build
executables := \
target/primes_cpp_gcc \
target/primes_cpp_clang \
primes.rs/target/release/primes \
target/primes_cr \
target/primes_v_gcc \
target/primes_v_clang \
target/primes_zig \
target/primes_nim_clang \
target/primes_nim_gcc \
$(GO_TARGETS)
artifacts := $(executables) \
target/primes_scala.jar \
target/Primes.class
all_runners := $(patsubst %,run[%], $(artifacts)) \
run[pypy][primes.py] \
run[primes.py] \
run[primes.js] \
run[primes.rb] \
run[jit][primes.rb] \
run[truby-jvm][primes.rb] \
run[truby-native][primes.rb] \
run[jruby][primes.rb] \
run[primes.lua] \
run[primes_jit.lua] \
run[primes.jl] \
run[primes.rkt]
# Build
.PHONY: build
build: $(artifacts)
target/primes_scala.jar: primes.scala | target
$(SCALAC_BUILD)
target/Primes.class: Primes.java | target
$(JAVAC_BUILD)
primes-rs-toml := primes.rs/Cargo.toml
.PHONY: primes.rs/target/release/primes
primes.rs/target/release/primes: $(primes-rs-toml)
$(CARGO_BUILD)
target/primes_cpp_gcc: primes.cpp | target libnotify
$(GCC_CPP_BUILD)
target/primes_cpp_clang: primes.cpp | target libnotify
$(CLANG_CPP_BUILD)
target/primes_cr: primes.cr | target
$(CRYSTAL_BUILD)
target/primes_v_gcc: primes.v | $(v_fmt)
$(V_GCC_BUILD)
target/primes_v_clang: primes.v | $(v_fmt)
$(V_CLANG_BUILD)
target/primes_zig: primes.zig | $(zig_fmt)
$(ZIG_BUILD)
target/primes_nim_clang: primes.nim | target
$(NIM_CLANG_BUILD)
target/primes_nim_gcc: primes.nim | target
$(NIM_GCC_BUILD)
# Run
.PHONY: run
run: $(all_runners)
## Common recipe for all runners
.PHONY: $(all_runners)
$(all_runners)::
$(ECHO_RUN)
## Runners
executable_runners := $(patsubst %,run[%], $(executables))
$(executable_runners):: run[%] : %
$(EXECUTABLE_RUN)
run[target/primes_scala.jar]:: run[%]: %
$(SCALA_RUN)
run[target/Primes.class]:: run[%]: %
$(JAVA_CLASS_RUN)
run[pypy][primes.py]:: run[pypy][%]: % | $(py_fmt)
$(PYPY3_RUN)
run[primes.py]:: run[%]: % | $(py_fmt)
$(PYTHON3_RUN)
run[primes.js]:: run[%]: %
$(NODE_RUN)
run[primes.rb]:: run[%]: % | $(rubocop)
$(RUBY_RUN)
run[jit][primes.rb]:: run[jit][%]: % | $(rubocop)
$(RUBY_JIT_RUN)
run[truby-jvm][primes.rb]:: run[truby-jvm][%]: % | $(rubocop)
$(TRUBY_JVM_RUN)
run[truby-native][primes.rb]:: run[truby-native][%]: % | $(rubocop)
$(TRUBY_NATIVE_RUN)
run[jruby][primes.rb]:: run[jruby][%]: % | $(rubocop)
$(JRUBY_RUN)
run[primes.lua]:: run[%]: % | libnotify
$(LUA_RUN)
run[primes_jit.lua]:: run[%]: %
$(LUA_JIT_RUN)
run[primes.jl]:: run[%]: % | $(julia_fmt)
$(JULIA_RUN)
run[primes.rkt]:: run[%]: %
$(RACKET_RUN)
# Utilities
.PHONY: clean
clean: clean-go
-rm -rf target
-rm -rf zig-cache