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