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