annotate Makefile @ 936:daeca9f37d08

adapeted "clean" target to the large number of files
author thomask
date Sun, 26 Mar 2006 12:39:49 +0000
parents 534a591a0225
children 38e8bc3a9a50
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
735
4704970e47ad use Torture capabilities of dstress.c
thomask
parents: 716
diff changeset
1 # $HeadURL$
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
2 # $Date$
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
3 # $Author$
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
4 #
239
c2a96b326f61 repos & copyright maintenance
thomask
parents: 217
diff changeset
5 # GnuMakefile for DStress http://dstress.kuehne.cn/www/dstress.html
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
6 # Copyright (C) 2004, 2005, 2006 Thomas Kuehne
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
7 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
8 # This program is free software; you can redistribute it and/or modify
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
9 # it under the terms of the GNU General Public License as published by
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
10 # the Free Software Foundation; either version 2 of the License, or
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
11 # (at your option) any later version.
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
12 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
13 # This program is distributed in the hope that it will be useful,
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
16 # GNU General Public License for more details.
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
17 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
18 # You should have received a copy of the GNU General Public License
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
19 # along with this program; if not, write to the Free Software
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
21 #
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
22
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
23 # dir: temp objects will be placed there
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
24 ifndef OBJ_DIR
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
25 OBJ_DIR := obj
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
26 endif
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
27
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
28 # file: append compiler messages and runtime assertions
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
29 # NOTE: this has to be an absolut path (required for some complex.mak files)
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
30 ifndef LOG
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
31 LOG := $(PWD)/log.txt
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
32 endif
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
33
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
34 # executeable: the compiler
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
35 ifndef DMD
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
36 DMD := dmd
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
37 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
38
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
39 # executeable: a GNU findutils compatible find (e.g.: find path -regex "?\\.*something")
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
40 ifndef FIND
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
41 FIND := find
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
42 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
43
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
44 # executeable: remove zero or more files (e.g.: rm -f a b c)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
45 ifndef RM
936
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
46 RM := rm -f --
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
47 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
48
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
49 # executeable: change to a given dir (e.g. cd some/other/dir)
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
50 ifndef CD
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
51 CD := cd
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
52 endif
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
53
716
528649416e9d infrastructure maintenance
thomask
parents: 708
diff changeset
54 # executeable: display a message test (e.g. echo "something to say")
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
55 ifndef ECHO
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
56 ECHO := echo
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
57 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
58
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
59 # executeable: update the timestamp of an existing file or create a new empty file
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
60 ifndef TOUCH
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
61 TOUCH := touch
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
62 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
63
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
64 # executeable: detect if stdin contains "Internal error" (dmd) or "gcc.gnu.org/bugs" (gcd)
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
65 ifndef GREP
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
66 GREP := grep -s '\(Internal error\)\|\(gcc.gnu.org/bugs\)' > /dev/null 2>&1
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
67 endif
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
68
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
69 # executeable: used to concat files
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
70 ifndef CAT
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
71 CAT := cat
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
72 endif
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
73
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
74 ###############################################################################
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
75 ###############################################################################
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
76 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
77 # nothing to customize below
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
78 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
79 ###############################################################################
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
80 ###############################################################################
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
81
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
82 # tools
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
83 return__ := ./return__
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
84 ifeq__ := ./ifeq__
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
85 extract__ := ./extract__
639
463c60e26040 updated readme
thomask
parents: 605
diff changeset
86 dstress__ := ./dstress
463c60e26040 updated readme
thomask
parents: 605
diff changeset
87 crashRun__ := ./crashRun
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
88
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
89 # settings
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
90 to_log := >> $(LOG) 2>&1
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
91 ext_run := exe
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
92 ext_norun := bin
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
93 ext_nocompile := no
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
94 ext_compile := o
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
95 ext_source := d
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
96 ext_source_html := html
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
97 ext_log := log
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
98 complex_todo := complex.mak
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
99 complex_done := complex.done
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
100 flag_pattern := __DSTRESS_DFLAGS__
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
101
605
0f5c200f5c90 Post Pforzheim catch up 3
thomask
parents: 563
diff changeset
102 .PHONY:: all version basic_tools compile nocompile run norun complex clean distclean clean_log
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
103
755
fb70ca0d80ba updated resutls of DMD-0.093 - 0.101, 0.104, 0.121, 0.140
thomask
parents: 735
diff changeset
104 .SUFFIXES:: $(ext_run) $(ext_norun) $(ext_nocompile) $(ext_compile)
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
105 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
106 # test everything
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
107 #
441
368156152168 added version kludge
thomask
parents: 273
diff changeset
108 all : Makefile version compile nocompile run norun complex
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
109
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
110 #
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
111 # the tools
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
112 #
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
113 $(return__) : return__.c Makefile
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
114 $(CC) $(CFLAGS) $< -o $@
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
115
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
116 $(ifeq__) : ifeq__.c Makefile
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
117 $(CC) $(CFLAGS) $< -o $@
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
118
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
119 $(extract__) : extract__.c Makefile
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
120 $(CC) $(CFLAGS) $< -o $@
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
121
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 441
diff changeset
122 $(dstress__) : dstress.c $(crashRun__) Makefile
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 441
diff changeset
123 $(CC) $(CFLAGS) $< -o $@
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 441
diff changeset
124
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 441
diff changeset
125 $(crashRun__) : crashRun.c Makefile
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
126 $(CC) $(CFLAGS) $< -o $@
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
127
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
128 basic_tools : $(ifeq__) $(return__) $(extract__) $(dstress__)
441
368156152168 added version kludge
thomask
parents: 273
diff changeset
129
368156152168 added version kludge
thomask
parents: 273
diff changeset
130 #
368156152168 added version kludge
thomask
parents: 273
diff changeset
131 # kludge to get version information from DMD and GDC's dmd wraper
368156152168 added version kludge
thomask
parents: 273
diff changeset
132 #
368156152168 added version kludge
thomask
parents: 273
diff changeset
133 version:
368156152168 added version kludge
thomask
parents: 273
diff changeset
134 @$(ECHO) ">>>> VERSION <<<<"
494
03a5d1fe1283 fixed uname/date arguments
thomask
parents: 490
diff changeset
135 @date +"%a, %e %b %Y %T %z"
03a5d1fe1283 fixed uname/date arguments
thomask
parents: 490
diff changeset
136 @uname -s -m -r
441
368156152168 added version kludge
thomask
parents: 273
diff changeset
137 -@$(DMD)
368156152168 added version kludge
thomask
parents: 273
diff changeset
138 -@$(DMD) --version version_dummy.d
368156152168 added version kludge
thomask
parents: 273
diff changeset
139 @$(ECHO) "<<<< VERSION >>>>"
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
140
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
141 #
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
142 # include complex test cases
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
143 #
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
144 complex_makefiles := $(sort $(shell $(FIND) complex -regex ".*$(complex_todo)"))
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
145 include $(complex_makefiles)
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
146
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
147 #
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
148 # extract potential compiling flags from the test case sources
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
149 #
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
150 define extract_z_flags
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
151 $(eval z_flags = $(shell $(extract__) $(flag_pattern) < $<))
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
152 endef
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
153
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
154 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
155 # target should fail to compile
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
156 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
157 nocompile : $(dstress__) nocompile_clean
735
4704970e47ad use Torture capabilities of dstress.c
thomask
parents: 716
diff changeset
158 find nocompile -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) torture-nocompile" > nocompile.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
159 chmod +x nocompile.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
160 ./nocompile.sh 2>> $(LOG)
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
161
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
162 nocompile_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
163 $(eval z_rm = $(shell find nocompile -type f -name "*\\.o" | grep -v ".svn"))
936
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
164 $(RM) $(z_rm)
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
165
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
166 # used in some complex test cases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
167 define analyse_nocompile
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
168 @if $(ifeq__) $(z_return) 0 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
169 $(ECHO) "Torture-Sub-1/31-XPASS: $(z_name)"; $(RM) $@; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
170 else \
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
171 if $(CAT) $(z_log) | $(GREP) ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
172 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [Internal compiler error]"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
173 else \
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
174 if $(ifeq__) $(z_return) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
175 $(ECHO) "Torture-Sub-1/31-XFAIL: $(z_name)"; $(TOUCH) $@; \
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
176 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
177 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [$(z_return)]"; $(RM) $@; \
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
178 fi \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
179 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
180 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
181 endef
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
182
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
183 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
184 # target should compile (excludes linking)
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
185 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
186 compile : $(dstress__) compile_clean
735
4704970e47ad use Torture capabilities of dstress.c
thomask
parents: 716
diff changeset
187 find compile -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) torture-compile" > compile.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
188 chmod +x compile.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
189 ./compile.sh 2>> $(LOG)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
190
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
191 compile_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
192 $(eval z_rm = $(shell find compile -type f -name "*\\.o" | grep -v ".svn"))
936
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
193 $(RM) $(z_rm)
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
194
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
195 # used in some complex test cases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
196 define analyse_compile
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
197 @if $(ifeq__) $(z_return) 0 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
198 $(ECHO) "Torture-Sub-1/31-PASS: $(z_name)"; $(TOUCH) $@; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
199 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
200 if $(ifeq__) $(z_return) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
201 $(ECHO) "Torture-Sub-1/31-FAIL: $(z_name)"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
202 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
203 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [$(z_return)]"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
204 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
205 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
206 endef
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
207
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
208 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
209 # target should compile, link and run
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
210 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
211 run : $(dstress__) run_clean
735
4704970e47ad use Torture capabilities of dstress.c
thomask
parents: 716
diff changeset
212 find run -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) torture-run" > run.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
213 chmod +x run.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
214 ./run.sh 2>> $(LOG)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
215
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
216 run_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
217 $(eval z_rm = $(shell find run -type f -name "*\\.exe" | grep -v ".svn"))
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
218 $(RM) $(z_rm)
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
219
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
220 # used in some complex testcases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
221 define analyse_run
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
222 @if $(ifeq__) $(z_return) 0 ; then \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
223 $(eval z_return2 = $(shell $(return__) "./$@ $(to_log)")) \
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
224 if $(ifeq__) $(z_return2) 0 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
225 $(ECHO) "Torture-Sub-1/31-PASS: $(z_name)"; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
226 else \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
227 if $(ifeq__) $(z_return2) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
228 $(ECHO) "Torture-Sub-1/31-FAIL: $(z_name)"; $(RM) $@; \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
229 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
230 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [run: $(z_return2)]"; $(RM) $@; \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
231 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
232 fi \
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
233 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
234 if $(ifeq__) $(z_return) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
235 $(ECHO) "Torture-Sub-1/31-FAIL: $(z_name) (compiling error)"; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
236 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
237 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [$(z_return)]"; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
238 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
239 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
240 endef
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
241
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
242 #
108
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
243 # target should compile, link and run
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
244 # (used for Makefile diagnosis)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
245 #
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
246 %.diagnose.$(ext_run) : %.$(ext_source) basic_tools
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
247 # destination: $@
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
248 # source: $<
109
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
249 $(eval y_tmp = OK)
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
250 # eval: $(y_tmp)
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
251 # shell:
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
252 @$(ECHO) $(shell $(ECHO) "OK")
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
253 $(eval y_tmp = $(shell $(ECHO) "OK"))
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
254 # eval.shell: $(y_tmp)
108
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
255 $(eval z_name = $(subst .diagnose.$(ext_run),,$@))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
256 # name: $(z_name)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
257 # extract__: $(extract__)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
258 # extract__.cmd: $(extract__) $(flag_pattern) < $<
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
259 $(extract_z_flags)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
260 # extract__.result: $(z_flags)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
261 # ifeq__: $(ifeq__)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
262 # continue if ifeq__ works
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
263 $(ifeq__) someString someString
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
264 # return__: $(return__)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
265 # dmd: $(DMD)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
266 $(eval y_tmp = $(shell $(return__) "$(ifeq__) 1 1"))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
267 # return__.return_code_0: $(y_tmp) (expect=0)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
268 $(eval y_tmp = $(shell $(return__) "$(DMD) > /dev/null"))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
269 # return__.return_code_1: $(y_tmp) (expect=256)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
270 # dmd.cmd: $(DMD) $(DFLAGS) $(z_flags) -od$(OBJ_DIR) -of$@ $< $(to_log)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
271 $(eval z_return = $(shell $(return__) "$(DMD) $(DFLAGS) $(z_flags) -od$(OBJ_DIR) -of$@ $< $(to_log)"))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
272 # dmd.return: $(z_return)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
273 # for analyse_run diagnosis: '@if' -> 'if' in 'define analyse_run' (line 185)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
274 $(analyse_run)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
275
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
276 #
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
277 # target should compile and link but fail to run
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
278 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
279 norun : $(dstress__) norun_clean
735
4704970e47ad use Torture capabilities of dstress.c
thomask
parents: 716
diff changeset
280 find norun -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) torture-norun" > norun.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
281 chmod +x norun.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
282 ./norun.sh 2>> $(LOG)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
283
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
284 norun_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
285 $(eval z_rm = $(shell find norun -type f -name "*\\.exe" | grep -v ".svn"))
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
286 $(RM) $(z_rm)
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
287
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
288 # used in some complex test cases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
289 define analyse_norun
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
290 @if $(ifeq__) $(z_return) 0; then \
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
291 if ./$@ $(to_log); \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
292 then $(ECHO) "Torture-Sub-1/31-XPASS: $(z_name)"; $(RM) $@; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
293 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
294 $(ECHO) "Torture-Sub-1/31-XFAIL: $(z_name)"; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
295 fi \
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
296 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
297 if $(ifeq__) $(z_return) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
298 $(ECHO) "Torture-Sub-1/31-FAIL: $(z_name) (compiling error)"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
299 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
300 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [$(z_return)]"; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
301 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
302 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
303 endef
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
304
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
305 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
306 # run all complex test cases
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
307 #
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
308 complex : basic_tools $(sort $(subst $(complex_todo),$(complex_done),$(complex_makefiles)))
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
309
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
310 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
311 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
312 #
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
313 distclean : clean_log clean
708
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
314 $(RM) $(shell $(FIND) . -regex ".*~")
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
315 $(RM) $(shell $(FIND) . -regex "\\..*\\.swp")
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
316 $(RM) $(shell $(FIND) . -regex "#.*#")
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
317 $(RM) $(shell $(FIND) . -regex ".*\\.map")
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
318 $(RM) $(shell $(FIND) . -regex ".*\\.bak")
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 441
diff changeset
319 $(RM) $(crashRun__) $(return__) $(ifeq__) $(extract__) $(dstress__) www/*.class
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
320
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
321 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
322 # remove compiler and assertion messages
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
323 #
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
324 clean_log :
3269e4627918 init dstress
svnowner
parents:
diff changeset
325 $(RM) $(LOG)
3269e4627918 init dstress
svnowner
parents:
diff changeset
326
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
327 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
328 # remove targets and all temp objects
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
329 #
605
0f5c200f5c90 Post Pforzheim catch up 3
thomask
parents: 563
diff changeset
330 complex_clean : $(sort $(subst $(complex_todo),clean,$(complex_makefiles)))
0f5c200f5c90 Post Pforzheim catch up 3
thomask
parents: 563
diff changeset
331
0f5c200f5c90 Post Pforzheim catch up 3
thomask
parents: 563
diff changeset
332 clean : complex_clean nocompile_clean compile_clean norun_clean run_clean
936
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
333 $(RM) $(OBJ_DIR)/[A-E]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
334 $(RM) $(OBJ_DIR)/[F-J]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
335 $(RM) $(OBJ_DIR)/[K-O]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
336 $(RM) $(OBJ_DIR)/[P-T]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
337 $(RM) $(OBJ_DIR)/[U-Z]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
338 $(RM) $(OBJ_DIR)/[a-e]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
339 $(RM) $(OBJ_DIR)/[f-j]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
340 $(RM) $(OBJ_DIR)/[k-o]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
341 $(RM) $(OBJ_DIR)/[p-t]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
342 $(RM) $(OBJ_DIR)/[u-z]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
343 $(RM) $(OBJ_DIR)/?*.*
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
344 $(RM) run.sh norun.sh compile.sh nocompile.sh
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
345
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
346 # the empty line above has to remain, otherwise some weired problems can arise