2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 SUBTARGETS:=clean download prepare compile install update refresh prereq
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)))
15 # Parameters: <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),
21 $(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd)))
22 @+$$(MAKE) -j1 -C $(1)/$(bd) $(target)
25 $(call warn_eval,$(1)/$(bd),l,T,$(1)/$(bd)-$(target): $(1)/$(bd)/$(target))
28 $(foreach target,$(SUBTARGETS),$(call subtarget,$(1),$(target)))
31 # Parameters: <subdir> <name> <target>
33 $(1)/stamp-$(3):=$(STAGING_DIR)/stampfiles/.$(2)_$(3)
34 $(call rdep,$(1),$$($(1)/stamp-$(3)),)
38 @mkdir -p $$$$(dirname $$($(1)/stamp-$(3)))
39 @touch $$($(1)/stamp-$(3))
40 .PRECIOUS: $$($(1)/stamp-$(3)) # work around a make bug
42 $(1)//clean:=$(1)/stamp-$(3)/clean
43 $(1)/stamp-$(3)/clean: FORCE
44 @rm -f $$($(1)/stamp-$(3))