annotate Makefile @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents c6ef09dfba4d
children
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
969
752d78bbb899 enabled Valgrind checks
thomask
parents: 939
diff changeset
83 return__ := $(PWD)/return__
190
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 #
971
8da09834526d * Valgrind support is now part of dstress.c instead of crashRun.c
thomask
parents: 969
diff changeset
113 % : %.c Makefile
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
114 $(CC) $(CFLAGS) $< -o $@
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
115
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 441
diff changeset
116 $(dstress__) : dstress.c $(crashRun__) Makefile
1387
dd574a01148c Dstress on Mac OS X
thomask
parents: 1093
diff changeset
117 $(CC) $(CFLAGS) $< -o $@
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
118
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
119 basic_tools : $(ifeq__) $(return__) $(extract__) $(dstress__)
441
368156152168 added version kludge
thomask
parents: 273
diff changeset
120
368156152168 added version kludge
thomask
parents: 273
diff changeset
121 #
368156152168 added version kludge
thomask
parents: 273
diff changeset
122 # kludge to get version information from DMD and GDC's dmd wraper
368156152168 added version kludge
thomask
parents: 273
diff changeset
123 #
368156152168 added version kludge
thomask
parents: 273
diff changeset
124 version:
368156152168 added version kludge
thomask
parents: 273
diff changeset
125 @$(ECHO) ">>>> VERSION <<<<"
494
03a5d1fe1283 fixed uname/date arguments
thomask
parents: 490
diff changeset
126 @date +"%a, %e %b %Y %T %z"
03a5d1fe1283 fixed uname/date arguments
thomask
parents: 490
diff changeset
127 @uname -s -m -r
441
368156152168 added version kludge
thomask
parents: 273
diff changeset
128 -@$(DMD)
368156152168 added version kludge
thomask
parents: 273
diff changeset
129 -@$(DMD) --version version_dummy.d
368156152168 added version kludge
thomask
parents: 273
diff changeset
130 @$(ECHO) "<<<< VERSION >>>>"
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
131
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
132 #
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
133 # include complex test cases
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
134 #
190
f29443c7054c 1) super()
thomask
parents: 145
diff changeset
135 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
136 include $(complex_makefiles)
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
137
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
138 #
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
139 # extract potential compiling flags from the test case sources
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
140 #
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
141 define extract_z_flags
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
142 $(eval z_flags = $(shell $(extract__) $(flag_pattern) < $<))
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
143 endef
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
144
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
145 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
146 # target should fail to compile
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
147 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
148 nocompile : $(dstress__) nocompile_clean
1390
b8ff6a83c27f Dstress on Mac OS X
thomask
parents: 1387
diff changeset
149 echo '#!/bin/sh' > nocompile.sh
1628
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents: 1627
diff changeset
150 find nocompile -type f | grep -v ".svn" | sort -f | xargs -n 1 echo "$(dstress__) nocompile" >> nocompile.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
151 chmod +x nocompile.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
152 ./nocompile.sh 2>> $(LOG)
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
153
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
154 nocompile_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
155 $(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
156 $(RM) $(z_rm)
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
157
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
158 # used in some complex test cases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
159 define analyse_nocompile
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
160 @if $(ifeq__) $(z_return) 0 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
161 $(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
162 else \
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
163 if $(CAT) $(z_log) | $(GREP) ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
164 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [Internal compiler error]"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
165 else \
145
553c8aaa0982 added support for detecting segfaults with pseudo return code 1
thomask
parents: 109
diff changeset
166 if $(ifeq__) $(z_return) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
167 $(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
168 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
169 $(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
170 fi \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
171 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
172 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
173 endef
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
174
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
175 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
176 # target should compile (excludes linking)
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
177 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
178 compile : $(dstress__) compile_clean
1390
b8ff6a83c27f Dstress on Mac OS X
thomask
parents: 1387
diff changeset
179 echo '#!/bin/sh' > compile.sh
1628
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents: 1627
diff changeset
180 find compile -type f | grep -v ".svn" | sort -f | xargs -n 1 echo "$(dstress__) compile" >> compile.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
181 chmod +x compile.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
182 ./compile.sh 2>> $(LOG)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
183
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
184 compile_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
185 $(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
186 $(RM) $(z_rm)
1093
7269c8972179 repo cleanup
thomask
parents: 971
diff changeset
187 $(eval z_rm = $(shell find compile -type f -name "*\\.exe" | grep -v ".svn"))
7269c8972179 repo cleanup
thomask
parents: 971
diff changeset
188 $(RM) $(z_rm)
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
189
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
190 # used in some complex test cases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
191 define analyse_compile
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
192 @if $(ifeq__) $(z_return) 0 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
193 $(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
194 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
195 if $(ifeq__) $(z_return) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
196 $(ECHO) "Torture-Sub-1/31-FAIL: $(z_name)"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
197 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
198 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [$(z_return)]"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
199 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
200 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
201 endef
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
202
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
203 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
204 # target should compile, link and run
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
205 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
206 run : $(dstress__) run_clean
1390
b8ff6a83c27f Dstress on Mac OS X
thomask
parents: 1387
diff changeset
207 echo '#!/bin/sh' > run.sh
1628
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents: 1627
diff changeset
208 find run -type f -name "*\\.d" | grep -v ".svn" | sort -f | xargs -n 1 echo "$(dstress__) run" >> run.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
209 chmod +x run.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
210 ./run.sh 2>> $(LOG)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
211
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
212 run_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
213 $(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
214 $(RM) $(z_rm)
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
215
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
216 # used in some complex testcases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
217 define analyse_run
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
218 @if $(ifeq__) $(z_return) 0 ; then \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
219 $(eval z_return2 = $(shell $(return__) "./$@ $(to_log)")) \
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
220 if $(ifeq__) $(z_return2) 0 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
221 $(ECHO) "Torture-Sub-1/31-PASS: $(z_name)"; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
222 else \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
223 if $(ifeq__) $(z_return2) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
224 $(ECHO) "Torture-Sub-1/31-FAIL: $(z_name)"; $(RM) $@; \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
225 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
226 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [run: $(z_return2)]"; $(RM) $@; \
80
72fa445c2fbb minor makefile cleanup
thomask
parents: 75
diff changeset
227 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
228 fi \
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
229 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
230 if $(ifeq__) $(z_return) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
231 $(ECHO) "Torture-Sub-1/31-FAIL: $(z_name) (compiling error)"; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
232 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
233 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [$(z_return)]"; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
234 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
235 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
236 endef
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
237
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
238 #
108
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
239 # target should compile, link and run
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
240 # (used for Makefile diagnosis)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
241 #
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
242 %.diagnose.$(ext_run) : %.$(ext_source) basic_tools
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
243 # destination: $@
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
244 # source: $<
109
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
245 $(eval y_tmp = OK)
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
246 # eval: $(y_tmp)
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
247 # shell:
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
248 @$(ECHO) $(shell $(ECHO) "OK")
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
249 $(eval y_tmp = $(shell $(ECHO) "OK"))
0e5c059a7658 added diagnosis for GNUMake's $(eval ...), $(shell ...) and $(eval ... $(shell ...))
thomask
parents: 108
diff changeset
250 # eval.shell: $(y_tmp)
108
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
251 $(eval z_name = $(subst .diagnose.$(ext_run),,$@))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
252 # name: $(z_name)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
253 # extract__: $(extract__)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
254 # extract__.cmd: $(extract__) $(flag_pattern) < $<
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
255 $(extract_z_flags)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
256 # extract__.result: $(z_flags)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
257 # ifeq__: $(ifeq__)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
258 # continue if ifeq__ works
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
259 $(ifeq__) someString someString
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
260 # return__: $(return__)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
261 # dmd: $(DMD)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
262 $(eval y_tmp = $(shell $(return__) "$(ifeq__) 1 1"))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
263 # return__.return_code_0: $(y_tmp) (expect=0)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
264 $(eval y_tmp = $(shell $(return__) "$(DMD) > /dev/null"))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
265 # return__.return_code_1: $(y_tmp) (expect=256)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
266 # dmd.cmd: $(DMD) $(DFLAGS) $(z_flags) -od$(OBJ_DIR) -of$@ $< $(to_log)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
267 $(eval z_return = $(shell $(return__) "$(DMD) $(DFLAGS) $(z_flags) -od$(OBJ_DIR) -of$@ $< $(to_log)"))
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
268 # dmd.return: $(z_return)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
269 # for analyse_run diagnosis: '@if' -> 'if' in 'define analyse_run' (line 185)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
270 $(analyse_run)
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
271
aa6478748245 added makefile diagnostics
thomask
parents: 92
diff changeset
272 #
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
273 # target should compile and link but fail to run
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
274 #
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
275 norun : $(dstress__) norun_clean
1390
b8ff6a83c27f Dstress on Mac OS X
thomask
parents: 1387
diff changeset
276 echo '#!/bin/sh' > norun.sh
1628
c6ef09dfba4d add mini test set from ldc project
Moritz Warning <moritzwarning@web.de>
parents: 1627
diff changeset
277 find norun -type f -name "*\\.d" | grep -v ".svn" | sort -f | xargs -n 1 echo "$(dstress__) norun" >> norun.sh
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
278 chmod +x norun.sh
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
279 ./norun.sh 2>> $(LOG)
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
280
529
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
281 norun_clean :
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
282 $(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
283 $(RM) $(z_rm)
924f45bc62e9 post DMD-0.123 review [1/n]
thomask
parents: 503
diff changeset
284
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
285 # used in some complex test cases
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
286 define analyse_norun
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
287 @if $(ifeq__) $(z_return) 0; then \
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
288 if ./$@ $(to_log); \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
289 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
290 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
291 $(ECHO) "Torture-Sub-1/31-XFAIL: $(z_name)"; \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
292 fi \
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
293 else \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
294 if $(ifeq__) $(z_return) 256 ; then \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
295 $(ECHO) "Torture-Sub-1/31-FAIL: $(z_name) (compiling error)"; $(RM) $@; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
296 else \
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 755
diff changeset
297 $(ECHO) "Torture-Sub-1/31-ERROR: $(z_name) [$(z_return)]"; \
72
b0e95b878322 added segfault detection support
thomask
parents: 63
diff changeset
298 fi \
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
299 fi
75
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
300 endef
edc279c4f7f9 makefile cleanup
thomask
parents: 72
diff changeset
301
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
302 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
303 # run all complex test cases
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
304 #
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
305 complex : basic_tools $(sort $(subst $(complex_todo),$(complex_done),$(complex_makefiles)))
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
306
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
307 #
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 #
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
310 distclean : clean_log clean
708
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
311 $(RM) $(shell $(FIND) . -regex ".*~")
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
312 $(RM) $(shell $(FIND) . -regex "\\..*\\.swp")
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
313 $(RM) $(shell $(FIND) . -regex "#.*#")
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
314 $(RM) $(shell $(FIND) . -regex ".*\\.map")
e2d3a8156828 updated distclean target
thomask
parents: 639
diff changeset
315 $(RM) $(shell $(FIND) . -regex ".*\\.bak")
490
d091ff903fa4 added crashRun for POSIX systems
thomask
parents: 441
diff changeset
316 $(RM) $(crashRun__) $(return__) $(ifeq__) $(extract__) $(dstress__) www/*.class
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
317
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
318 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
319 # remove compiler and assertion messages
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
320 #
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
321 clean_log :
3269e4627918 init dstress
svnowner
parents:
diff changeset
322 $(RM) $(LOG)
3269e4627918 init dstress
svnowner
parents:
diff changeset
323
46
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
324 #
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
325 # remove targets and all temp objects
1f7f839145de added complex test case(e.g. multi file) support
thomask
parents: 41
diff changeset
326 #
605
0f5c200f5c90 Post Pforzheim catch up 3
thomask
parents: 563
diff changeset
327 complex_clean : $(sort $(subst $(complex_todo),clean,$(complex_makefiles)))
0f5c200f5c90 Post Pforzheim catch up 3
thomask
parents: 563
diff changeset
328
939
38e8bc3a9a50 <nail-mail@mail.ru>
thomask
parents: 936
diff changeset
329 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
330 $(RM) $(OBJ_DIR)/[A-E]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
331 $(RM) $(OBJ_DIR)/[F-J]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
332 $(RM) $(OBJ_DIR)/[K-O]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
333 $(RM) $(OBJ_DIR)/[P-T]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
334 $(RM) $(OBJ_DIR)/[U-Z]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
335 $(RM) $(OBJ_DIR)/[a-e]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
336 $(RM) $(OBJ_DIR)/[f-j]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
337 $(RM) $(OBJ_DIR)/[k-o]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
338 $(RM) $(OBJ_DIR)/[p-t]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 882
diff changeset
339 $(RM) $(OBJ_DIR)/[u-z]*.*
971
8da09834526d * Valgrind support is now part of dstress.c instead of crashRun.c
thomask
parents: 969
diff changeset
340 $(RM) -rf $(OBJ_DIR)/*
251
6cd84461e17b enabled new "dstress.c" test tool
thomask
parents: 239
diff changeset
341 $(RM) run.sh norun.sh compile.sh nocompile.sh
83
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
342
6a56a7866943 added ?DSTRESS_FLAGS? support (2)
thomask
parents: 80
diff changeset
343 # the empty line above has to remain, otherwise some weired problems can arise