| [ef7d253] | 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
|
|---|
| [3d99498] | 13 | ## Last Modified On : Tue Nov 20 11:18:51 2018
|
|---|
| 14 | ## Update Count : 68
|
|---|
| [ef7d253] | 15 | ###############################################################################
|
|---|
| 16 |
|
|---|
| [0c1b566] | 17 | AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names
|
|---|
| [107b01a] | 18 | ACLOCAL_AMFLAGS = -I automake
|
|---|
| [f85bc15] | 19 |
|
|---|
| [dc8511c] | 20 | include $(top_srcdir)/src/cfa.make
|
|---|
| 21 |
|
|---|
| [cc640aad] | 22 | debug=yes
|
|---|
| [ff593a3] | 23 | installed=no
|
|---|
| [cc640aad] | 24 |
|
|---|
| [5cacf74] | 25 | quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
|
|---|
| [be65cca] | 26 |
|
|---|
| [0ad0c55] | 27 | concurrent=
|
|---|
| [b90aace] | 28 | timeouts=
|
|---|
| [be65cca] | 29 |
|
|---|
| [5b993e0] | 30 | TEST_PY = python3 ${builddir}/test.py
|
|---|
| [f85bc15] | 31 |
|
|---|
| [ef7d253] | 32 | # applies to both programs
|
|---|
| [b8f6002] | 33 | AM_CFLAGS = $(if $(test), 2> $(test), ) \
|
|---|
| 34 | -g \
|
|---|
| 35 | -Wall \
|
|---|
| 36 | -Wno-unused-function \
|
|---|
| 37 | -quiet @CFA_FLAGS@ \
|
|---|
| [f806b61] | 38 | -DIN_DIR="${abs_srcdir}/.in/"
|
|---|
| [7c03d6d] | 39 |
|
|---|
| [575a6e5] | 40 | AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
|
|---|
| [50697b0] | 41 | CC = @CFACC@
|
|---|
| [ef7d253] | 42 |
|
|---|
| [e16797c] | 43 | PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
|
|---|
| [f7d3215] | 44 |
|
|---|
| [28582b2] | 45 | .PHONY: list .validate
|
|---|
| [1e995d6] | 46 | .INTERMEDIATE: .validate .validate.cfa
|
|---|
| [107b01a] | 47 | EXTRA_PROGRAMS = avl_test .dummy_hack # build but do not install
|
|---|
| [44f44617] | 48 |
|
|---|
| [107b01a] | 49 | avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
|
|---|
| [2b10f95] | 50 | # automake doesn't know we still need C/CPP rules so pretend like we have a C program
|
|---|
| 51 | _dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
|
|---|
| [a0dcd2e] | 52 |
|
|---|
| [73abe95] | 53 | #----------------------------------------------------------------------------------------------------------------
|
|---|
| [927e9ce] | 54 | all-local :
|
|---|
| [b90aace] | 55 | @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} ${quick_test}
|
|---|
| [df42128] | 56 |
|
|---|
| 57 | all-tests :
|
|---|
| [b90aace] | 58 | @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
|
|---|
| [927e9ce] | 59 |
|
|---|
| 60 | clean-local :
|
|---|
| [a6dd5b0] | 61 | rm -f ${EXTRA_PROGRAMS}
|
|---|
| [927e9ce] | 62 |
|
|---|
| 63 | list :
|
|---|
| [f85bc15] | 64 | @+${TEST_PY} --list ${concurrent}
|
|---|
| [927e9ce] | 65 |
|
|---|
| [1e995d6] | 66 | .validate: .validate.cfa
|
|---|
| 67 | $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
|
|---|
| 68 |
|
|---|
| 69 | .validate.cfa:
|
|---|
| 70 | @echo "int main() { return 0; }" > ${@}
|
|---|
| [28582b2] | 71 |
|
|---|
| [107b01a] | 72 | # automake doesn't know we still need C rules so pretend like we have a C program
|
|---|
| 73 | .dummy_hack.c:
|
|---|
| [28582b2] | 74 | @echo "int main() { return 0; }" > ${@}
|
|---|
| 75 |
|
|---|
| [2b10f95] | 76 | .dummy_hackxx.cpp:
|
|---|
| 77 | @echo "int bar() { return 0; }" > ${@}
|
|---|
| 78 |
|
|---|
| [026a0f5] | 79 | concurrency :
|
|---|
| [a5121bf] | 80 | @+${TEST_PY} --debug=${debug} --install=${installed} -Iconcurrent
|
|---|
| [026a0f5] | 81 |
|
|---|
| [73abe95] | 82 | #----------------------------------------------------------------------------------------------------------------
|
|---|
| [dc8511c] | 83 |
|
|---|
| [e16797c] | 84 | # Use for all tests, make sure the path are correct and all flags are added
|
|---|
| 85 | CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGS" | sed 's/-\|\//_/g'))
|
|---|
| [950f7a7] | 86 |
|
|---|
| [e16797c] | 87 | # Use for tests that either generate an executable, print directyl to stdout or the make command is expected to fail
|
|---|
| 88 | CFATEST_STDOUT=$(CFACOMPILETEST) -o $(abspath ${@})
|
|---|
| [d9b499c] | 89 |
|
|---|
| [e16797c] | 90 | # Use for tests where the make command is expecte to succeed but the expected.txt should be compared to stderr
|
|---|
| 91 | CFATEST_STDERR=$(CFACOMPILETEST) 2> $(abspath ${@})
|
|---|
| [d9b499c] | 92 |
|
|---|
| [e16797c] | 93 | #----------------------------------------------------------------------------------------------------------------
|
|---|
| [a843067] | 94 |
|
|---|
| [e16797c] | 95 | # implicit rule so not all test require a rule
|
|---|
| 96 | % : %.cfa $(CFACC)
|
|---|
| 97 | $(CFATEST_STDOUT)
|
|---|
| [f7d3215] | 98 |
|
|---|
| [e16797c] | 99 | % : %.cpp
|
|---|
| 100 | $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| [4c8f86b3] | 101 |
|
|---|
| [f7d3215] | 102 | #------------------------------------------------------------------------------
|
|---|
| [e16797c] | 103 | # TARGET WITH STANDARD RULE BUT CUSTOM FLAGS
|
|---|
| 104 | #------------------------------------------------------------------------------
|
|---|
| 105 | # Expected failures
|
|---|
| 106 | declarationSpecifier_FLAGS= -CFA -XCFA -p
|
|---|
| 107 | gccExtensions_FLAGS= -CFA -XCFA -p
|
|---|
| 108 | extension_FLAGS= -CFA -XCFA -p
|
|---|
| 109 | attributes_FLAGS= -CFA -XCFA -p
|
|---|
| 110 | functions_FLAGS= -CFA -XCFA -p
|
|---|
| 111 | KRfunctions_FLAGS= -CFA -XCFA -p
|
|---|
| 112 | gmp_FLAGS= -lgmp
|
|---|
| [dc8511c] | 113 |
|
|---|
| [e16797c] | 114 | #------------------------------------------------------------------------------
|
|---|
| 115 | # Expected failures
|
|---|
| 116 | completeTypeError_FLAGS= -DERR1
|
|---|
| [486341f] | 117 |
|
|---|
| [e16797c] | 118 | #------------------------------------------------------------------------------
|
|---|
| 119 | # CUSTOM TARGET
|
|---|
| 120 | #------------------------------------------------------------------------------
|
|---|
| [1e995d6] | 121 | typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
|
|---|
| [e16797c] | 122 | $(CFATEST_STDOUT) -DERR1
|
|---|
| [b93a3de] | 123 |
|
|---|
| [1e995d6] | 124 | alloc-ERROR: alloc.cfa $(CFACC)
|
|---|
| [e16797c] | 125 | $(CFATEST_STDOUT) -DERR1
|
|---|
| [e2c70ab] | 126 |
|
|---|
| [1e995d6] | 127 | nested-types-ERR1: nested-types.cfa $(CFACC)
|
|---|
| [e16797c] | 128 | $(CFATEST_STDOUT) -DERR1
|
|---|
| [49e1275] | 129 |
|
|---|
| [1e995d6] | 130 | nested-types-ERR2: nested-types.cfa $(CFACC)
|
|---|
| [e16797c] | 131 | $(CFATEST_STDOUT) -DERR2
|
|---|
| [49e1275] | 132 |
|
|---|
| [107b01a] | 133 | raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
|
|---|
| [e16797c] | 134 | $(CFATEST_STDOUT) -DERR1
|
|---|
| [cdbfab0] | 135 |
|
|---|
| [107b01a] | 136 | raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
|
|---|
| [e16797c] | 137 | $(CFATEST_STDOUT) -DERR2
|
|---|
| [80e8582] | 138 |
|
|---|
| [107b01a] | 139 | raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
|
|---|
| [e16797c] | 140 | $(CFATEST_STDOUT) -DERR1
|
|---|
| [80e8582] | 141 |
|
|---|
| [107b01a] | 142 | raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
|
|---|
| [e16797c] | 143 | $(CFATEST_STDOUT) -DERR1
|
|---|
| 144 |
|
|---|
| 145 | #builtins
|
|---|
| 146 | builtins/sync: builtins/sync.cfa $(CFACC)
|
|---|
| 147 | $(CFATEST_STDERR) -fsyntax-only
|
|---|
| [80e8582] | 148 |
|
|---|
| [1feb535f] | 149 | # Warnings
|
|---|
| [107b01a] | 150 | warnings/self-assignment: warnings/self-assignment.cfa $(CFACC)
|
|---|
| [e16797c] | 151 | $(CFATEST_STDERR) -fsyntax-only
|
|---|