annotate Makefile.parallel @ 960:ed4432c7776f

parallel make of test cases with multiple object files is broken
author thomask
date Fri, 14 Apr 2006 07:19:20 +0000
parents daeca9f37d08
children 752d78bbb899
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
1 # $HeadURL$
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
2 # $Date$
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
3 # $Author$
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
4 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
5 # experimental parallel GnuMakefile for DStress http://dstress.kuehne.cn/www/dstress.html
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
6 # Copyright (C) 2006 Thomas Kuehne
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
7 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
8 # This program is free software; you can redistribute it and/or modify
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
9 # it under the terms of the GNU General Public License as published by
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
10 # the Free Software Foundation; either version 2 of the License, or
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
11 # (at your option) any later version.
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
12 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
13 # This program is distributed in the hope that it will be useful,
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
16 # GNU General Public License for more details.
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
17 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
18 # You should have received a copy of the GNU General Public License
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
19 # along with this program; if not, write to the Free Software
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
21 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
22
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
23 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
24 # config
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
25 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
26
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
27 date := date +"%a, %e %b %Y %T %z"
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
28 uname := uname -s -m -r
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
29
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
30 ifndef CAT
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
31 CAT := cat
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
32 endif
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
33
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
34 ifndef CC
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
35 CC := cc
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
36 endif
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
37
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
38 ifndef DMD
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
39 DMD := dmd
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
40 export DMD
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
41 endif
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
42
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
43 ifndef FIND
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
44 FIND := find
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
45 endif
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
46
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
47 ifndef RM
936
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
48 RM := rm -f --
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
49 endif
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
50
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
51 find := find
910
67f90139e1da fixed $ escape in find_target
thomask
parents: 905
diff changeset
52 find_filter := -type f | grep -v "\\(\\.svn\\)\\|\\(\\.exe$$\\)"
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
53
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
54 ###############################################################################
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
55 ###############################################################################
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
56 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
57 # nothing to customize below this line
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
58 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
59 ###############################################################################
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
60 ###############################################################################
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
61
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
62 ifndef NO_TORTURE
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
63 torture := torture-
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
64 else
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
65 torture :=
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
66 endif
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
67
913
1173272680e3 fixed crashRun building
thomask
parents: 910
diff changeset
68 dstress := ./dstress
1173272680e3 fixed crashRun building
thomask
parents: 910
diff changeset
69 crashRun := ./crashRun
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
70 logsuffix := .outlog
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
71
913
1173272680e3 fixed crashRun building
thomask
parents: 910
diff changeset
72 .PHONY:: all clean compile nocompile norun run tools version
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
73
960
ed4432c7776f parallel make of test cases with multiple object files is broken
thomask
parents: 936
diff changeset
74 bug:
ed4432c7776f parallel make of test cases with multiple object files is broken
thomask
parents: 936
diff changeset
75 $(error not yet save for test cases involving multiple object files)
ed4432c7776f parallel make of test cases with multiple object files is broken
thomask
parents: 936
diff changeset
76
913
1173272680e3 fixed crashRun building
thomask
parents: 910
diff changeset
77 all :: version compile nocompile run norun
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
78
913
1173272680e3 fixed crashRun building
thomask
parents: 910
diff changeset
79 % : %.c
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
80 $(CC) $(CFLAGS) $< -o $@
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
81
936
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
82 tools :: $(dstress) $(crashRun)
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
83
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
84 version :
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
85 @$(date)
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
86 @$(uname)
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
87 -@$(DMD) -v
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
88
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
89 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
90 # compile
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
91 #
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
92 compile : $(sort $(patsubst %,%.exe,$(shell $(find) compile $(find_filter))))
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
93
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
94 compile/%.exe : compile/% tools
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
95 @$(dstress) $(torture)compile $< > obj/$(notdir $<)$(logsuffix)
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
96 @$(CAT) obj/$(notdir $<)$(logsuffix)
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
97
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
98 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
99 # nocompile
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
100 #
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
101 nocompile : $(sort $(patsubst %,%.exe,$(shell $(find) nocompile $(find_filter))))
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
102
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
103 nocompile/%.exe : nocompile/% tools
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
104 @$(dstress) $(torture)nocompile $< > obj/$(notdir $<)$(logsuffix)
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
105 @$(CAT) obj/$(notdir $<)$(logsuffix)
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
106
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
107 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
108 # norun
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
109 #
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
110 norun : $(sort $(patsubst %,%.exe,$(shell $(find) norun $(find_filter))))
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
111
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
112 norun/%.exe : norun/% tools
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
113 @$(dstress) $(torture)norun $< > obj/$(notdir $<)$(logsuffix)
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
114 @$(CAT) obj/$(notdir $<)$(logsuffix)
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
115
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
116 #
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
117 # run
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
118 #
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
119 run : $(sort $(patsubst %,%.exe,$(shell $(find) run $(find_filter))))
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
120
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
121 run/%.exe : run/% tools
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
122 @$(dstress) $(torture)run $< > obj/$(notdir $<)$(logsuffix)
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
123 @$(CAT) obj/$(notdir $<)$(logsuffix)
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
124
905
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
125 #
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
126 # clean
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
127 #
151eb236b6bc added NO_TORTURE support
thomask
parents: 903
diff changeset
128 #
913
1173272680e3 fixed crashRun building
thomask
parents: 910
diff changeset
129 clean ::
936
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
130 $(RM) $(shell $(find) run -name "*exe")
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
131 $(RM) $(shell $(find) norun -name "*exe")
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
132 $(RM) $(shell $(find) compile -name "*exe")
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
133 $(RM) $(shell $(find) nocompile -name "*exe")
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
134 $(RM) obj/[A-E]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
135 $(RM) obj/[F-J]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
136 $(RM) obj/[K-O]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
137 $(RM) obj/[P-T]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
138 $(RM) obj/[U-Z]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
139 $(RM) obj/[a-e]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
140 $(RM) obj/[f-j]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
141 $(RM) obj/[k-o]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
142 $(RM) obj/[p-t]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
143 $(RM) obj/[u-z]*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
144 $(RM) obj/?*.*
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
145 $(RM) run.sh norun.sh compile.sh nocompile.sh
daeca9f37d08 adapeted "clean" target to the large number of files
thomask
parents: 913
diff changeset
146 $(RM) $(dstress) $(crashRun)
903
613f9c34bb15 added experimental Makefile.parallel
thomask
parents:
diff changeset
147