Revision 402
Added by Aaron Marcuse-Kubitza about 13 years ago
Makefile | ||
---|---|---|
1 | 1 |
# Make |
2 | 2 |
SHELL := /bin/bash |
3 |
subMake = $(if $(wildcard $(@D)/Makefile*),$(MAKE) $(@F) --directory=$(@D),)
|
|
3 |
subMake = $(MAKE) $(@F) --directory=$(@D)
|
|
4 | 4 |
|
5 | 5 |
# OS |
6 | 6 |
os := $(shell uname) |
... | ... | |
43 | 43 |
|
44 | 44 |
clean: _always $(addsuffix clean,$(subdirs)) |
45 | 45 |
|
46 |
$(foreach subdir,$(wildcard */),$(eval $(subdir)%: _always; +$$(subMake))) |
|
46 |
define subdirTargets |
|
47 |
$(subdir): _always |
|
48 |
+$$(subMake) |
|
47 | 49 |
|
48 |
*/: _always |
|
49 |
+$(subMake) |
|
50 |
$(subdir)%: _always |
|
51 |
+$$(subMake) |
|
52 |
endef |
|
53 |
$(foreach subdir,$(wildcard */),$(eval $(subdirTargets))) |
|
50 | 54 |
|
51 | 55 |
##### |
52 | 56 |
|
... | ... | |
184 | 188 |
|
185 | 189 |
##### |
186 | 190 |
|
187 |
inputs-%: $(addsuffix %,$(shell echo inputs/*/)) _always ;
|
|
191 |
inputs-%: $(addsuffix %,$(dir $(shell echo inputs/*/Makefile))) _always ;
|
|
188 | 192 |
|
189 | 193 |
inputs: _always inputs-install |
190 | 194 |
|
Also available in: Unified diff
Makefile: Generate error when trying to run subMake on a directory with no Makefile