1 |
785
|
aaronmk
|
##### Vars/functions
|
2 |
|
|
|
3 |
410
|
aaronmk
|
# Make
|
4 |
625
|
aaronmk
|
pathParts = $(shell path="$(1)"; echo "$${path%%/*}" "$${path\#*/}")
|
5 |
874
|
aaronmk
|
topDir = $(word 1,$(pathParts))
|
6 |
|
|
subPath = $(word 2,$(pathParts))
|
7 |
625
|
aaronmk
|
subMake = $(MAKE) $(call subPath,$@) --directory=$(call topDir,$@) \
|
8 |
|
|
--makefile=../input.Makefile
|
9 |
623
|
aaronmk
|
# input.Makefile path is relative to subdir
|
10 |
410
|
aaronmk
|
|
11 |
785
|
aaronmk
|
##### General targets
|
12 |
410
|
aaronmk
|
|
13 |
|
|
all:
|
14 |
|
|
|
15 |
1260
|
aaronmk
|
.SUFFIXES: # turn off built-in suffix rules
|
16 |
|
|
.SECONDARY: # don't automatically delete intermediate files
|
17 |
410
|
aaronmk
|
|
18 |
|
|
_always:
|
19 |
|
|
.PHONY: _always
|
20 |
|
|
|
21 |
623
|
aaronmk
|
subdirs := $(wildcard */)
|
22 |
|
|
|
23 |
410
|
aaronmk
|
define subdirTargets
|
24 |
|
|
$(subdir): _always
|
25 |
|
|
+$$(subMake)
|
26 |
|
|
|
27 |
|
|
$(subdir)%: _always
|
28 |
|
|
+$$(subMake)
|
29 |
|
|
endef
|
30 |
623
|
aaronmk
|
$(foreach subdir,$(subdirs),$(eval $(subdirTargets)))
|
31 |
410
|
aaronmk
|
|
32 |
416
|
aaronmk
|
Makefile: ;
|
33 |
|
|
|
34 |
623
|
aaronmk
|
%: $(addsuffix %,$(subdirs)) _always ;
|
35 |
767
|
aaronmk
|
|
36 |
785
|
aaronmk
|
##### SVN
|
37 |
767
|
aaronmk
|
|
38 |
|
|
%-add: _always
|
39 |
|
|
svn mkdir $*
|
40 |
|
|
$(MAKE) $*/svn_props
|