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
.DELETE_ON_ERROR: # delete target if recipe fails
18

    
19
_always:
20
.PHONY: _always
21

    
22
subdirs := $(wildcard */)
23

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

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

    
33
Makefile: ;
34

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

    
37
##### SVN
38

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