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 |
|
---|
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 = avl_test # build but do not install
|
---|
47 |
|
---|
48 | 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
|
---|
49 |
|
---|
50 | #----------------------------------------------------------------------------------------------------------------
|
---|
51 | all-local :
|
---|
52 | @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} ${quick_test}
|
---|
53 |
|
---|
54 | all-tests :
|
---|
55 | @+${TEST_PY} --debug=${debug} --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
|
---|
56 |
|
---|
57 | clean-local :
|
---|
58 | rm -f ${EXTRA_PROGRAMS}
|
---|
59 |
|
---|
60 | list :
|
---|
61 | @+${TEST_PY} --list ${concurrent}
|
---|
62 |
|
---|
63 | .validate: .validate.cfa
|
---|
64 | $(CFACOMPILE) .validate.cfa -fsyntax-only -Wall -Wextra -Werror
|
---|
65 |
|
---|
66 | .validate.cfa:
|
---|
67 | @echo "int main() { return 0; }" > ${@}
|
---|
68 |
|
---|
69 | dummy_hack.c:
|
---|
70 | @echo "int main() { return 0; }" > ${@}
|
---|
71 |
|
---|
72 | concurrency :
|
---|
73 | @+${TEST_PY} --debug=${debug} --install=${installed} -Iconcurrent
|
---|
74 |
|
---|
75 | #----------------------------------------------------------------------------------------------------------------
|
---|
76 |
|
---|
77 | # implicit rule so not all test require a rule
|
---|
78 | % : %.c $(CFACC)
|
---|
79 | $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
80 |
|
---|
81 | % : %.cfa $(CFACC)
|
---|
82 | $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
83 |
|
---|
84 | declarationSpecifier: declarationSpecifier.cfa $(CFACC)
|
---|
85 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
86 |
|
---|
87 | gccExtensions : gccExtensions.cfa $(CFACC)
|
---|
88 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
89 |
|
---|
90 | extension : extension.cfa $(CFACC)
|
---|
91 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
92 |
|
---|
93 | attributes : attributes.cfa $(CFACC)
|
---|
94 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
95 |
|
---|
96 | functions: functions.cfa $(CFACC)
|
---|
97 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
98 |
|
---|
99 | KRfunctions : KRfunctions.cfa $(CFACC)
|
---|
100 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
101 |
|
---|
102 | sched-ext-parse : sched-ext-parse.c $(CFACC)
|
---|
103 | $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
104 |
|
---|
105 | gmp : gmp.cfa $(CFACC)
|
---|
106 | $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
107 |
|
---|
108 | #builtins
|
---|
109 | builtins/sync: builtins/sync.c $(CFACC)
|
---|
110 | $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
|
---|
111 |
|
---|
112 | #------------------------------------------------------------------------------
|
---|
113 |
|
---|
114 | #To make errors path independent we need to cd into the correct directories
|
---|
115 | completeTypeError : completeTypeError.cfa $(CFACC)
|
---|
116 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
117 |
|
---|
118 | typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
|
---|
119 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
120 |
|
---|
121 | alloc-ERROR: alloc.cfa $(CFACC)
|
---|
122 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
123 |
|
---|
124 | fallthrough-ERROR: fallthrough.cfa $(CFACC)
|
---|
125 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
126 |
|
---|
127 | nested-types-ERR1: nested-types.cfa $(CFACC)
|
---|
128 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
129 |
|
---|
130 | nested-types-ERR2: nested-types.cfa $(CFACC)
|
---|
131 | $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
132 |
|
---|
133 | # Constructor/destructor tests
|
---|
134 | raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c $(CFACC)
|
---|
135 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
136 |
|
---|
137 | raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c $(CFACC)
|
---|
138 | $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
139 |
|
---|
140 | raii/memberCtors-ERR1: raii/memberCtors.c $(CFACC)
|
---|
141 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
142 |
|
---|
143 | raii/ctor-autogen-ERR1: raii/ctor-autogen.c $(CFACC)
|
---|
144 | $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
|
---|
145 |
|
---|
146 | # Warnings
|
---|
147 | warnings/self-assignment: warnings/self-assignment.c $(CFACC)
|
---|
148 | $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
|
---|