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