annotate Makefile @ 41:84e813a3e99b

fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
author thomask
date Thu, 14 Oct 2004 10:27:10 +0000
parents 315459a24bf4
children 1f7f839145de
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
1 # GnuMakefile for dstress
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
2
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
3 ifndef OBJ_DIR
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
4 OBJ_DIR = obj
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
5 endif
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
6
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
7 ifndef LOG
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
8 LOG = log.txt
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
9 endif
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
10
3269e4627918 init dstress
svnowner
parents:
diff changeset
11 ifndef DMD
3269e4627918 init dstress
svnowner
parents:
diff changeset
12 DMD = dmd
3269e4627918 init dstress
svnowner
parents:
diff changeset
13 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
14
3269e4627918 init dstress
svnowner
parents:
diff changeset
15 ifndef FIND
3269e4627918 init dstress
svnowner
parents:
diff changeset
16 FIND = find
3269e4627918 init dstress
svnowner
parents:
diff changeset
17 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
18
3269e4627918 init dstress
svnowner
parents:
diff changeset
19 ifndef RM
3269e4627918 init dstress
svnowner
parents:
diff changeset
20 RM = rm -rf
3269e4627918 init dstress
svnowner
parents:
diff changeset
21 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
22
3269e4627918 init dstress
svnowner
parents:
diff changeset
23 ifndef ECHO
3269e4627918 init dstress
svnowner
parents:
diff changeset
24 ECHO = echo
3269e4627918 init dstress
svnowner
parents:
diff changeset
25 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
26
3269e4627918 init dstress
svnowner
parents:
diff changeset
27 ifndef TOUCH
3269e4627918 init dstress
svnowner
parents:
diff changeset
28 TOUCH = touch
3269e4627918 init dstress
svnowner
parents:
diff changeset
29 endif
3269e4627918 init dstress
svnowner
parents:
diff changeset
30
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
31 ifndef MAKE
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
32 MAKE = make
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
33 endif
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
34
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
35 to_log = >> $(LOG) 2>&1
3269e4627918 init dstress
svnowner
parents:
diff changeset
36 ext_run = exe
3269e4627918 init dstress
svnowner
parents:
diff changeset
37 ext_norun = bin
3269e4627918 init dstress
svnowner
parents:
diff changeset
38 ext_nocompile = no
3269e4627918 init dstress
svnowner
parents:
diff changeset
39 ext_compile = o
3269e4627918 init dstress
svnowner
parents:
diff changeset
40 ext_source = d
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
41 ext_source_html = html
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
42
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
43 all : Makefile compile nocompile run norun
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
44
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
45 .PHONY: all compile nocompile run norun clean distclean clean_log log
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
46
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
47
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
48 nocompile : Makefile $(sort $(subst .$(ext_source),.$(ext_nocompile),$(shell $(FIND) nocompile -regex ".*\\.$(ext_source)" ) ) $(subst .$(ext_source_html),.$(ext_nocompile),$(shell $(FIND) nocompile -regex ".*\\.$(ext_source_html)" ) ) )
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
49
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
50 %.$(ext_nocompile) : %.$(ext_source) Makefile
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
51 @if $(DMD) $(DFLAGS) -c -of$@ $< $(to_log); then $(ECHO) "XPASS: $(subst .$(ext_nocompile),,$@)"; $(RM) $@; else $(ECHO) "FAIL: $(subst .$(ext_nocompile),,$@)"; $(TOUCH) $@; fi
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
52
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
53 %.$(ext_nocompile) : %.$(ext_source_html) Makefile
31
176f34f08034 fixed DEFLAGS -> DFLAGS
thomask
parents: 17
diff changeset
54 @if $(DMD) $(DFLAGS) -c -of$@ $< $(to_log); then $(ECHO) "XPASS: $(subst .$(ext_nocompile),,$@)"; $(RM) $@; else $(ECHO) "FAIL: $(subst .$(ext_nocompile),,$@)"; $(TOUCH) $@; fi
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
55
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
56
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
57 compile : Makefile $(sort $(subst .$(ext_source),.$(ext_compile),$(shell $(FIND) compile -regex ".*\\.$(ext_source)" ) ) $(subst .$(ext_source_html),.$(ext_compile),$(shell $(FIND) compile -regex ".*\\.$(ext_source_html)" ) ) )
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
58
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
59 %.$(ext_compile) : %.$(ext_source) Makefile
31
176f34f08034 fixed DEFLAGS -> DFLAGS
thomask
parents: 17
diff changeset
60 @if $(DMD) $(DFLAGS) -c -of$@ $< $(to_log) ; then $(ECHO) "PASS: $(subst .$(ext_compile),,$@)"; $(TOUCH) $@; else $(ECHO) "XFAIL: $(subst .$(ext_compile),,$@)"; $(RM) $@; fi
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
61
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
62 %.$(ext_compile) : %.$(ext_source_html) Makefile
31
176f34f08034 fixed DEFLAGS -> DFLAGS
thomask
parents: 17
diff changeset
63 @if $(DMD) $(DFLAGS) -c -of$@ $< $(to_log) ; then $(ECHO) "PASS: $(subst .$(ext_compile),,$@)"; $(TOUCH) $@; else $(ECHO) "XFAIL: $(subst .$(ext_compile),,$@)"; $(RM) $@; fi
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
64
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
65
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
66 run : Makefile $(sort $(subst .$(ext_source),.$(ext_run),$(shell $(FIND) run -regex ".*\\.$(ext_source)" ) ) $(subst .$(ext_source_html),.$(ext_run),$(shell $(FIND) run -regex ".*\\.$(ext_source_html)" ) ) )
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
67
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
68 %.$(ext_run) : %.$(ext_source) Makefile
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
69 @if $(DMD) $(DFLAGS) -od$(OBJ_DIR) -of$@ $< $(to_log); then if $@ $(to_log); then $(ECHO) "PASS: $(subst .$(ext_run),,$@)"; else $(ECHO) "XFAIL: $(subst .$(ext_run),,$@)"; $(RM) $@; fi else $(ECHO) "XFAIL: $(subst .$(ext_run),,$@) (compiling error)"; fi
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
70
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
71 %.$(ext_run) : %.$(ext_source_html) Makefile
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
72 @if $(DMD) $(DFLAGS) -od$(OBJ_DIR) -of$@ $< $(to_log); then if $@ $(to_log); then $(ECHO) "PASS: $(subst .$(ext_run),,$@)"; else $(ECHO) "XFAIL: $(subst .$(ext_run),,$@)"; $(RM) $@; fi else $(ECHO) "XFAIL: $(subst .$(ext_run),,$@) (compiling error)"; fi
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
73
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
74
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
75 norun : Makefile $(sort $(subst .$(ext_source),.$(ext_norun),$(shell $(FIND) norun -regex ".*\\.$(ext_source)" ) ) $(subst .$(ext_source_html),.$(ext_norun),$(shell $(FIND) norun -regex ".*\\.$(ext_source_html)" ) ) )
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
76
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
77 %.$(ext_norun) : %.$(ext_source) Makefile
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
78 @if $(DMD) $(DFLAGS) -od$(OBJ_DIR) -of$@ $< $(to_log); then if $@ $(to_log); then $(ECHO) "XPASS: $(subst .$(ext_norun),,$@)"; $(RM) $@; else $(ECHO) "FAIL: $(subst .$(ext_norun),,$@)"; fi else $(ECHO) "XFAIL: $(subst .$(ext_run),,$@) (compiling error)"; $(RM) $@; fi
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
79
41
84e813a3e99b fixed Makefile so that an edited makefile triggers a rebuild of outdated targets
thomask
parents: 32
diff changeset
80 %.$(ext_norun) : %.$(ext_source_html) Makefile
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
81 @if $(DMD) $(DFLAGS) -od$(OBJ_DIR) -of$@ $< $(to_log); then if $@ $(to_log); then $(ECHO) "XPASS: $(subst .$(ext_norun),,$@)"; $(RM) $@; else $(ECHO) "FAIL: $(subst .$(ext_norun),,$@)"; fi else $(ECHO) "XFAIL: $(subst .$(ext_run),,$@) (compiling error)"; $(RM) $@; fi
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
82
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
83
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
84 log : distclean all
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
85
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
86
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
87 distclean : clean_log clean
32
315459a24bf4 fixed LOG and OBJ_DIR
thomask
parents: 31
diff changeset
88
6
e238a15dbc74 1) added added html-sourcefile support
thomask
parents: 0
diff changeset
89
0
3269e4627918 init dstress
svnowner
parents:
diff changeset
90 clean_log :
3269e4627918 init dstress
svnowner
parents:
diff changeset
91 $(RM) $(LOG)
3269e4627918 init dstress
svnowner
parents:
diff changeset
92
3269e4627918 init dstress
svnowner
parents:
diff changeset
93 clean :
17
deb014248067 cleanup of makefile
thomask
parents: 14
diff changeset
94 $(RM) $(OBJ_DIR)/?*.o run/?*.$(ext_run) norun/?*.$(ext_norun) compile/?*.$(ext_compile) nocompile/?*.$(ext_nocompile)