Project

General

Profile

1
##### Vars/functions
2

    
3
# Make
4
pathParts = $(shell path="$(1)"; echo "$${path%%/*}" "$${path\#*/}")
5
topDir = $(word 1,$(pathParts))
6
subPath = $(word 2,$(pathParts))
7
subMake = $(MAKE) $(call subPath,$@) --directory=$(call topDir,$@) \
8
--makefile=../input.Makefile
9
# input.Makefile path is relative to subdir
10

    
11
##### General targets
12

    
13
all:
14

    
15
.SUFFIXES: # turn off built-in suffix rules
16
.SECONDARY: # don't automatically delete intermediate files
17

    
18
_always:
19
.PHONY: _always
20

    
21
subdirs := $(wildcard */)
22

    
23
define subdirTargets
24
$(subdir): _always
25
	+$$(subMake)
26

    
27
$(subdir)%: _always
28
	+$$(subMake)
29
endef
30
$(foreach subdir,$(subdirs),$(eval $(subdirTargets)))
31

    
32
Makefile: ;
33

    
34
%: $(addsuffix %,$(subdirs)) _always ;
35

    
36
##### SVN
37

    
38
%-add: _always
39
	svn mkdir $*
40
	$(MAKE) $*/svn_props
(1-1/2)