######################## -*- Mode: Makefile-Automake -*- ###################### ## ## Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo ## ## The contents of this file are covered under the licence agreement in the ## file "LICENCE" distributed with Cforall. ## ## Makefile.am -- ## ## Author : Peter A. Buhr ## Created On : Sun May 31 09:08:15 2015 ## Last Modified By : Peter A. Buhr ## Last Modified On : Mon Jan 25 22:31:42 2016 ## Update Count : 25 ############################################################################### # applies to both programs CFLAGS = AM_CFLAGS = \ -g \ -O2 \ -Wall \ -Wno-unused-function \ -quiet \ -I$(srcdir) \ @BUILD_IN_TREE_FLAGS@ CC = @CFACC@ TOOLSDIR = ${abs_top_srcdir}/tools/ REPEAT = ${TOOLSDIR}repeat STATS = ${TOOLSDIR}stat.py repeats = 30 skipcompile = no TIME_FORMAT = "%E" PRINT_FORMAT = %20s: #Comments needed for spacing .NOTPARALLEL: noinst_PROGRAMS = all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) %.run : %$(EXEEXT) ${REPEAT} @rm -f .result.log @echo "------------------------------------------------------" @echo $< @${REPEAT} ${repeats} ./a.out | tee -a .result.log @${STATS} .result.log @echo "------------------------------------------------------" @rm -f a.out .result.log %.runquiet : @+make $(basename $@) CFLAGS="-w" @taskset -c 1 ./a.out @rm -f a.out %.make : @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 ${REPEAT} : @+make -C ${TOOLSDIR} repeat ## ========================================================================================================= jenkins$(EXEEXT): @echo "{" @echo -e '\t"githash": "'${githash}'",' @echo -e '\t"arch": "' ${arch} '",' @DOifskipcompile@ @echo -e '\t"compile": {' @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' @echo -e '\t\t"dummy" : {}' @echo -e '\t},' @DOendif@ @echo -e '\t"ctxswitch": {' @echo -en '\t\t"coroutine":' @+make ctxswitch-cfa_coroutine.runquiet @echo -en '\t\t,"thread":' @+make ctxswitch-cfa_thread.runquiet @echo -e '\t},' @echo -e '\t"mutex": [' @echo -en '\t\t' @+make mutex-cfa1.runquiet @echo -en '\t\t,' @+make mutex-cfa2.runquiet @echo -e '\t],' @echo -e '\t"scheduling": [' @echo -en '\t\t' @+make signal-cfa1.runquiet @echo -en '\t\t,' @+make signal-cfa2.runquiet @echo -en '\t\t,' @+make waitfor-cfa1.runquiet @echo -en '\t\t,' @+make waitfor-cfa2.runquiet @echo -e '\n\t],' @echo -e '\t"epoch": ' $(shell date +%s) @echo "}" ## ========================================================================================================= loop$(EXEEXT): @@BACKEND_CC@ loop.c -DBENCH_N=5000000000 -I$(srcdir) -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} function$(EXEEXT): @@BACKEND_CC@ function.c -DBENCH_N=5000000000 -I$(srcdir) -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} fetch_add$(EXEEXT): @@BACKEND_CC@ fetch_add.c -DBENCH_N=500000000 -I$(srcdir) -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} ## ========================================================================================================= ctxswitch$(EXEEXT): \ loop.run \ function.run \ fetch_add.run \ ctxswitch-pthread.run \ ctxswitch-cfa_coroutine.run \ ctxswitch-cfa_thread.run \ ctxswitch-cfa_thread2.run \ ctxswitch-upp_coroutine.run \ ctxswitch-upp_thread.run \ -ctxswitch-kos_fibre.run \ -ctxswitch-kos_fibre2.run \ ctxswitch-goroutine.run \ ctxswitch-java_thread.run ctxswitch-pthread$(EXEEXT): @@BACKEND_CC@ $(srcdir)/ctxswitch/pthreads.c -DBENCH_N=50000000 -I$(srcdir) -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} ctxswitch-cfa_coroutine$(EXEEXT): @${CC} $(srcdir)/ctxswitch/cfa_cor.c -DBENCH_N=50000000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ctxswitch-cfa_thread$(EXEEXT): @${CC} $(srcdir)/ctxswitch/cfa_thrd.c -DBENCH_N=50000000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ctxswitch-cfa_thread2$(EXEEXT): @${CC} $(srcdir)/ctxswitch/cfa_thrd2.c -DBENCH_N=50000000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ctxswitch-upp_coroutine$(EXEEXT): @u++ $(srcdir)/ctxswitch/upp_cor.cc -DBENCH_N=50000000 -I$(srcdir) -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} ctxswitch-upp_thread$(EXEEXT): @u++ $(srcdir)/ctxswitch/upp_thrd.cc -DBENCH_N=50000000 -I$(srcdir) -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} ctxswitch-kos_fibre$(EXEEXT): @${CXX} $(srcdir)/ctxswitch/kos_fibre.cpp -DBENCH_N=50000000 -I$(srcdir) -I/home/tdelisle/software/KOS/src/ -g -O2 -lfibre -lpthread -lrt ctxswitch-kos_fibre2$(EXEEXT): @${CXX} $(srcdir)/ctxswitch/kos_fibre2.cpp -DBENCH_N=50000000 -I$(srcdir) -I/home/tdelisle/software/KOS/src/ -g -O2 -lfibre -lpthread -lrt ctxswitch-goroutine$(EXEEXT): @go build -o a.out $(srcdir)/ctxswitch/goroutine.go ctxswitch-java_thread$(EXEEXT): @javac $(srcdir)/ctxswitch/JavaThread.java @echo "#!/bin/sh" > a.out @echo "cd ctxswitch && java JavaThread" >> a.out @chmod a+x a.out ## ========================================================================================================= mutex$(EXEEXT) :\ loop.run \ function.run \ fetch_add.run \ mutex-pthread_lock.run \ mutex-upp.run \ mutex-cfa1.run \ mutex-cfa2.run \ mutex-cfa4.run \ mutex-java_thread.run mutex-pthread_lock$(EXEEXT): @@BACKEND_CC@ $(srcdir)/mutex/pthreads.c -DBENCH_N=50000000 -I$(srcdir) -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} mutex-upp$(EXEEXT): @u++ $(srcdir)/mutex/upp.cc -DBENCH_N=50000000 -I$(srcdir) -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} mutex-cfa1$(EXEEXT): @${CC} $(srcdir)/mutex/cfa1.c -DBENCH_N=5000000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} mutex-cfa2$(EXEEXT): @${CC} $(srcdir)/mutex/cfa2.c -DBENCH_N=5000000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} mutex-cfa4$(EXEEXT): @${CC} $(srcdir)/mutex/cfa4.c -DBENCH_N=5000000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} mutex-java_thread$(EXEEXT): @javac $(srcdir)/mutex/JavaThread.java @echo "#!/bin/sh" > a.out @echo "cd mutex && java JavaThread" >> a.out @chmod a+x a.out ## ========================================================================================================= signal$(EXEEXT) :\ signal-pthread_cond.run \ signal-upp.run \ signal-cfa1.run \ signal-cfa2.run \ signal-cfa4.run \ signal-java_thread.run signal-pthread_cond$(EXEEXT): @@BACKEND_CC@ $(srcdir)/schedint/pthreads.c -DBENCH_N=500000 -I$(srcdir) -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} signal-upp$(EXEEXT): @u++ $(srcdir)/schedint/upp.cc -DBENCH_N=5000000 -I$(srcdir) -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} signal-cfa1$(EXEEXT): @${CC} $(srcdir)/schedint/cfa1.c -DBENCH_N=500000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} signal-cfa2$(EXEEXT): @${CC} $(srcdir)/schedint/cfa2.c -DBENCH_N=500000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} signal-cfa4$(EXEEXT): @${CC} $(srcdir)/schedint/cfa4.c -DBENCH_N=500000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} signal-java_thread$(EXEEXT): @javac $(srcdir)/schedint/JavaThread.java @echo "#!/bin/sh" > a.out @echo "cd schedint && java JavaThread" >> a.out @chmod a+x a.out ## ========================================================================================================= waitfor$(EXEEXT) :\ waitfor-upp.run \ waitfor-cfa1.run \ waitfor-cfa2.run \ waitfor-cfa4.run waitfor-upp$(EXEEXT): @u++ $(srcdir)/schedext/upp.cc -DBENCH_N=5000000 -I$(srcdir) -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} waitfor-cfa1$(EXEEXT): @${CC} $(srcdir)/schedext/cfa1.c -DBENCH_N=500000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} waitfor-cfa2$(EXEEXT): @${CC} $(srcdir)/schedext/cfa2.c -DBENCH_N=500000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} waitfor-cfa4$(EXEEXT): @${CC} $(srcdir)/schedext/cfa4.c -DBENCH_N=500000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ## ========================================================================================================= creation$(EXEEXT) :\ creation-pthread.run \ creation-cfa_coroutine.run \ creation-cfa_coroutine_eager.run \ creation-cfa_thread.run \ creation-upp_coroutine.run \ creation-upp_thread.run \ creation-goroutine.run \ creation-java_thread.run creation-cfa_coroutine$(EXEEXT): @${CC} $(srcdir)/creation/cfa_cor.c -DBENCH_N=10000000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} creation-cfa_coroutine_eager$(EXEEXT): @${CC} $(srcdir)/creation/cfa_cor.c -DBENCH_N=10000000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -DEAGER creation-cfa_thread$(EXEEXT): @${CC} $(srcdir)/creation/cfa_thrd.c -DBENCH_N=10000000 -I$(srcdir) -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} creation-upp_coroutine$(EXEEXT): @u++ $(srcdir)/creation/upp_cor.cc -DBENCH_N=50000000 -I$(srcdir) -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} creation-upp_thread$(EXEEXT): @u++ $(srcdir)/creation/upp_thrd.cc -DBENCH_N=50000000 -I$(srcdir) -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} creation-pthread$(EXEEXT): @@BACKEND_CC@ $(srcdir)/creation/pthreads.c -DBENCH_N=250000 -I$(srcdir) -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} creation-goroutine$(EXEEXT): @go build -o a.out $(srcdir)/creation/goroutine.go creation-java_thread$(EXEEXT): @javac $(srcdir)/creation/JavaThread.java @echo "#!/bin/sh" > a.out @echo "cd creation && java JavaThread" >> a.out @chmod a+x a.out ## ========================================================================================================= compile$(EXEEXT) :\ compile-array.make \ compile-attributes.make \ compile-empty.make \ compile-expression.make \ compile-io.make \ compile-monitor.make \ compile-operators.make \ compile-typeof.make testdir = $(top_srcdir)/tests compile-array$(EXEEXT): @${CC} -quiet -fsyntax-only -w $(testdir)/array.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} compile-attributes$(EXEEXT): @${CC} -quiet -fsyntax-only -w $(testdir)/attributes.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} compile-empty$(EXEEXT): @${CC} -quiet -fsyntax-only -w $(srcdir)/compile/empty.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} compile-expression$(EXEEXT): @${CC} -quiet -fsyntax-only -w $(testdir)/expression.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} compile-io$(EXEEXT): @${CC} -quiet -fsyntax-only -w $(testdir)/io1.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} compile-monitor$(EXEEXT): @${CC} -quiet -fsyntax-only -w $(testdir)/concurrent/monitor.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} compile-operators$(EXEEXT): @${CC} -quiet -fsyntax-only -w $(testdir)/operators.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} compile-thread$(EXEEXT): @${CC} -quiet -fsyntax-only -w $(testdir)/concurrent/thread.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} compile-typeof$(EXEEXT): @${CC} -quiet -fsyntax-only -w $(testdir)/typeof.c @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}