[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 |
---|
[0b8c951d] | 13 | ## Last Modified On : Wed Aug 30 22:31:45 2023 |
---|
| 14 | ## Update Count : 197 |
---|
[ef7d253] | 15 | ############################################################################### |
---|
| 16 | |
---|
[0c1b566] | 17 | AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names |
---|
[107b01a] | 18 | ACLOCAL_AMFLAGS = -I automake |
---|
[f85bc15] | 19 | |
---|
[bcadb26] | 20 | include $(top_srcdir)/tools/build/cfa.make |
---|
[dc8511c] | 21 | |
---|
[e2887a9] | 22 | DEFAULT_INCLUDES = -I${abs_srcdir} |
---|
[74cfe054] | 23 | |
---|
[4daf79f] | 24 | debug ?= yes |
---|
| 25 | installed ?= no |
---|
[e3d4fd1] | 26 | ARCH = ${if ${arch},"--arch=${arch}"} |
---|
| 27 | arch_support = "x86/x64/arm" |
---|
[bdbf536] | 28 | TIMEOUT = ${if ${timeout},"--timeout=${timeout}"} |
---|
[5007618] | 29 | GLOBAL_TIMEOUT = ${if ${global-timeout},"--global-timeout=${global-timeout}"} |
---|
| 30 | ARCHIVE_ERRORS = ${if ${archive-errors},"--archive-errors=${archive-errors}"} |
---|
| 31 | |
---|
[e3d4fd1] | 32 | DEBUG_FLAGS = -debug -g -O0 |
---|
[e3a5a73] | 33 | |
---|
[e3d4fd1] | 34 | quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes meta/dumpable |
---|
[be65cca] | 35 | |
---|
[e2887a9] | 36 | TEST_PY = python3 ${builddir}/test.py |
---|
[f85bc15] | 37 | |
---|
[ef7d253] | 38 | # applies to both programs |
---|
[d65f92c] | 39 | # since automake doesn't have support for CFA we have to |
---|
[e2887a9] | 40 | AM_CFLAGS = ${if ${test}, 2> ${test}, } \ |
---|
| 41 | -fdebug-prefix-map=${abspath ${abs_srcdir}}= \ |
---|
[87fc1b4] | 42 | -fdebug-prefix-map=/tmp= \ |
---|
[0a19c51] | 43 | -fno-diagnostics-show-caret \ |
---|
[b8f6002] | 44 | -g \ |
---|
| 45 | -Wall \ |
---|
[850aff1] | 46 | -Werror=return-type \ |
---|
[b8f6002] | 47 | -Wno-unused-function \ |
---|
[36fbaeca] | 48 | -Wno-psabi \ |
---|
[b44959f] | 49 | -quiet @CFA_FLAGS@ |
---|
[7c03d6d] | 50 | |
---|
[7215000] | 51 | AM_CFAFLAGS = -XCFA --deterministic-out |
---|
| 52 | |
---|
[158b026] | 53 | # get the desired cfa to test |
---|
[e2887a9] | 54 | TARGET_CFA = ${if ${filter ${installed},yes}, @CFACC_INSTALL@, @CFACC@} |
---|
[158b026] | 55 | |
---|
[34e1494] | 56 | # adjust CC to current flags |
---|
[e2887a9] | 57 | CC = LC_ALL=C ${if ${DISTCC_CFA_PATH},distcc ${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}} |
---|
| 58 | CFACC = ${CC} |
---|
[ef7d253] | 59 | |
---|
[34e1494] | 60 | # get local binary for depedencies |
---|
| 61 | CFACCBIN = @CFACC@ |
---|
| 62 | |
---|
| 63 | # adjusted CC but without the actual distcc call |
---|
[e2887a9] | 64 | CFACCLOCAL = ${if ${DISTCC_CFA_PATH},${DISTCC_CFA_PATH} ${ARCH_FLAGS} ,${TARGET_CFA} ${DEBUG_FLAGS} ${ARCH_FLAGS}} |
---|
| 65 | CFACCLINK = ${CFACCLOCAL} -quiet ${if ${test}, 2> ${test}, } ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} |
---|
[34e1494] | 66 | |
---|
[e3d4fd1] | 67 | PRETTY_PATH = mkdir -p ${dir ${abspath ${@}}} && cd ${srcdir} && |
---|
[f7d3215] | 68 | |
---|
[bdbf536] | 69 | .PHONY : concurrency list .validate .test_makeflags |
---|
[e2887a9] | 70 | .INTERMEDIATE : .validate .validate.cfa .test_makeflags |
---|
[fd4df379] | 71 | EXTRA_PROGRAMS = array-collections/boxed avl_test linkonce linking/mangling/anon .dummy_hack # build but do not install |
---|
[a468e1e9] | 72 | EXTRA_DIST = test.py \ |
---|
| 73 | pybin/__init__.py \ |
---|
| 74 | pybin/print-core.gdb \ |
---|
| 75 | pybin/settings.py \ |
---|
| 76 | pybin/test_run.py \ |
---|
| 77 | pybin/tools.py \ |
---|
| 78 | long_tests.hfa \ |
---|
[fd4df379] | 79 | array-collections/boxed.hfa \ |
---|
| 80 | array-collections/boxed.cases.hfa \ |
---|
[d0fa494] | 81 | avltree/avl-private.h \ |
---|
| 82 | avltree/avl.h \ |
---|
[d0a00a5a] | 83 | configs/.in/parseconfig-all.txt \ |
---|
| 84 | configs/.in/parseconfig-errors.txt \ |
---|
| 85 | configs/.in/parseconfig-missing.txt \ |
---|
[d0fa494] | 86 | exceptions/except-io.hfa \ |
---|
| 87 | exceptions/with-threads.hfa \ |
---|
[b44959f] | 88 | io/.in/io.data \ |
---|
[3bd5ca7] | 89 | io/.in/many_read.data \ |
---|
[d0fa494] | 90 | meta/fork+exec.hfa \ |
---|
[c26bea2a] | 91 | concurrency/clib_tls.c \ |
---|
| 92 | concurrency/clib.c \ |
---|
| 93 | concurrency/unified_locking/mutex_test.hfa \ |
---|
[9c4330d5] | 94 | concurrency/channels/parallel_harness.hfa \ |
---|
[0b8c951d] | 95 | array-collections/dimexpr-match.hfa \ |
---|
[ee16f8fc] | 96 | array-collections/dimexpr-match-detail.sh \ |
---|
| 97 | array-collections/array-raii.hfa |
---|
[a468e1e9] | 98 | |
---|
| 99 | dist-hook: |
---|
| 100 | echo "Gathering test files" |
---|
[e2887a9] | 101 | for file in `${TEST_PY} --list-dist`; do \ |
---|
| 102 | if test -f ${srcdir}/$${file}; then \ |
---|
| 103 | ${MKDIR_P} $$(dirname ${distdir}/$${file}); \ |
---|
| 104 | cp -df ${srcdir}/$${file} ${distdir}/$${file}; \ |
---|
[a468e1e9] | 105 | fi; \ |
---|
| 106 | done |
---|
[44f44617] | 107 | |
---|
[fd4df379] | 108 | array_collections_boxed_SOURCES = array-collections/boxed.main.cfa array-collections/boxed.bookend.cfa |
---|
[107b01a] | 109 | 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 |
---|
[aff7e86] | 110 | linkonce_SOURCES = link-once/main.cfa link-once/partner.cfa |
---|
[258aaab8] | 111 | linking_mangling_anon_SOURCES = linking/mangling/header.hfa linking/mangling/lib.cfa linking/mangling/main.cfa |
---|
[2b10f95] | 112 | # automake doesn't know we still need C/CPP rules so pretend like we have a C program |
---|
[b7fe2e6] | 113 | nodist__dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp |
---|
[a0dcd2e] | 114 | |
---|
[73abe95] | 115 | #---------------------------------------------------------------------------------------------------------------- |
---|
[4daf79f] | 116 | |
---|
[5007618] | 117 | # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program |
---|
[c083c3d] | 118 | all-local : # This name is important to automake and implies the default build target. |
---|
[d144c26] | 119 | @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} --all |
---|
[4daf79f] | 120 | |
---|
[5007618] | 121 | tests : all-local # synonym |
---|
[4daf79f] | 122 | |
---|
[5007618] | 123 | install : all-local # synonym, PAB only |
---|
[df42128] | 124 | |
---|
[4daf79f] | 125 | quick : |
---|
[5007618] | 126 | @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${ARCH} ${quick_test} |
---|
[e2887a9] | 127 | |
---|
| 128 | concurrency : |
---|
[5007618] | 129 | @+${TEST_PY} --debug=${debug} --install=${installed} ${ARCHIVE_ERRORS} ${TIMEOUT} ${GLOBAL_TIMEOUT} ${ARCH} -Iconcurrency |
---|
[e2887a9] | 130 | |
---|
| 131 | list : |
---|
[bdbf536] | 132 | @+${TEST_PY} --list |
---|
[e2887a9] | 133 | |
---|
| 134 | help : |
---|
| 135 | @echo "user targets:" |
---|
| 136 | @echo " Run the complete test suite." |
---|
[5007618] | 137 | @echo " $$ make (null) / tests [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]" |
---|
[e2887a9] | 138 | @echo "" |
---|
| 139 | @echo " Run the short (quick) test suite." |
---|
[5007618] | 140 | @echo " $$ make quick [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [arch=${arch_support}]" |
---|
[e2887a9] | 141 | @echo "" |
---|
[bdbf536] | 142 | @echo " Run the concurrency test suite." |
---|
[5007618] | 143 | @echo " $$ make concurrency [debug=yes/no] [installed=yes/no] [archive-errors=dump-dir] [timeout=seconds] [global-timeout=seconds] [arch=${arch_support}]" |
---|
[e2887a9] | 144 | @echo "" |
---|
| 145 | @echo " List all tests in the test suite." |
---|
| 146 | @echo " $$ make list" |
---|
[927e9ce] | 147 | |
---|
[2a59655] | 148 | mostlyclean-local : |
---|
[e2887a9] | 149 | find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete |
---|
| 150 | find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete |
---|
| 151 | find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete |
---|
| 152 | rm -f ${EXTRA_PROGRAMS} |
---|
[2a59655] | 153 | rm -rf __pycache__ |
---|
| 154 | |
---|
| 155 | distclean-local : |
---|
[e2887a9] | 156 | find ${builddir} -path '*.Po' -delete |
---|
[927e9ce] | 157 | |
---|
[fc01219] | 158 | .test_makeflags: |
---|
[e2887a9] | 159 | @echo "${MAKEFLAGS}" |
---|
[fc01219] | 160 | |
---|
[1e995d6] | 161 | .validate: .validate.cfa |
---|
[e2887a9] | 162 | ${CFACOMPILE} .validate.cfa -fsyntax-only -Wall -Wextra -Werror |
---|
[1e995d6] | 163 | |
---|
| 164 | .validate.cfa: |
---|
[e2887a9] | 165 | @echo "int main() { return 0; }" > ${@} |
---|
[28582b2] | 166 | |
---|
[107b01a] | 167 | # automake doesn't know we still need C rules so pretend like we have a C program |
---|
| 168 | .dummy_hack.c: |
---|
[e2887a9] | 169 | @echo "int main() { return 0; }" > ${@} |
---|
[28582b2] | 170 | |
---|
[2b10f95] | 171 | .dummy_hackxx.cpp: |
---|
[e2887a9] | 172 | @echo "int bar() { return 0; }" > ${@} |
---|
[026a0f5] | 173 | |
---|
[73abe95] | 174 | #---------------------------------------------------------------------------------------------------------------- |
---|
[dc8511c] | 175 | |
---|
[e16797c] | 176 | # Use for all tests, make sure the path are correct and all flags are added |
---|
[e2887a9] | 177 | CFACOMPILETEST=${PRETTY_PATH} ${CFACOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} ${${shell echo "${@}_FLAGSCFA" | sed 's/-\|\//_/g'}} |
---|
[d9b499c] | 178 | |
---|
[e16797c] | 179 | #---------------------------------------------------------------------------------------------------------------- |
---|
[a843067] | 180 | |
---|
[e16797c] | 181 | # implicit rule so not all test require a rule |
---|
[15f9c8e] | 182 | # split into two steps to support compiling remotely using distcc |
---|
[34e1494] | 183 | # don't use distcc to do the linking because distcc doesn't do linking |
---|
[e2887a9] | 184 | % : %.cfa ${CFACCBIN} |
---|
| 185 | ${CFACOMPILETEST} -c -o ${abspath ${@}}.o -DIN_DIR="${abspath ${dir ${<}}}/.in/" |
---|
| 186 | ${CFACCLINK} ${@}.o -o ${abspath ${@}} |
---|
| 187 | rm ${abspath ${@}}.o |
---|
[f7d3215] | 188 | |
---|
[34e1494] | 189 | # implicit rule for c++ test |
---|
| 190 | # convient for testing the testsuite itself but not actuall used |
---|
[e16797c] | 191 | % : %.cpp |
---|
[e2887a9] | 192 | ${PRETTY_PATH} ${CXXCOMPILE} ${shell realpath --relative-to=${srcdir} ${<}} -o ${abspath ${@}} |
---|
[4c8f86b3] | 193 | |
---|
[f7d3215] | 194 | #------------------------------------------------------------------------------ |
---|
[34e1494] | 195 | # TARGETS WITH CUSTOM FLAGS |
---|
[e16797c] | 196 | #------------------------------------------------------------------------------ |
---|
[34e1494] | 197 | # custom libs |
---|
| 198 | gmp_FLAGSLD= -lgmp |
---|
[dc8511c] | 199 | |
---|
[e16797c] | 200 | #------------------------------------------------------------------------------ |
---|
[34e1494] | 201 | # Generated code |
---|
| 202 | GENERATED_CODE = declarationSpecifier gccExtensions extension attributes functions KRfunctions |
---|
[e2887a9] | 203 | ${GENERATED_CODE} : % : %.cfa ${CFACCBIN} |
---|
| 204 | ${CFACOMPILETEST} -CFA -XCFA -p -c -fsyntax-only -o ${abspath ${@}} |
---|
[34e1494] | 205 | |
---|
[e16797c] | 206 | #------------------------------------------------------------------------------ |
---|
| 207 | # CUSTOM TARGET |
---|
| 208 | #------------------------------------------------------------------------------ |
---|
[66812dd] | 209 | # tests that just validate syntax and compiler output should be compared to stderr |
---|
[e2887a9] | 210 | CFACOMPILE_SYNTAX = ${CFACOMPILETEST} -Wno-unused-variable -Wno-unused-label -c -fsyntax-only -o ${abspath ${@}} |
---|
[40c81e5] | 211 | |
---|
[35d1de5] | 212 | SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \ |
---|
[b6923b17] | 213 | init1 limits nested-types cast ctrl-flow/labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment concurrency/waitfor/parse |
---|
[e2887a9] | 214 | ${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN} |
---|
| 215 | ${CFACOMPILE_SYNTAX} |
---|
| 216 | ${if ${test}, cp ${test} ${abspath ${@}}, } |
---|
[87fc1b4] | 217 | |
---|
[34e1494] | 218 | # expected failures |
---|
[e6cfb4e2] | 219 | # use custom target since they require a custom define *and* have a name that doesn't match the file |
---|
[a5aa5bf] | 220 | |
---|
| 221 | array-ERR1 : array.cfa ${CFACCBIN} |
---|
| 222 | ${CFACOMPILE_SYNTAX} -DERR1 |
---|
| 223 | -cp ${test} ${abspath ${@}} |
---|
| 224 | |
---|
| 225 | array-ERR2 : array.cfa ${CFACCBIN} |
---|
| 226 | ${CFACOMPILE_SYNTAX} -DERR2 |
---|
| 227 | -cp ${test} ${abspath ${@}} |
---|
| 228 | |
---|
| 229 | array-ERR3 : array.cfa ${CFACCBIN} |
---|
| 230 | ${CFACOMPILE_SYNTAX} -DERR3 |
---|
| 231 | -cp ${test} ${abspath ${@}} |
---|
| 232 | |
---|
[0b8c951d] | 233 | array-collections/dimexpr-match-c-ERRS : array-collections/dimexpr-match-c.cfa |
---|
[0f4ac10] | 234 | ${CFACOMPILE_SYNTAX} -DERRS |
---|
| 235 | -cp ${test} ${abspath ${@}} |
---|
| 236 | |
---|
[0b8c951d] | 237 | array-collections/dimexpr-match-cfa-ERRS : array-collections/dimexpr-match-cfa.cfa |
---|
[0f4ac10] | 238 | ${CFACOMPILE_SYNTAX} -DERRS |
---|
| 239 | -cp ${test} ${abspath ${@}} |
---|
| 240 | |
---|
[e2887a9] | 241 | alloc-ERROR : alloc.cfa ${CFACCBIN} |
---|
| 242 | ${CFACOMPILE_SYNTAX} -DERR1 |
---|
| 243 | -cp ${test} ${abspath ${@}} |
---|
[b93a3de] | 244 | |
---|
[e2887a9] | 245 | init1-ERROR : init1.cfa ${CFACCBIN} |
---|
| 246 | ${CFACOMPILE_SYNTAX} -DERR1 |
---|
| 247 | -cp ${test} ${abspath ${@}} |
---|
[ee858bf] | 248 | |
---|
[e2887a9] | 249 | typedefRedef-ERR1 : typedefRedef.cfa ${CFACCBIN} |
---|
| 250 | ${CFACOMPILE_SYNTAX} -DERR1 |
---|
| 251 | -cp ${test} ${abspath ${@}} |
---|
[e2c70ab] | 252 | |
---|
[e2887a9] | 253 | nested-types-ERR1 : nested-types.cfa ${CFACCBIN} |
---|
| 254 | ${CFACOMPILE_SYNTAX} -DERR1 |
---|
| 255 | -cp ${test} ${abspath ${@}} |
---|
[49e1275] | 256 | |
---|
[e2887a9] | 257 | nested-types-ERR2 : nested-types.cfa ${CFACCBIN} |
---|
| 258 | ${CFACOMPILE_SYNTAX} -DERR2 |
---|
| 259 | -cp ${test} ${abspath ${@}} |
---|
[49e1275] | 260 | |
---|
[e2887a9] | 261 | raii/memberCtors-ERR1 : raii/memberCtors.cfa ${CFACCBIN} |
---|
| 262 | ${CFACOMPILE_SYNTAX} -DERR1 |
---|
| 263 | -cp ${test} ${abspath ${@}} |
---|
[cdbfab0] | 264 | |
---|
[e2887a9] | 265 | raii/ctor-autogen-ERR1 : raii/ctor-autogen.cfa ${CFACCBIN} |
---|
| 266 | ${CFACOMPILE_SYNTAX} -DERR1 |
---|
| 267 | -cp ${test} ${abspath ${@}} |
---|
[80e8582] | 268 | |
---|
[e2887a9] | 269 | raii/dtor-early-exit-ERR1 : raii/dtor-early-exit.cfa ${CFACCBIN} |
---|
| 270 | ${CFACOMPILE_SYNTAX} -DERR1 |
---|
| 271 | -cp ${test} ${abspath ${@}} |
---|
[80e8582] | 272 | |
---|
[e2887a9] | 273 | raii/dtor-early-exit-ERR2 : raii/dtor-early-exit.cfa ${CFACCBIN} |
---|
| 274 | ${CFACOMPILE_SYNTAX} -DERR2 |
---|
| 275 | -cp ${test} ${abspath ${@}} |
---|
[e16797c] | 276 | |
---|
[5715d43] | 277 | # Exception Tests |
---|
| 278 | # Test with libcfathread; it changes how storage works. |
---|
| 279 | |
---|
[e2887a9] | 280 | exceptions/%-threads : exceptions/%.cfa ${CFACCBIN} |
---|
| 281 | ${CFACOMPILETEST} -include exceptions/with-threads.hfa -c -o ${abspath ${@}}.o |
---|
| 282 | ${CFACCLOCAL} ${${shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g'}} ${abspath ${@}}.o -o ${abspath ${@}} |
---|
[5715d43] | 283 | |
---|
[673eb7a] | 284 | # Linking tests |
---|
| 285 | # Meta tests to make sure we see linking errors (can't compile with -O2 since it may multiply number of calls) |
---|
[e2887a9] | 286 | linking/linkerror : linking/linkerror.cfa ${CFACCBIN} |
---|
| 287 | ${CFACOMPILETEST} -O0 -c -o ${abspath ${@}}.o |
---|
| 288 | ${CFACCLINK} -O0 ${@}.o -o ${abspath ${@}} |
---|
| 289 | rm ${abspath ${@}}.o |
---|
[673eb7a] | 290 | |
---|
[34e1494] | 291 | #------------------------------------------------------------------------------ |
---|
| 292 | # Other targets |
---|