| 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 : Fri Nov 16 15:29:54 2018
|
|---|
| 14 | ## Update Count : 65
|
|---|
| 15 | ###############################################################################
|
|---|
| 16 |
|
|---|
| 17 | AUTOMAKE_OPTIONS = foreign # do not require all the GNU file names
|
|---|
| 18 |
|
|---|
| 19 | include $(top_srcdir)/src/cfa.make
|
|---|
| 20 |
|
|---|
| 21 | debug=yes
|
|---|
| 22 | installed=no
|
|---|
| 23 |
|
|---|
| 24 | quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
|
|---|
| 25 |
|
|---|
| 26 | concurrent=
|
|---|
| 27 | timeouts=
|
|---|
| 28 |
|
|---|
| 29 | TEST_PY = python ${builddir}/test.py
|
|---|
| 30 |
|
|---|
| 31 | # applies to both programs
|
|---|
| 32 | AM_CFLAGS = $(if $(test), 2> $(test), ) \
|
|---|
| 33 | -g \
|
|---|
| 34 | -Wall \
|
|---|
| 35 | -Wno-unused-function \
|
|---|
| 36 | -quiet @CFA_FLAGS@ \
|
|---|
| 37 | -DIN_DIR="${srcdir}/.in/"
|
|---|
| 38 |
|
|---|
| 39 | AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
|
|---|
| 40 | CC = @CFACC@
|
|---|
| 41 |
|
|---|
| 42 | PRETTY_PATH=cd ${srcdir} &&
|
|---|
| 43 |
|
|---|
| 44 | .PHONY: list .validate
|
|---|
| 45 | .INTERMEDIATE: .validate .validate.cfa
|
|---|
| 46 | EXTRA_PROGRAMS = fstream_test avl_test # build but do not install
|
|---|
| 47 |
|
|---|
| 48 | fstream_test_SOURCES = fstream_test.cfa
|
|---|
| 49 |
|
|---|
| 50 | avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c
|
|---|
| 51 |
|
|---|
| 52 | #----------------------------------------------------------------------------------------------------------------
|
|---|
| 53 | all-local :
|
|---|
| 54 | @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} ${quick_test}
|
|---|
| 55 |
|
|---|
| 56 | all-tests :
|
|---|
| 57 | @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
|
|---|
| 58 |
|
|---|
| 59 | clean-local :
|
|---|
| 60 | rm -f ${EXTRA_PROGRAMS}
|
|---|
| 61 |
|
|---|
| 62 | list :
|
|---|
| 63 | @+${TEST_PY} --list ${concurrent}
|
|---|
| 64 |
|
|---|
| 65 | .validate: .validate.cfa
|
|---|
| 66 | $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
|
|---|
| 67 |
|
|---|
| 68 | .validate.cfa:
|
|---|
| 69 | @echo "int main() { return 0; }" > ${@}
|
|---|
| 70 |
|
|---|
| 71 | dummy_hack.c:
|
|---|
| 72 | @echo "int main() { return 0; }" > ${@}
|
|---|
| 73 |
|
|---|
| 74 | concurrency :
|
|---|
| 75 | @+${TEST_PY} --debug=${debug} --install=${installed} -Iconcurrent
|
|---|
| 76 |
|
|---|
| 77 | #----------------------------------------------------------------------------------------------------------------
|
|---|
| 78 |
|
|---|
| 79 | # implicit rule so not all test require a rule
|
|---|
| 80 | % : %.c $(CFACC)
|
|---|
| 81 | $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 82 |
|
|---|
| 83 | % : %.cfa $(CFACC)
|
|---|
| 84 | $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 85 |
|
|---|
| 86 | declarationSpecifier: declarationSpecifier.cfa $(CFACC)
|
|---|
| 87 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 88 |
|
|---|
| 89 | gccExtensions : gccExtensions.cfa $(CFACC)
|
|---|
| 90 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 91 |
|
|---|
| 92 | extension : extension.cfa $(CFACC)
|
|---|
| 93 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 94 |
|
|---|
| 95 | attributes : attributes.cfa $(CFACC)
|
|---|
| 96 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 97 |
|
|---|
| 98 | functions: functions.cfa $(CFACC)
|
|---|
| 99 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 100 |
|
|---|
| 101 | KRfunctions : KRfunctions.cfa $(CFACC)
|
|---|
| 102 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 103 |
|
|---|
| 104 | sched-ext-parse : sched-ext-parse.c $(CFACC)
|
|---|
| 105 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 106 |
|
|---|
| 107 | gmp : gmp.cfa $(CFACC)
|
|---|
| 108 | $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 109 |
|
|---|
| 110 | #builtins
|
|---|
| 111 | builtins/sync: builtins/sync.c $(CFACC)
|
|---|
| 112 | $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
|
|---|
| 113 |
|
|---|
| 114 | #------------------------------------------------------------------------------
|
|---|
| 115 |
|
|---|
| 116 | #To make errors path independent we need to cd into the correct directories
|
|---|
| 117 | completeTypeError : completeTypeError.cfa $(CFACC)
|
|---|
| 118 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 119 |
|
|---|
| 120 | typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
|
|---|
| 121 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 122 |
|
|---|
| 123 | alloc-ERROR: alloc.cfa $(CFACC)
|
|---|
| 124 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 125 |
|
|---|
| 126 | fallthrough-ERROR: fallthrough.cfa $(CFACC)
|
|---|
| 127 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 128 |
|
|---|
| 129 | nested-types-ERR1: nested-types.cfa $(CFACC)
|
|---|
| 130 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 131 |
|
|---|
| 132 | nested-types-ERR2: nested-types.cfa $(CFACC)
|
|---|
| 133 | $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 134 |
|
|---|
| 135 | # Constructor/destructor tests
|
|---|
| 136 | raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c $(CFACC)
|
|---|
| 137 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 138 |
|
|---|
| 139 | raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c $(CFACC)
|
|---|
| 140 | $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 141 |
|
|---|
| 142 | raii/memberCtors-ERR1: raii/memberCtors.c $(CFACC)
|
|---|
| 143 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 144 |
|
|---|
| 145 | raii/ctor-autogen-ERR1: raii/ctor-autogen.c $(CFACC)
|
|---|
| 146 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
|---|
| 147 |
|
|---|
| 148 | # Warnings
|
|---|
| 149 | warnings/self-assignment: warnings/self-assignment.c $(CFACC)
|
|---|
| 150 | $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
|
|---|