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