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