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