|
nbd
|
1 |
# |
|
|
2 |
# Copyright (C) 2007 OpenWrt.org |
|
|
3 |
# |
|
|
4 |
# This is free software, licensed under the GNU General Public License v2. |
|
|
5 |
# See /LICENSE for more information. |
|
nbd
|
6 |
# |
|
|
7 |
|
|
|
8 |
SUBTARGETS:=clean download prepare compile install update refresh prereq |
|
|
9 |
|
|
nbd
|
10 |
define subtarget |
|
nbd
|
11 |
$(call warn_eval,$(1),t,T,$(1)/$(2): $($(1)/) $(foreach bd,$(if $($(1)/builddirs-$(2)),$(filter-out .,$($(1)/builddirs-$(2))),$($(1)/builddirs)),$(1)/$(bd)/$(2))) |
|
nbd
|
12 |
|
|
|
13 |
endef |
|
|
14 |
|
|
nbd
|
15 |
# Parameters: <subdir> |
|
|
16 |
define subdir |
|
|
17 |
$(call warn,$(1),d,D $(1)) |
|
|
18 |
$(foreach bd,$($(1)/builddirs), |
|
|
19 |
$(call warn,$(1),d,BD $(1)/$(bd)) |
|
|
20 |
$(foreach target,$(SUBTARGETS), |
|
nbd
|
21 |
$(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd))) |
|
nbd
|
22 |
@+$$(MAKE) -j1 -C $(1)/$(bd) $(target) |
|
nbd
|
23 |
|
|
|
24 |
# legacy targets |
|
|
25 |
$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(bd)-$(target): $(1)/$(bd)/$(target)) |
|
|
26 |
) |
|
|
27 |
) |
|
nbd
|
28 |
$(foreach target,$(SUBTARGETS),$(call subtarget,$(1),$(target))) |
|
nbd
|
29 |
endef |
|
|
30 |
|
|
nbd
|
31 |
# Parameters: <subdir> <name> <target> |
|
nbd
|
32 |
define stampfile |
|
nbd
|
33 |
$(1)/stamp-$(3):=$(STAGING_DIR)/stampfiles/.$(2)_$(3) |
|
|
34 |
$(call rdep,$(1),$$($(1)/stamp-$(3)),) |
|
|
35 |
|
|
|
36 |
$$($(1)/stamp-$(3)): |
|
|
37 |
@+$(MAKE) $(1)/$(3) |
|
|
38 |
@mkdir -p $$$$(dirname $$($(1)/stamp-$(3))) |
|
|
39 |
@touch $$($(1)/stamp-$(3)) |
|
|
40 |
.PRECIOUS: $$($(1)/stamp-$(3)) # work around a make bug |
|
|
41 |
|
|
|
42 |
$(1)//clean:=$(1)/stamp-$(3)/clean |
|
|
43 |
$(1)/stamp-$(3)/clean: FORCE |
|
|
44 |
@rm -f $$($(1)/stamp-$(3)) |
|
nbd
|
45 |
|
|
|
46 |
endef |
|
|
47 |
|