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