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
|
|
48 RM := rm -f
|
|
49 endif
|
|
50
|
905
|
51 find := find
|
|
52 find_filter := -type f | grep -v "\\(\\.svn\\)\\|\\(\\.exe$\\)"
|
|
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
|
903
|
68 dstress := ./dstress.exe
|
|
69 crashRun := ./crashRun.exe
|
|
70 logsuffix := .outlog
|
|
71
|
|
72 .PHONY:: all all_prep all_real clean compile nocompile norun run tools version
|
|
73
|
905
|
74 all : version compile nocompile run norun
|
903
|
75
|
|
76 %.exe : %.c
|
|
77 $(CC) $(CFLAGS) $< -o $@
|
|
78
|
|
79 tools : $(dstress) $(crashRun)
|
|
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 #
|
903
|
126
|
|
127 clean :
|
905
|
128 $(RM) -- $(shell $(find) run -name "*exe")
|
|
129 $(RM) -- $(shell $(find) norun -name "*exe")
|
|
130 $(RM) -- $(shell $(find) compile -name "*exe")
|
|
131 $(RM) -- $(shell $(find) nocompile -name "*exe")
|
903
|
132 $(RM) -- obj/?*.*
|
|
133 $(RM) -- $(dstress) $(crashRun)
|
|
134
|