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 : Wed Jun 6 16:42:20 2018 |
---|
14 | ## Update Count : 49 |
---|
15 | ############################################################################### |
---|
16 | |
---|
17 | |
---|
18 | debug=yes |
---|
19 | |
---|
20 | quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes |
---|
21 | |
---|
22 | concurrent= |
---|
23 | |
---|
24 | TEST_PY = python ${srcdir}/test.py |
---|
25 | |
---|
26 | # applies to both programs |
---|
27 | AM_CFLAGS = $(if $(test), 2> $(test), ) \ |
---|
28 | -g \ |
---|
29 | -Wall \ |
---|
30 | -Wno-unused-function \ |
---|
31 | -quiet @CFA_FLAGS@ \ |
---|
32 | -DIN_DIR="${srcdir}/.in/" \ |
---|
33 | @BUILD_IN_TREE_FLAGS@ |
---|
34 | |
---|
35 | AM_CFLAGS += ${DEBUG_FLAGS} |
---|
36 | |
---|
37 | CC = @CFACC@ |
---|
38 | |
---|
39 | .PHONY: list .validate |
---|
40 | .INTERMEDIATE: .validate .validate.c |
---|
41 | EXTRA_PROGRAMS = fstream_test avl_test # build but do not install |
---|
42 | |
---|
43 | fstream_test_SOURCES = fstream_test.c |
---|
44 | |
---|
45 | 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 |
---|
46 | |
---|
47 | all-local : |
---|
48 | @+${TEST_PY} --debug=${debug} ${concurrent} ${quick_test} |
---|
49 | |
---|
50 | all-tests : |
---|
51 | @+${TEST_PY} --all --debug=${debug} ${concurrent} # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program |
---|
52 | |
---|
53 | clean-local : |
---|
54 | rm -f ${EXTRA_PROGRAMS} |
---|
55 | |
---|
56 | list : |
---|
57 | @+${TEST_PY} --list ${concurrent} |
---|
58 | |
---|
59 | .validate: .validate.c |
---|
60 | @$(COMPILE) .validate.c -fsyntax-only |
---|
61 | |
---|
62 | .validate.c: |
---|
63 | @echo "int main() { return 0; }" > ${@} |
---|
64 | |
---|
65 | concurrency : |
---|
66 | @+${TEST_PY} --debug=${debug} -Iconcurrent |
---|
67 | |
---|
68 | # SKULLDUGGERY like libcfa/Makefile.am prevent extensionless headers from being generated |
---|
69 | # however, here it is more complicated because it must match the dependencies based on how |
---|
70 | # they are generated by gcc |
---|
71 | headers = $(shell find $(top_srcdir)/libcfa/src -type f ! -name "*.*") |
---|
72 | headers_real = $(shell realpath --relative-to=$(top_srcdir)/libcfa/src $(headers)) |
---|
73 | headers_deps = $(addprefix %/, $(headers_real)) |
---|
74 | $(headers_deps) : |
---|
75 | echo "Dummy rule, should never be called" |
---|
76 | |
---|
77 | # %/stdlib: |
---|
78 | # echo "Dummy rule, should never be called" |
---|
79 | |
---|
80 | # implicit rule so not all test require a rule |
---|
81 | % : %.c $(CC) |
---|
82 | $(COMPILE) $(abspath ${<}) -o ${@} |
---|
83 | |
---|
84 | declarationSpecifier: declarationSpecifier.c $(CC) |
---|
85 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@} |
---|
86 | |
---|
87 | gccExtensions : gccExtensions.c $(CC) |
---|
88 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@} |
---|
89 | |
---|
90 | extension : extension.c $(CC) |
---|
91 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@} |
---|
92 | |
---|
93 | attributes : attributes.c $(CC) |
---|
94 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@} |
---|
95 | |
---|
96 | functions: functions.c $(CC) |
---|
97 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@} |
---|
98 | |
---|
99 | KRfunctions : KRfunctions.c $(CC) |
---|
100 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@} |
---|
101 | |
---|
102 | sched-ext-parse : sched-ext-parse.c $(CC) |
---|
103 | $(COMPILE) -CFA -XCFA -p $(abspath ${<}) -o ${@} |
---|
104 | |
---|
105 | gmp : gmp.c $(CC) |
---|
106 | $(COMPILE) -lgmp $(abspath ${<}) -o ${@} |
---|
107 | |
---|
108 | completeTypeError : completeTypeError.c $(CC) |
---|
109 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@} |
---|
110 | |
---|
111 | typedefRedef-ERR1: typedefRedef.c $(CC) |
---|
112 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@} |
---|
113 | |
---|
114 | alloc-ERROR: alloc.c $(CC) |
---|
115 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@} |
---|
116 | |
---|
117 | fallthrough-ERROR: fallthrough.c $(CC) |
---|
118 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@} |
---|
119 | |
---|
120 | nested-types-ERR1: nested-types.c $(CC) |
---|
121 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@} |
---|
122 | |
---|
123 | nested-types-ERR2: nested-types.c $(CC) |
---|
124 | $(COMPILE) -DERR2 $(abspath ${<}) -o ${@} |
---|
125 | |
---|
126 | # Constructor/destructor tests |
---|
127 | raii/dtor-early-exit-ERR1: raii/dtor-early-exit.c $(CC) |
---|
128 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@} |
---|
129 | |
---|
130 | raii/dtor-early-exit-ERR2: raii/dtor-early-exit.c $(CC) |
---|
131 | $(COMPILE) -DERR2 $(abspath ${<}) -o ${@} |
---|
132 | |
---|
133 | raii/memberCtors-ERR1: raii/memberCtors.c $(CC) |
---|
134 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@} |
---|
135 | |
---|
136 | raii/ctor-autogen-ERR1: raii/ctor-autogen.c $(CC) |
---|
137 | $(COMPILE) -DERR1 $(abspath ${<}) -o ${@} |
---|
138 | |
---|
139 | # Warnings |
---|
140 | warnings/self-assignment: warnings/self-assignment.c $(CC) |
---|
141 | $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only |
---|
142 | |
---|
143 | #builtins |
---|
144 | builtins/sync: builtins/sync.c $(CC) |
---|
145 | $(COMPILE) $(abspath ${<}) 2> ${@} -fsyntax-only |
---|