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