[ac93b228] | 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 | |
---|
[0c1b566] | 17 | AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names |
---|
| 18 | |
---|
[ac93b228] | 19 | # applies to both programs |
---|
[7a7ab42] | 20 | include $(top_srcdir)/src/cfa.make |
---|
| 21 | |
---|
[43fa66e] | 22 | UPPCC = u++ |
---|
[7a7ab42] | 23 | |
---|
| 24 | AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread |
---|
| 25 | AM_CFAFLAGS = -quiet -in-tree -nodebug |
---|
| 26 | AM_UPPFLAGS = -quiet -nodebug -multi |
---|
| 27 | |
---|
[b7170a64] | 28 | TOOLSDIR = ${abs_top_srcdir}/tools/ |
---|
| 29 | REPEAT = ${TOOLSDIR}repeat |
---|
| 30 | STATS = ${TOOLSDIR}stat.py |
---|
| 31 | repeats = 30 |
---|
[05f4b85] | 32 | skipcompile = no |
---|
[a5b7905] | 33 | TIME_FORMAT = "%E" |
---|
[2086ab2] | 34 | PRINT_FORMAT = %20s: #Comments needed for spacing |
---|
[034165a] | 35 | |
---|
[43fa66e] | 36 | #prevent any tests in parallel |
---|
[034165a] | 37 | .NOTPARALLEL: |
---|
[ac93b228] | 38 | |
---|
[43fa66e] | 39 | #make sure automake includes the compile rules for C and C++ |
---|
| 40 | EXTRA_PROGRAMS = dummy |
---|
| 41 | dummy_SOURCES = c.c cxx.cpp |
---|
[ac93b228] | 42 | |
---|
[43fa66e] | 43 | ## ========================================================================================================= |
---|
[4cedd9f] | 44 | all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) |
---|
| 45 | |
---|
[a5b7905] | 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 "------------------------------------------------------" |
---|
[88e139e] | 53 | @rm -f a.out .result.log *.class |
---|
[ac93b228] | 54 | |
---|
[a5b7905] | 55 | %.runquiet : |
---|
[52df81c] | 56 | @+make $(basename $@) CFLAGS="-w" |
---|
[05f4b85] | 57 | @taskset -c 1 ./a.out |
---|
[a5b7905] | 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} '",' |
---|
[05f4b85] | 73 | @DOifskipcompile@ |
---|
[91496f3] | 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},' |
---|
[05f4b85] | 78 | @DOendif@ |
---|
[a5b7905] | 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 "}" |
---|
[ac93b228] | 103 | |
---|
[d885a58] | 104 | ## ========================================================================================================= |
---|
| 105 | loop$(EXEEXT): |
---|
[43fa66e] | 106 | $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c |
---|
[d885a58] | 107 | |
---|
| 108 | function$(EXEEXT): |
---|
[43fa66e] | 109 | $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c |
---|
[d885a58] | 110 | |
---|
| 111 | fetch_add$(EXEEXT): |
---|
[43fa66e] | 112 | $(AM_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c |
---|
[d885a58] | 113 | |
---|
[034165a] | 114 | ## ========================================================================================================= |
---|
[41cca44] | 115 | CTXSWITCH_DEPEND = \ |
---|
[d885a58] | 116 | loop.run \ |
---|
| 117 | function.run \ |
---|
| 118 | fetch_add.run \ |
---|
[b7170a64] | 119 | ctxswitch-pthread.run \ |
---|
| 120 | ctxswitch-cfa_coroutine.run \ |
---|
| 121 | ctxswitch-cfa_thread.run \ |
---|
[6810fcb] | 122 | ctxswitch-cfa_thread2.run \ |
---|
[b7170a64] | 123 | ctxswitch-upp_coroutine.run \ |
---|
[50abab9] | 124 | ctxswitch-upp_thread.run \ |
---|
| 125 | ctxswitch-goroutine.run \ |
---|
| 126 | ctxswitch-java_thread.run |
---|
[034165a] | 127 | |
---|
[41cca44] | 128 | if WITH_LIBFIBRE |
---|
| 129 | CTXSWITCH_DEPEND += \ |
---|
| 130 | ctxswitch-kos_fibre.run \ |
---|
| 131 | ctxswitch-kos_fibre2.run |
---|
| 132 | |
---|
| 133 | |
---|
| 134 | ctxswitch-kos_fibre$(EXEEXT): |
---|
[43fa66e] | 135 | $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
[41cca44] | 136 | |
---|
| 137 | ctxswitch-kos_fibre2$(EXEEXT): |
---|
[43fa66e] | 138 | $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre |
---|
[41cca44] | 139 | endif |
---|
| 140 | |
---|
| 141 | ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) |
---|
| 142 | |
---|
[6810fcb] | 143 | ctxswitch-pthread$(EXEEXT): |
---|
[43fa66e] | 144 | $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c |
---|
[6810fcb] | 145 | |
---|
[034165a] | 146 | ctxswitch-cfa_coroutine$(EXEEXT): |
---|
[43fa66e] | 147 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c |
---|
[034165a] | 148 | |
---|
| 149 | ctxswitch-cfa_thread$(EXEEXT): |
---|
[43fa66e] | 150 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c |
---|
[6810fcb] | 151 | |
---|
| 152 | ctxswitch-cfa_thread2$(EXEEXT): |
---|
[43fa66e] | 153 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c |
---|
[034165a] | 154 | |
---|
| 155 | ctxswitch-upp_coroutine$(EXEEXT): |
---|
[43fa66e] | 156 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc |
---|
[034165a] | 157 | |
---|
| 158 | ctxswitch-upp_thread$(EXEEXT): |
---|
[43fa66e] | 159 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc |
---|
[ac93b228] | 160 | |
---|
[50abab9] | 161 | ctxswitch-goroutine$(EXEEXT): |
---|
[43fa66e] | 162 | $(AM_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go |
---|
[50abab9] | 163 | |
---|
| 164 | ctxswitch-java_thread$(EXEEXT): |
---|
[88e139e] | 165 | $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java |
---|
[50abab9] | 166 | @echo "#!/bin/sh" > a.out |
---|
[88e139e] | 167 | @echo "java JavaThread" >> a.out |
---|
[50abab9] | 168 | @chmod a+x a.out |
---|
| 169 | |
---|
[f54a0ab] | 170 | ## ========================================================================================================= |
---|
| 171 | mutex$(EXEEXT) :\ |
---|
[d885a58] | 172 | loop.run \ |
---|
| 173 | function.run \ |
---|
| 174 | fetch_add.run \ |
---|
[f54a0ab] | 175 | mutex-pthread_lock.run \ |
---|
| 176 | mutex-upp.run \ |
---|
| 177 | mutex-cfa1.run \ |
---|
| 178 | mutex-cfa2.run \ |
---|
[6aa537a4] | 179 | mutex-cfa4.run \ |
---|
| 180 | mutex-java_thread.run |
---|
[f54a0ab] | 181 | |
---|
| 182 | mutex-pthread_lock$(EXEEXT): |
---|
[43fa66e] | 183 | $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c |
---|
[f54a0ab] | 184 | |
---|
| 185 | mutex-upp$(EXEEXT): |
---|
[43fa66e] | 186 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc |
---|
[f54a0ab] | 187 | |
---|
| 188 | mutex-cfa1$(EXEEXT): |
---|
[43fa66e] | 189 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.c |
---|
[f54a0ab] | 190 | |
---|
| 191 | mutex-cfa2$(EXEEXT): |
---|
[43fa66e] | 192 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.c |
---|
[f54a0ab] | 193 | |
---|
| 194 | mutex-cfa4$(EXEEXT): |
---|
[43fa66e] | 195 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.c |
---|
[034165a] | 196 | |
---|
[6aa537a4] | 197 | mutex-java_thread$(EXEEXT): |
---|
[88e139e] | 198 | $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java |
---|
[6aa537a4] | 199 | @echo "#!/bin/sh" > a.out |
---|
[88e139e] | 200 | @echo "java JavaThread" >> a.out |
---|
[6aa537a4] | 201 | @chmod a+x a.out |
---|
| 202 | |
---|
[9f0b975] | 203 | ## ========================================================================================================= |
---|
| 204 | signal$(EXEEXT) :\ |
---|
[3eb4541] | 205 | signal-pthread_cond.run \ |
---|
[9f0b975] | 206 | signal-upp.run \ |
---|
| 207 | signal-cfa1.run \ |
---|
| 208 | signal-cfa2.run \ |
---|
[56de6b39] | 209 | signal-cfa4.run \ |
---|
| 210 | signal-java_thread.run |
---|
[9f0b975] | 211 | |
---|
[3eb4541] | 212 | signal-pthread_cond$(EXEEXT): |
---|
[43fa66e] | 213 | $(AM_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c |
---|
[3eb4541] | 214 | |
---|
[9f0b975] | 215 | signal-upp$(EXEEXT): |
---|
[43fa66e] | 216 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc |
---|
[9f0b975] | 217 | |
---|
| 218 | signal-cfa1$(EXEEXT): |
---|
[43fa66e] | 219 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.c |
---|
[9f0b975] | 220 | |
---|
| 221 | signal-cfa2$(EXEEXT): |
---|
[43fa66e] | 222 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.c |
---|
[9f0b975] | 223 | |
---|
| 224 | signal-cfa4$(EXEEXT): |
---|
[43fa66e] | 225 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.c |
---|
[9f0b975] | 226 | |
---|
[6aa537a4] | 227 | signal-java_thread$(EXEEXT): |
---|
[88e139e] | 228 | $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java |
---|
[6aa537a4] | 229 | @echo "#!/bin/sh" > a.out |
---|
[88e139e] | 230 | @echo "java JavaThread" >> a.out |
---|
[6aa537a4] | 231 | @chmod a+x a.out |
---|
| 232 | |
---|
| 233 | |
---|
[9f0b975] | 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): |
---|
[43fa66e] | 242 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc |
---|
[9f0b975] | 243 | |
---|
| 244 | waitfor-cfa1$(EXEEXT): |
---|
[43fa66e] | 245 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.c |
---|
[9f0b975] | 246 | |
---|
| 247 | waitfor-cfa2$(EXEEXT): |
---|
[43fa66e] | 248 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.c |
---|
[9f0b975] | 249 | |
---|
| 250 | waitfor-cfa4$(EXEEXT): |
---|
[43fa66e] | 251 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.c |
---|
[9f0b975] | 252 | |
---|
[4cedd9f] | 253 | ## ========================================================================================================= |
---|
| 254 | creation$(EXEEXT) :\ |
---|
[3351cc0] | 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 \ |
---|
[50abab9] | 260 | creation-upp_thread.run \ |
---|
| 261 | creation-goroutine.run \ |
---|
| 262 | creation-java_thread.run |
---|
[4cedd9f] | 263 | |
---|
| 264 | creation-cfa_coroutine$(EXEEXT): |
---|
[43fa66e] | 265 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c |
---|
[4cedd9f] | 266 | |
---|
[3351cc0] | 267 | creation-cfa_coroutine_eager$(EXEEXT): |
---|
[43fa66e] | 268 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c |
---|
[3351cc0] | 269 | |
---|
[4cedd9f] | 270 | creation-cfa_thread$(EXEEXT): |
---|
[43fa66e] | 271 | $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c |
---|
[4cedd9f] | 272 | |
---|
| 273 | creation-upp_coroutine$(EXEEXT): |
---|
[43fa66e] | 274 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc |
---|
[4cedd9f] | 275 | |
---|
| 276 | creation-upp_thread$(EXEEXT): |
---|
[43fa66e] | 277 | $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc |
---|
[4cedd9f] | 278 | |
---|
| 279 | creation-pthread$(EXEEXT): |
---|
[43fa66e] | 280 | $(AM_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c |
---|
[4cedd9f] | 281 | |
---|
[50abab9] | 282 | creation-goroutine$(EXEEXT): |
---|
[43fa66e] | 283 | $(AM_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go |
---|
[50abab9] | 284 | |
---|
| 285 | creation-java_thread$(EXEEXT): |
---|
[88e139e] | 286 | $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java |
---|
[50abab9] | 287 | @echo "#!/bin/sh" > a.out |
---|
[88e139e] | 288 | @echo "java JavaThread" >> a.out |
---|
[50abab9] | 289 | @chmod a+x a.out |
---|
| 290 | |
---|
[034165a] | 291 | ## ========================================================================================================= |
---|
| 292 | |
---|
[3edc2df] | 293 | compile$(EXEEXT) :\ |
---|
[a5b7905] | 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 |
---|
[3edc2df] | 302 | |
---|
| 303 | |
---|
[524ed86] | 304 | testdir = $(top_srcdir)/tests |
---|
[d3db83c] | 305 | |
---|
[3edc2df] | 306 | compile-array$(EXEEXT): |
---|
[43fa66e] | 307 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c |
---|
[3edc2df] | 308 | |
---|
| 309 | compile-attributes$(EXEEXT): |
---|
[43fa66e] | 310 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.c |
---|
[3edc2df] | 311 | |
---|
| 312 | compile-empty$(EXEEXT): |
---|
[43fa66e] | 313 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c |
---|
[3edc2df] | 314 | |
---|
| 315 | compile-expression$(EXEEXT): |
---|
[43fa66e] | 316 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c |
---|
[3edc2df] | 317 | |
---|
| 318 | compile-io$(EXEEXT): |
---|
[43fa66e] | 319 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c |
---|
[3edc2df] | 320 | |
---|
| 321 | compile-monitor$(EXEEXT): |
---|
[43fa66e] | 322 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c |
---|
[3edc2df] | 323 | |
---|
| 324 | compile-operators$(EXEEXT): |
---|
[43fa66e] | 325 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c |
---|
[3edc2df] | 326 | |
---|
| 327 | compile-thread$(EXEEXT): |
---|
[43fa66e] | 328 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c |
---|
[3edc2df] | 329 | |
---|
| 330 | compile-typeof$(EXEEXT): |
---|
[43fa66e] | 331 | $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c |
---|
[3edc2df] | 332 | |
---|