annotate Makefile @ 639:463c60e26040

updated readme
author thomask
date Sun, 21 Aug 2005 18:22:43 +0000
parents 0f5c200f5c90
children e2d3a8156828
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
1 # $HeadURL$
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
c2a96b326f61 repos & copyright maintenance
thomask
parents: 217
diff changeset
6 # Copyright (C) 2004, 2005 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
190
f29443c7054c 1) super()
thomask
parents: 145
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
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
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
f29443c7054c 1) super()
thomask
parents: 145
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
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
158 find nocompile -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) 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"))
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
164
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
165 # used in some complex test cases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
166 define analyse_nocompile
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
167 @if $(ifeq__) $(z_return) 0 ; then \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
168 $(ECHO) "XPASS: $(z_name)"; $(RM) $@; \
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
169 else \
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
170 if $(CAT) $(z_log) | $(GREP) ; then \
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
171 $(ECHO) "ERROR: $(z_name) [Internal compiler error]"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
172 else \
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
173 if $(ifeq__) $(z_return) 256 ; then \
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
174 $(ECHO) "XFAIL: $(z_name)"; $(TOUCH) $@; \
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
175 else \
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
176 $(ECHO) "ERROR: $(z_name) [$(z_return)]"; $(RM) $@; \
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
177 fi \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
178 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
179 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
180 endef
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
181
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
182 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
183 # target should compile (excludes linking)
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
184 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
185 compile : $(dstress__) compile_clean
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
186 find compile -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) compile" > compile.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
187 chmod +x compile.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
188 ./compile.sh 2>> $(LOG)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
189
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
190 compile_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
191 $(eval z_rm = $(shell find compile -type f -name "*\\.o" | grep -v ".svn"))
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
192
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
193 # used in some complex test cases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
194 define analyse_compile
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
195 @if $(ifeq__) $(z_return) 0 ; then \
217
d28e9d734c7f suport multiple file compile targets
thomask
parents: 190
diff changeset
196 $(ECHO) "PASS: $(z_name)"; $(TOUCH) $@; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
197 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
198 if $(ifeq__) $(z_return) 256 ; then \
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
199 $(ECHO) "FAIL: $(z_name)"; $(RM) $@; \
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
200 else \
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
201 $(ECHO) "ERROR: $(z_name) [$(z_return)]"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
202 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
203 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
204 endef
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
205
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
206 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
207 # target should compile, link and run
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
208 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
209 run : $(dstress__) run_clean
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
210 find run -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) run" > run.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
211 chmod +x run.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
212 ./run.sh 2>> $(LOG)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
213
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
214 run_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
215 $(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
216 $(RM) $(z_rm)
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
217
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
218 # used in some complex testcases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
219 define analyse_run
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
220 @if $(ifeq__) $(z_return) 0 ; then \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
221 $(eval z_return2 = $(shell $(return__) "./$@ $(to_log)")) \
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
222 if $(ifeq__) $(z_return2) 0 ; then \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
223 $(ECHO) "PASS: $(z_name)"; \
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
224 else \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
225 if $(ifeq__) $(z_return2) 256 ; then \
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
226 $(ECHO) "FAIL: $(z_name)"; $(RM) $@; \
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
227 else \
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
228 $(ECHO) "ERROR: $(z_name) [run: $(z_return2)]"; $(RM) $@; \
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
229 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
230 fi \
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
231 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
232 if $(ifeq__) $(z_return) 256 ; then \
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
233 $(ECHO) "FAIL: $(z_name) (compiling error)"; \
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
234 else \
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
235 $(ECHO) "ERROR: $(z_name) [$(z_return)]"; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
236 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
237 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
238 endef
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
239
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
240 #
108
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
241 # target should compile, link and run
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
242 # (used for Makefile diagnosis)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
243 #
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
244 %.diagnose.$(ext_run) : %.$(ext_source) basic_tools
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
245 # destination: $@
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
246 # source: $<
109
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
247 $(eval y_tmp = OK)
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
248 # eval: $(y_tmp)
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
249 # shell:
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
250 @$(ECHO) $(shell $(ECHO) "OK")
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
251 $(eval y_tmp = $(shell $(ECHO) "OK"))
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
252 # eval.shell: $(y_tmp)
108
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
253 $(eval z_name = $(subst .diagnose.$(ext_run),,$@))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
254 # name: $(z_name)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
255 # extract__: $(extract__)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
256 # extract__.cmd: $(extract__) $(flag_pattern) < $<
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
257 $(extract_z_flags)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
258 # extract__.result: $(z_flags)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
259 # ifeq__: $(ifeq__)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
260 # continue if ifeq__ works
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
261 $(ifeq__) someString someString
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
262 # return__: $(return__)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
263 # dmd: $(DMD)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
264 $(eval y_tmp = $(shell $(return__) "$(ifeq__) 1 1"))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
265 # return__.return_code_0: $(y_tmp) (expect=0)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
266 $(eval y_tmp = $(shell $(return__) "$(DMD) > /dev/null"))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
267 # return__.return_code_1: $(y_tmp) (expect=256)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
268 # dmd.cmd: $(DMD) $(DFLAGS) $(z_flags) -od$(OBJ_DIR) -of$@ $< $(to_log)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
269 $(eval z_return = $(shell $(return__) "$(DMD) $(DFLAGS) $(z_flags) -od$(OBJ_DIR) -of$@ $< $(to_log)"))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
270 # dmd.return: $(z_return)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
271 # for analyse_run diagnosis: '@if' -> 'if' in 'define analyse_run' (line 185)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
272 $(analyse_run)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
273
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
274 #
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
275 # target should compile and link but fail to run
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
276 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
277 norun : $(dstress__) norun_clean
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
278 find norun -type f | grep -v ".svn" | sort --ignore-case | xargs -n 1 echo "$(dstress__) norun" > norun.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
279 chmod +x norun.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
280 ./norun.sh 2>> $(LOG)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
281
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
282 norun_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
283 $(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
284 $(RM) $(z_rm)
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
285
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
286 # used in some complex test cases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
287 define analyse_norun
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
288 @if $(ifeq__) $(z_return) 0; then \
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
289 if ./$@ $(to_log); \
58
eedf04fffdc3 re-aligned test output
thomask
parents: 46
diff changeset
290 then $(ECHO) "XPASS: $(z_name)"; $(RM) $@; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
291 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
292 $(ECHO) "XFAIL: $(z_name)"; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
293 fi \
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
294 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
295 if $(ifeq__) $(z_return) 256 ; then \
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
296 $(ECHO) "FAIL: $(z_name) (compiling error)"; $(RM) $@; \
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
297 else \
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
298 $(ECHO) "ERROR: $(z_name) [$(z_return)]"; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
299 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
300 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
301 endef
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
302
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
303 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
304 # run all complex test cases
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
305 #
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
306 complex : basic_tools $(sort $(subst $(complex_todo),$(complex_done),$(complex_makefiles)))
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
307
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
308 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
309 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
310 #
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
311 distclean : clean_log clean
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
312 $(RM) $(shell $(FIND) . -regex ".*~") $(shell $(FIND) . -regex "\\..*\\.swp") $(shell $(FIND) . -regex "#.*#")
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 441
diff changeset
313 $(RM) $(crashRun__) $(return__) $(ifeq__) $(extract__) $(dstress__) www/*.class
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
314
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
315 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
316 # remove compiler and assertion messages
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
317 #
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
318 clean_log :
3269e4627918 init dstress
svnowner
parents:
diff changeset
319 $(RM) $(LOG)
3269e4627918 init dstress
svnowner
parents:
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 targets and all temp objects
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
323 #
605
0f5c200f5c90 Post Pforzheim catch up 3
thomask
parents: 563
diff changeset
324 complex_clean : $(sort $(subst $(complex_todo),clean,$(complex_makefiles)))
0f5c200f5c90 Post Pforzheim catch up 3
thomask
parents: 563
diff changeset
325
0f5c200f5c90 Post Pforzheim catch up 3
thomask
parents: 563
diff changeset
326 clean : complex_clean nocompile_clean compile_clean norun_clean run_clean
563
5ba9ff1b14c7 fixed cleanup target
thomask
parents: 529
diff changeset
327 $(RM) $(z_rm) $(OBJ_DIR)/?*.*
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
328 $(RM) run.sh norun.sh compile.sh nocompile.sh
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
329
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
330 # the empty line above has to remain, otherwise some weired problems can arise