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