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 = -g -Wall -Wno-unused-function -O2 |
---|
20 | CC = @CFA_BINDIR@/@CFA_NAME@ |
---|
21 | TOOLSDIR = ${abs_top_srcdir}/tools/ |
---|
22 | REPEAT = ${TOOLSDIR}repeat |
---|
23 | STATS = ${TOOLSDIR}stat.py |
---|
24 | repeats = 30 |
---|
25 | TIME_FORMAT = "%E" |
---|
26 | PRINT_FORMAT = %20s: #Comments needed for spacing |
---|
27 | |
---|
28 | .NOTPARALLEL: |
---|
29 | |
---|
30 | noinst_PROGRAMS = |
---|
31 | |
---|
32 | all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) |
---|
33 | |
---|
34 | %.run : %$(EXEEXT) ${REPEAT} |
---|
35 | @rm -f .result.log |
---|
36 | @echo "------------------------------------------------------" |
---|
37 | @echo $< |
---|
38 | @${REPEAT} ${repeats} ./a.out | tee -a .result.log |
---|
39 | @${STATS} .result.log |
---|
40 | @echo "------------------------------------------------------" |
---|
41 | @rm -f a.out .result.log |
---|
42 | |
---|
43 | %.runquiet : |
---|
44 | @+make $(basename $@) |
---|
45 | @./a.out |
---|
46 | @rm -f a.out |
---|
47 | |
---|
48 | %.make : |
---|
49 | @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) |
---|
50 | @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 |
---|
51 | |
---|
52 | ${REPEAT} : |
---|
53 | @+make -C ${TOOLSDIR} repeat |
---|
54 | |
---|
55 | ## ========================================================================================================= |
---|
56 | |
---|
57 | jenkins$(EXEEXT): |
---|
58 | @echo "{" |
---|
59 | @echo -e '\t"githash": "'${githash}'",' |
---|
60 | @echo -e '\t"arch": "' ${arch} '",' |
---|
61 | @echo -e '\t"compile": {' |
---|
62 | @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' |
---|
63 | @echo -e '\t\t"dummy" : {}' |
---|
64 | @echo -e '\t},' |
---|
65 | @echo -e '\t"ctxswitch": {' |
---|
66 | @echo -en '\t\t"coroutine":' |
---|
67 | @+make ctxswitch-cfa_coroutine.runquiet |
---|
68 | @echo -en '\t\t,"thread":' |
---|
69 | @+make ctxswitch-cfa_thread.runquiet |
---|
70 | @echo -e '\t},' |
---|
71 | @echo -e '\t"mutex": [' |
---|
72 | @echo -en '\t\t' |
---|
73 | @+make mutex-cfa1.runquiet |
---|
74 | @echo -en '\t\t,' |
---|
75 | @+make mutex-cfa2.runquiet |
---|
76 | @echo -e '\t],' |
---|
77 | @echo -e '\t"scheduling": [' |
---|
78 | @echo -en '\t\t' |
---|
79 | @+make signal-cfa1.runquiet |
---|
80 | @echo -en '\t\t,' |
---|
81 | @+make signal-cfa2.runquiet |
---|
82 | @echo -en '\t\t,' |
---|
83 | @+make waitfor-cfa1.runquiet |
---|
84 | @echo -en '\t\t,' |
---|
85 | @+make waitfor-cfa2.runquiet |
---|
86 | @echo -e '\n\t],' |
---|
87 | @echo -e '\t"epoch": ' $(shell date +%s) |
---|
88 | @echo "}" |
---|
89 | |
---|
90 | ## ========================================================================================================= |
---|
91 | ctxswitch$(EXEEXT): \ |
---|
92 | ctxswitch-pthread.run \ |
---|
93 | ctxswitch-cfa_coroutine.run \ |
---|
94 | ctxswitch-cfa_thread.run \ |
---|
95 | ctxswitch-upp_coroutine.run \ |
---|
96 | ctxswitch-upp_thread.run \ |
---|
97 | ctxswitch-goroutine.run \ |
---|
98 | ctxswitch-java_thread.run |
---|
99 | |
---|
100 | ctxswitch-cfa_coroutine$(EXEEXT): |
---|
101 | @${CC} ctxswitch/cfa_cor.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
102 | |
---|
103 | ctxswitch-cfa_thread$(EXEEXT): |
---|
104 | @${CC} ctxswitch/cfa_thrd.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
105 | |
---|
106 | ctxswitch-upp_coroutine$(EXEEXT): |
---|
107 | @u++ ctxswitch/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
108 | |
---|
109 | ctxswitch-upp_thread$(EXEEXT): |
---|
110 | @u++ ctxswitch/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
111 | |
---|
112 | ctxswitch-pthread$(EXEEXT): |
---|
113 | @@BACKEND_CC@ ctxswitch/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
114 | |
---|
115 | ctxswitch-goroutine$(EXEEXT): |
---|
116 | @go build -o a.out ctxswitch/goroutine.go |
---|
117 | |
---|
118 | ctxswitch-java_thread$(EXEEXT): |
---|
119 | @javac ctxswitch/JavaThread.java |
---|
120 | @echo "#!/bin/sh" > a.out |
---|
121 | @echo "cd ctxswitch && java JavaThread" >> a.out |
---|
122 | @chmod a+x a.out |
---|
123 | |
---|
124 | ## ========================================================================================================= |
---|
125 | mutex$(EXEEXT) :\ |
---|
126 | mutex-function.run \ |
---|
127 | mutex-pthread_lock.run \ |
---|
128 | mutex-upp.run \ |
---|
129 | mutex-cfa1.run \ |
---|
130 | mutex-cfa2.run \ |
---|
131 | mutex-cfa4.run |
---|
132 | |
---|
133 | mutex-function$(EXEEXT): |
---|
134 | @@BACKEND_CC@ mutex/function.c -DBENCH_N=500000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
135 | |
---|
136 | mutex-pthread_lock$(EXEEXT): |
---|
137 | @@BACKEND_CC@ mutex/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
138 | |
---|
139 | mutex-upp$(EXEEXT): |
---|
140 | @u++ mutex/upp.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
141 | |
---|
142 | mutex-cfa1$(EXEEXT): |
---|
143 | @${CC} mutex/cfa1.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
144 | |
---|
145 | mutex-cfa2$(EXEEXT): |
---|
146 | @${CC} mutex/cfa2.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
147 | |
---|
148 | mutex-cfa4$(EXEEXT): |
---|
149 | @${CC} mutex/cfa4.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
150 | |
---|
151 | ## ========================================================================================================= |
---|
152 | signal$(EXEEXT) :\ |
---|
153 | signal-upp.run \ |
---|
154 | signal-cfa1.run \ |
---|
155 | signal-cfa2.run \ |
---|
156 | signal-cfa4.run |
---|
157 | |
---|
158 | signal-upp$(EXEEXT): |
---|
159 | @u++ schedint/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
160 | |
---|
161 | signal-cfa1$(EXEEXT): |
---|
162 | @${CC} schedint/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
163 | |
---|
164 | signal-cfa2$(EXEEXT): |
---|
165 | @${CC} schedint/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
166 | |
---|
167 | signal-cfa4$(EXEEXT): |
---|
168 | @${CC} schedint/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
169 | |
---|
170 | ## ========================================================================================================= |
---|
171 | waitfor$(EXEEXT) :\ |
---|
172 | waitfor-upp.run \ |
---|
173 | waitfor-cfa1.run \ |
---|
174 | waitfor-cfa2.run \ |
---|
175 | waitfor-cfa4.run |
---|
176 | |
---|
177 | waitfor-upp$(EXEEXT): |
---|
178 | @u++ schedext/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
179 | |
---|
180 | waitfor-cfa1$(EXEEXT): |
---|
181 | @${CC} schedext/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
182 | |
---|
183 | waitfor-cfa2$(EXEEXT): |
---|
184 | @${CC} schedext/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
185 | |
---|
186 | waitfor-cfa4$(EXEEXT): |
---|
187 | @${CC} schedext/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
188 | |
---|
189 | ## ========================================================================================================= |
---|
190 | creation$(EXEEXT) :\ |
---|
191 | creation-pthread.run \ |
---|
192 | creation-cfa_coroutine.run \ |
---|
193 | creation-cfa_coroutine_eager.run \ |
---|
194 | creation-cfa_thread.run \ |
---|
195 | creation-upp_coroutine.run \ |
---|
196 | creation-upp_thread.run \ |
---|
197 | creation-goroutine.run \ |
---|
198 | creation-java_thread.run |
---|
199 | |
---|
200 | creation-cfa_coroutine$(EXEEXT): |
---|
201 | @${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
202 | |
---|
203 | creation-cfa_coroutine_eager$(EXEEXT): |
---|
204 | @${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -DEAGER |
---|
205 | |
---|
206 | creation-cfa_thread$(EXEEXT): |
---|
207 | @${CC} creation/cfa_thrd.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
208 | |
---|
209 | creation-upp_coroutine$(EXEEXT): |
---|
210 | @u++ creation/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
211 | |
---|
212 | creation-upp_thread$(EXEEXT): |
---|
213 | @u++ creation/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
214 | |
---|
215 | creation-pthread$(EXEEXT): |
---|
216 | @@BACKEND_CC@ creation/pthreads.c -DBENCH_N=250000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
217 | |
---|
218 | creation-goroutine$(EXEEXT): |
---|
219 | @go build -o a.out creation/goroutine.go |
---|
220 | |
---|
221 | creation-java_thread$(EXEEXT): |
---|
222 | @javac creation/JavaThread.java |
---|
223 | @echo "#!/bin/sh" > a.out |
---|
224 | @echo "cd creation && java JavaThread" >> a.out |
---|
225 | @chmod a+x a.out |
---|
226 | |
---|
227 | ## ========================================================================================================= |
---|
228 | |
---|
229 | compile$(EXEEXT) :\ |
---|
230 | compile-array.make \ |
---|
231 | compile-attributes.make \ |
---|
232 | compile-empty.make \ |
---|
233 | compile-expression.make \ |
---|
234 | compile-io.make \ |
---|
235 | compile-monitor.make \ |
---|
236 | compile-operators.make \ |
---|
237 | compile-typeof.make |
---|
238 | |
---|
239 | |
---|
240 | compile-array$(EXEEXT): |
---|
241 | @${CC} -nodebug -quiet -fsyntax-only -w ../tests/array.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
242 | |
---|
243 | compile-attributes$(EXEEXT): |
---|
244 | @${CC} -nodebug -quiet -fsyntax-only -w ../tests/attributes.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
245 | |
---|
246 | compile-empty$(EXEEXT): |
---|
247 | @${CC} -nodebug -quiet -fsyntax-only -w compile/empty.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
248 | |
---|
249 | compile-expression$(EXEEXT): |
---|
250 | @${CC} -nodebug -quiet -fsyntax-only -w ../tests/expression.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
251 | |
---|
252 | compile-io$(EXEEXT): |
---|
253 | @${CC} -nodebug -quiet -fsyntax-only -w ../tests/io.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
254 | |
---|
255 | compile-monitor$(EXEEXT): |
---|
256 | @${CC} -nodebug -quiet -fsyntax-only -w ../tests/monitor.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
257 | |
---|
258 | compile-operators$(EXEEXT): |
---|
259 | @${CC} -nodebug -quiet -fsyntax-only -w ../tests/operators.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
260 | |
---|
261 | compile-thread$(EXEEXT): |
---|
262 | @${CC} -nodebug -quiet -fsyntax-only -w ../tests/thread.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
263 | |
---|
264 | compile-typeof$(EXEEXT): |
---|
265 | @${CC} -nodebug -quiet -fsyntax-only -w ../tests/typeof.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} |
---|
266 | |
---|