######################## -*- 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 20 11:18:51 2018 ## Update Count : 68 ############################################################################### AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names include $(top_srcdir)/src/cfa.make debug=yes installed=no quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes concurrent= timeouts= TEST_PY = python ${builddir}/test.py # applies to both programs AM_CFLAGS = $(if $(test), 2> $(test), ) \ -g \ -Wall \ -Wno-unused-function \ -quiet @CFA_FLAGS@ \ -DIN_DIR="${srcdir}/.in/" AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS} CC = @CFACC@ PRETTY_PATH=cd ${srcdir} && .PHONY: list .validate .INTERMEDIATE: .validate .validate.cfa EXTRA_PROGRAMS = avl_test # build but do not install avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c #---------------------------------------------------------------------------------------------------------------- all-local : @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} ${quick_test} all-tests : @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program clean-local : rm -f ${EXTRA_PROGRAMS} list : @+${TEST_PY} --list ${concurrent} .validate: .validate.cfa $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror .validate.cfa: @echo "int main() { return 0; }" > ${@} dummy_hack.c: @echo "int main() { return 0; }" > ${@} concurrency : @+${TEST_PY} --debug=${debug} --install=${installed} -Iconcurrent #---------------------------------------------------------------------------------------------------------------- # implicit rule so not all test require a rule % : %.c $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) % : %.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) declarationSpecifier: declarationSpecifier.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) gccExtensions : gccExtensions.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) extension : extension.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) attributes : attributes.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) functions: functions.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) KRfunctions : KRfunctions.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) sched-ext-parse : sched-ext-parse.c $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) gmp : gmp.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) #builtins builtins/sync: builtins/sync.c $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only #------------------------------------------------------------------------------ #To make errors path independent we need to cd into the correct directories completeTypeError : completeTypeError.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) typedefRedef-ERR1: typedefRedef.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) alloc-ERROR: alloc.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) fallthrough-ERROR: fallthrough.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) nested-types-ERR1: nested-types.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) nested-types-ERR2: nested-types.cfa $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) # Constructor/destructor tests raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) raii/memberCtors-ERR1: raii/memberCtors.c $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) raii/ctor-autogen-ERR1: raii/ctor-autogen.c $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) # Warnings warnings/self-assignment: warnings/self-assignment.c $(CFACC) $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only