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