Project

General

Profile

1 785 aaronmk
##### Vars/functions
2
3 410 aaronmk
# Make
4 625 aaronmk
pathParts = $(shell path="$(1)"; echo "$${path%%/*}" "$${path\#*/}")
5
topDir = $(firstword $(pathParts))
6
subPath = $(lastword $(pathParts))
7
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
.SUFFIXES:
16
17
_always:
18
.PHONY: _always
19
20 623 aaronmk
subdirs := $(wildcard */)
21
22 410 aaronmk
define subdirTargets
23
$(subdir): _always
24
	+$$(subMake)
25
26
$(subdir)%: _always
27
	+$$(subMake)
28
endef
29 623 aaronmk
$(foreach subdir,$(subdirs),$(eval $(subdirTargets)))
30 410 aaronmk
31 416 aaronmk
Makefile: ;
32
33 623 aaronmk
%: $(addsuffix %,$(subdirs)) _always ;
34 767 aaronmk
35 785 aaronmk
##### SVN
36 767 aaronmk
37
%-add: _always
38
	svn mkdir $*
39
	$(MAKE) $*/svn_props