1 | ######################## -*- Mode: Makefile-Automake -*- ###################### |
---|
2 | ## |
---|
3 | ## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
4 | ## |
---|
5 | ## The contents of this file are covered under the licence agreement in the |
---|
6 | ## file "LICENCE" distributed with Cforall. |
---|
7 | ## |
---|
8 | ## Makefile.am -- |
---|
9 | ## |
---|
10 | ## Author : Peter A. Buhr |
---|
11 | ## Created On : Sun May 31 09:08:15 2015 |
---|
12 | ## Last Modified By : Peter A. Buhr |
---|
13 | ## Last Modified On : Tue Nov 6 09:01:23 2018 |
---|
14 | ## Update Count : 26 |
---|
15 | ############################################################################### |
---|
16 | |
---|
17 | AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names |
---|
18 | ACLOCAL_AMFLAGS = -I automake |
---|
19 | |
---|
20 | # applies to both programs |
---|
21 | include $(top_srcdir)/src/cfa.make |
---|
22 | |
---|
23 | |
---|
24 | |
---|
25 | AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread |
---|
26 | AM_CFAFLAGS = -quiet -in-tree -nodebug |
---|
27 | AM_UPPFLAGS = -quiet -nodebug -multi |
---|
28 | |
---|
29 | TOOLSDIR = ${abs_top_builddir}/tools/ |
---|
30 | REPEAT = ${abs_top_builddir}/tools/repeat |
---|
31 | STATS = ${abs_top_srcdir}/tools/stat.py |
---|
32 | repeats = 30 |
---|
33 | skipcompile = no |
---|
34 | TIME_FORMAT = "%E" |
---|
35 | PRINT_FORMAT = %20s: #Comments needed for spacing |
---|
36 | |
---|
37 | # Dummy hack tricks |
---|
38 | EXTRA_PROGRAMS = dummy # build but do not install |
---|
39 | dummy_SOURCES = dummyC.c dummyCXX.cpp |
---|
40 | |
---|
41 | dummyC.c: |
---|
42 | @echo "int main() { return 0; }" > ${@} |
---|
43 | |
---|
44 | dummyCXX.cpp: |
---|
45 | @echo "int main() { return 0; }" > ${@} |
---|
46 | |
---|
47 | .NOTPARALLEL: |
---|
48 | |
---|
49 | ## ========================================================================================================= |
---|
50 | all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) |
---|
51 | |
---|
52 | %.run : %$(EXEEXT) ${REPEAT} |
---|
53 | @rm -f .result.log |
---|
54 | @echo "------------------------------------------------------" |
---|
55 | @echo $< |
---|
56 | @${REPEAT} ${repeats} ./a.out | tee -a .result.log |
---|
57 | @${STATS} .result.log |
---|
58 | @echo "------------------------------------------------------" |
---|
59 | @rm -f a.out .result.log *.class |
---|
60 | |
---|
61 | %.runquiet : |
---|
62 | @+make $(basename $@) CFLAGS="-w" |
---|
63 | @taskset -c 1 ./a.out |
---|
64 | @rm -f a.out |
---|
65 | |
---|
66 | %.make : |
---|
67 | @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) |
---|
68 | @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 |
---|
69 | |
---|
70 | ${REPEAT} : |
---|
71 | @+make -C ${abs_top_builddir}/tools repeat |
---|
72 | |
---|
73 | ## ========================================================================================================= |
---|
74 | |
---|
75 | jenkins$(EXEEXT): |
---|
76 | @echo "{" |
---|
77 | @echo -e '\t"githash": "'${githash}'",' |
---|
78 | @echo -e '\t"arch": "' ${arch} '",' |
---|
79 | @DOifskipcompile@ |
---|
80 | @echo -e '\t"compile": {' |
---|
81 | @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' |
---|
82 | @echo -e '\t\t"dummy" : {}' |
---|
83 | @echo -e '\t},' |
---|
84 | @DOendif@ |
---|
85 | @echo -e '\t"ctxswitch": {' |
---|
86 | @echo -en '\t\t"coroutine":' |
---|
87 | @+make ctxswitch-cfa_coroutine.runquiet |
---|
88 | @echo -en '\t\t,"thread":' |
---|
89 | @+make ctxswitch-cfa_thread.runquiet |
---|
90 | @echo -e '\t},' |
---|
91 | @echo -e '\t"mutex": [' |
---|
92 | @echo -en '\t\t' |
---|
93 | @+make mutex-cfa1.runquiet |
---|
94 | @echo -en '\t\t,' |
---|
95 | @+make mutex-cfa2.runquiet |
---|
96 | @echo -e '\t],' |
---|
97 | @echo -e '\t"scheduling": [' |
---|
98 | @echo -en '\t\t' |
---|
99 | @+make signal-cfa1.runquiet |
---|
100 | @echo -en '\t\t,' |
---|
101 | @+make signal-cfa2.runquiet |
---|
102 | @echo -en '\t\t,' |
---|
103 | @+make waitfor-cfa1.runquiet |
---|
104 | @echo -en '\t\t,' |
---|
105 | @+make waitfor-cfa2.runquiet |
---|
106 | @echo -e '\n\t],' |
---|
107 | @echo -e '\t"epoch": ' $(shell date +%s) |
---|
108 | @echo "}" |
---|
109 | |
---|
110 | ## ========================================================================================================= |
---|
111 | loop$(EXEEXT): |
---|
112 | $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c |
---|
113 | |
---|
114 | function$(EXEEXT): |
---|
115 | $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c |
---|
116 | |
---|
117 | fetch_add$(EXEEXT): |
---|
118 | $(AM_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c |
---|
119 | |
---|
120 | ## ========================================================================================================= |
---|
121 | CTXSWITCH_DEPEND = \ |
---|
122 | loop.run \ |
---|
123 | function.run \ |
---|
124 | fetch_add.run \ |
---|
125 | ctxswitch-pthread.run \ |
---|
126 | ctxswitch-cfa_coroutine.run \ |
---|
127 | ctxswitch-cfa_thread.run \ |
---|
128 | ctxswitch-cfa_thread2.run \ |
---|
129 | ctxswitch-upp_coroutine.run \ |
---|
130 | ctxswitch-upp_thread.run \ |
---|
131 | ctxswitch-goroutine.run \ |
---|
132 | ctxswitch-java_thread.run |
---|
133 | |
---|
134 | if WITH_LIBFIBRE |
---|
135 | CTXSWITCH_DEPEND += \ |
---|
136 | ctxswitch-kos_fibre.run \ |
---|
137 | ctxswitch-kos_fibre2.run |
---|
138 | |
---|
139 | |
---|
140 | ctxswitch-kos_fibre$(EXEEXT): |
---|
141 | $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
142 | |
---|
143 | ctxswitch-kos_fibre2$(EXEEXT): |
---|
144 | $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
145 | endif |
---|
146 | |
---|
147 | ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) |
---|
148 | |
---|
149 | ctxswitch-pthread$(EXEEXT): |
---|
150 | $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c |
---|
151 | |
---|
152 | ctxswitch-cfa_coroutine$(EXEEXT): |
---|
153 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.cfa |
---|
154 | |
---|
155 | ctxswitch-cfa_thread$(EXEEXT): |
---|
156 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.cfa |
---|
157 | |
---|
158 | ctxswitch-cfa_thread2$(EXEEXT): |
---|
159 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.cfa |
---|
160 | |
---|
161 | ctxswitch-upp_coroutine$(EXEEXT): |
---|
162 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc |
---|
163 | |
---|
164 | ctxswitch-upp_thread$(EXEEXT): |
---|
165 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc |
---|
166 | |
---|
167 | ctxswitch-goroutine$(EXEEXT): |
---|
168 | $(AM_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go |
---|
169 | |
---|
170 | ctxswitch-java_thread$(EXEEXT): |
---|
171 | $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java |
---|
172 | @echo "#!/bin/sh" > a.out |
---|
173 | @echo "java JavaThread" >> a.out |
---|
174 | @chmod a+x a.out |
---|
175 | |
---|
176 | ## ========================================================================================================= |
---|
177 | mutex$(EXEEXT) :\ |
---|
178 | loop.run \ |
---|
179 | function.run \ |
---|
180 | fetch_add.run \ |
---|
181 | mutex-pthread_lock.run \ |
---|
182 | mutex-upp.run \ |
---|
183 | mutex-cfa1.run \ |
---|
184 | mutex-cfa2.run \ |
---|
185 | mutex-cfa4.run \ |
---|
186 | mutex-java_thread.run |
---|
187 | |
---|
188 | mutex-pthread_lock$(EXEEXT): |
---|
189 | $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c |
---|
190 | |
---|
191 | mutex-upp$(EXEEXT): |
---|
192 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc |
---|
193 | |
---|
194 | mutex-cfa1$(EXEEXT): |
---|
195 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.cfa |
---|
196 | |
---|
197 | mutex-cfa2$(EXEEXT): |
---|
198 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.cfa |
---|
199 | |
---|
200 | mutex-cfa4$(EXEEXT): |
---|
201 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.cfa |
---|
202 | |
---|
203 | mutex-java_thread$(EXEEXT): |
---|
204 | $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java |
---|
205 | @echo "#!/bin/sh" > a.out |
---|
206 | @echo "java JavaThread" >> a.out |
---|
207 | @chmod a+x a.out |
---|
208 | |
---|
209 | ## ========================================================================================================= |
---|
210 | signal$(EXEEXT) :\ |
---|
211 | signal-pthread_cond.run \ |
---|
212 | signal-upp.run \ |
---|
213 | signal-cfa1.run \ |
---|
214 | signal-cfa2.run \ |
---|
215 | signal-cfa4.run \ |
---|
216 | signal-java_thread.run |
---|
217 | |
---|
218 | signal-pthread_cond$(EXEEXT): |
---|
219 | $(AM_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c |
---|
220 | |
---|
221 | signal-upp$(EXEEXT): |
---|
222 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc |
---|
223 | |
---|
224 | signal-cfa1$(EXEEXT): |
---|
225 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.cfa |
---|
226 | |
---|
227 | signal-cfa2$(EXEEXT): |
---|
228 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.cfa |
---|
229 | |
---|
230 | signal-cfa4$(EXEEXT): |
---|
231 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.cfa |
---|
232 | |
---|
233 | signal-java_thread$(EXEEXT): |
---|
234 | $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java |
---|
235 | @echo "#!/bin/sh" > a.out |
---|
236 | @echo "java JavaThread" >> a.out |
---|
237 | @chmod a+x a.out |
---|
238 | |
---|
239 | |
---|
240 | ## ========================================================================================================= |
---|
241 | waitfor$(EXEEXT) :\ |
---|
242 | waitfor-upp.run \ |
---|
243 | waitfor-cfa1.run \ |
---|
244 | waitfor-cfa2.run \ |
---|
245 | waitfor-cfa4.run |
---|
246 | |
---|
247 | waitfor-upp$(EXEEXT): |
---|
248 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc |
---|
249 | |
---|
250 | waitfor-cfa1$(EXEEXT): |
---|
251 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.cfa |
---|
252 | |
---|
253 | waitfor-cfa2$(EXEEXT): |
---|
254 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.cfa |
---|
255 | |
---|
256 | waitfor-cfa4$(EXEEXT): |
---|
257 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.cfa |
---|
258 | |
---|
259 | ## ========================================================================================================= |
---|
260 | creation$(EXEEXT) :\ |
---|
261 | creation-pthread.run \ |
---|
262 | creation-cfa_coroutine.run \ |
---|
263 | creation-cfa_coroutine_eager.run \ |
---|
264 | creation-cfa_thread.run \ |
---|
265 | creation-upp_coroutine.run \ |
---|
266 | creation-upp_thread.run \ |
---|
267 | creation-goroutine.run \ |
---|
268 | creation-java_thread.run |
---|
269 | |
---|
270 | creation-cfa_coroutine$(EXEEXT): |
---|
271 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa |
---|
272 | |
---|
273 | creation-cfa_coroutine_eager$(EXEEXT): |
---|
274 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.cfa -DEAGER |
---|
275 | |
---|
276 | creation-cfa_thread$(EXEEXT): |
---|
277 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.cfa |
---|
278 | |
---|
279 | creation-upp_coroutine$(EXEEXT): |
---|
280 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc |
---|
281 | |
---|
282 | creation-upp_thread$(EXEEXT): |
---|
283 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc |
---|
284 | |
---|
285 | creation-pthread$(EXEEXT): |
---|
286 | $(AM_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c |
---|
287 | |
---|
288 | creation-goroutine$(EXEEXT): |
---|
289 | $(AM_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go |
---|
290 | |
---|
291 | creation-java_thread$(EXEEXT): |
---|
292 | $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java |
---|
293 | @echo "#!/bin/sh" > a.out |
---|
294 | @echo "java JavaThread" >> a.out |
---|
295 | @chmod a+x a.out |
---|
296 | |
---|
297 | ## ========================================================================================================= |
---|
298 | |
---|
299 | compile$(EXEEXT) :\ |
---|
300 | compile-array.make \ |
---|
301 | compile-attributes.make \ |
---|
302 | compile-empty.make \ |
---|
303 | compile-expression.make \ |
---|
304 | compile-io.make \ |
---|
305 | compile-monitor.make \ |
---|
306 | compile-operators.make \ |
---|
307 | compile-typeof.make |
---|
308 | |
---|
309 | |
---|
310 | testdir = $(top_srcdir)/tests |
---|
311 | |
---|
312 | compile-array$(EXEEXT): |
---|
313 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.cfa |
---|
314 | |
---|
315 | compile-attributes$(EXEEXT): |
---|
316 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa |
---|
317 | |
---|
318 | compile-empty$(EXEEXT): |
---|
319 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.cfa |
---|
320 | |
---|
321 | compile-expression$(EXEEXT): |
---|
322 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.cfa |
---|
323 | |
---|
324 | compile-io$(EXEEXT): |
---|
325 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.cfa |
---|
326 | |
---|
327 | compile-monitor$(EXEEXT): |
---|
328 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.cfa |
---|
329 | |
---|
330 | compile-operators$(EXEEXT): |
---|
331 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.cfa |
---|
332 | |
---|
333 | compile-thread$(EXEEXT): |
---|
334 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.cfa |
---|
335 | |
---|
336 | compile-typeof$(EXEEXT): |
---|
337 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa |
---|
338 | |
---|