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