######################## -*- 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 : Tue Nov 6 09:01:23 2018 ## Update Count : 26 ############################################################################### AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names # applies to both programs include $(top_srcdir)/src/cfa.make UPPCC = u++ AM_CFLAGS = -O2 -Wall -I$(srcdir) -lrt -pthread AM_CFAFLAGS = -quiet -in-tree -nodebug AM_UPPFLAGS = -quiet -nodebug -multi 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 #prevent any tests in parallel .NOTPARALLEL: #make sure automake includes the compile rules for C and C++ EXTRA_PROGRAMS = dummy dummy_SOURCES = c.c cxx.cpp ## ========================================================================================================= 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 *.class %.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): $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/loop.c function$(EXEEXT): $(AM_V_CC)$(COMPILE) -DBENCH_N=5000000000 $(srcdir)/function.c fetch_add$(EXEEXT): $(AM_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c ## ========================================================================================================= CTXSWITCH_DEPEND = \ 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-goroutine.run \ ctxswitch-java_thread.run if WITH_LIBFIBRE CTXSWITCH_DEPEND += \ ctxswitch-kos_fibre.run \ ctxswitch-kos_fibre2.run ctxswitch-kos_fibre$(EXEEXT): $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre.cpp -I$(LIBFIBRE_DIR) -lfibre ctxswitch-kos_fibre2$(EXEEXT): $(AM_V_CXX)$(CXXCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/kos_fibre2.cpp -I$(LIBFIBRE_DIR) -lfibre endif ctxswitch$(EXEEXT): $(CTXSWITCH_DEPEND) ctxswitch-pthread$(EXEEXT): $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c ctxswitch-cfa_coroutine$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_cor.c ctxswitch-cfa_thread$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd.c ctxswitch-cfa_thread2$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_thrd2.c ctxswitch-upp_coroutine$(EXEEXT): $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_cor.cc ctxswitch-upp_thread$(EXEEXT): $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/upp_thrd.cc ctxswitch-goroutine$(EXEEXT): $(AM_V_GOC)go build -o a.out $(srcdir)/ctxswitch/goroutine.go ctxswitch-java_thread$(EXEEXT): $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/ctxswitch/JavaThread.java @echo "#!/bin/sh" > a.out @echo "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): $(AM_V_CC)$(COMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/pthreads.c mutex-upp$(EXEEXT): $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/mutex/upp.cc mutex-cfa1$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa1.c mutex-cfa2$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa2.c mutex-cfa4$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=5000000 $(srcdir)/mutex/cfa4.c mutex-java_thread$(EXEEXT): $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/mutex/JavaThread.java @echo "#!/bin/sh" > a.out @echo "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): $(AM_V_CC)$(COMPILE) -DBENCH_N=500000 $(srcdir)/schedint/pthreads.c signal-upp$(EXEEXT): $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedint/upp.cc signal-cfa1$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa1.c signal-cfa2$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa2.c signal-cfa4$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedint/cfa4.c signal-java_thread$(EXEEXT): $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/schedint/JavaThread.java @echo "#!/bin/sh" > a.out @echo "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): $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=5000000 $(srcdir)/schedext/upp.cc waitfor-cfa1$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa1.c waitfor-cfa2$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa2.c waitfor-cfa4$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=500000 $(srcdir)/schedext/cfa4.c ## ========================================================================================================= 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): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c creation-cfa_coroutine_eager$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_cor.c creation-cfa_thread$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -DBENCH_N=10000000 $(srcdir)/creation/cfa_thrd.c creation-upp_coroutine$(EXEEXT): $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_cor.cc creation-upp_thread$(EXEEXT): $(AM_V_UPP)$(UPPCOMPILE) -DBENCH_N=50000000 $(srcdir)/creation/upp_thrd.cc creation-pthread$(EXEEXT): $(AM_V_CC)$(COMPILE) -DBENCH_N=250000 $(srcdir)/creation/pthreads.c creation-goroutine$(EXEEXT): $(AM_V_GOC)go build -o a.out $(srcdir)/creation/goroutine.go creation-java_thread$(EXEEXT): $(AM_V_JAVAC)javac -d $(builddir) $(srcdir)/creation/JavaThread.java @echo "#!/bin/sh" > a.out @echo "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): $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/array.c compile-attributes$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/attributes.cfa compile-empty$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(srcdir)/compile/empty.c compile-expression$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/expression.c compile-io$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/io1.c compile-monitor$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/monitor.c compile-operators$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/operators.c compile-thread$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/concurrent/thread.c compile-typeof$(EXEEXT): $(AM_V_CFA)$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.c