the default_subtargets template was a bad idea, since different makefiles require different types of dependencies for subtargets. nuke it...

SVN-Revision: 7003
This commit is contained in:
Felix Fietkau 2007-04-18 17:35:46 +00:00
parent 532654e3c6
commit 1099e2d679
4 changed files with 23 additions and 25 deletions

View File

@ -131,27 +131,6 @@ $(call shvar,$(1))=$$(call $(1))
export $(call shvar,$(1)) export $(call shvar,$(1))
endef endef
# Default targets for subdirectory calls
# Parameters:
# 1: dependencies for the prepare step
define default_subtargets
%-download: FORCE
$$(MAKE) -C $$(patsubst %-download,%,$$@) download
%-prepare: $(1) FORCE
$$(MAKE) -C $$(patsubst %-prepare,%,$$@) prepare
%-compile: %-prepare
$$(MAKE) -C $$(patsubst %-compile,%,$$@) compile
%-install:
$$(MAKE) -C $$(patsubst %-install,%,$$@) install
%-clean: FORCE
@$$(MAKE) -C $$(patsubst %-clean,%,$$@) clean
endef
all: all:
FORCE: ; FORCE: ;
.PHONY: FORCE .PHONY: FORCE

View File

@ -51,4 +51,5 @@ image_install: image_compile
imagebuilder_install: image_install imagebuilder_install: image_install
$(MAKE) -C imagebuilder install $(MAKE) -C imagebuilder install
$(eval $(call default_subtargets,)) %-prereq %-prepare %-download %-clean %-compile %-install: FORCE
$(MAKE) -C $* $(patsubst $*-%,%,$@)

View File

@ -15,6 +15,7 @@ ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
endif endif
TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y)) TARGETS_DOWNLOAD:=$(patsubst %,%-download,$(TARGETS-y))
TARGETS_PREPARE:=$(patsubst %,%-prepare,$(TARGETS-y))
TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y)) TARGETS_COMPILE:=$(patsubst %,%-compile,$(TARGETS-y))
TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y)) TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS-y))
TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y)) TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS-y))
@ -49,5 +50,14 @@ $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME):
$(TOOLCHAIN_BUILD_DIR): $(TOOLCHAIN_BUILD_DIR):
@mkdir -p $@ @mkdir -p $@
$(eval $(call default_subtargets,$(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR))) %-prereq %-download %-clean: FORCE
$(MAKE) -C $* $(patsubst $*-%,%,$@)
%-prepare: $(STAGING_DIR)/$(REAL_GNU_TARGET_NAME) $(TOOLCHAIN_BUILD_DIR)
$(MAKE) -C $* $(patsubst $*-%,%,$@)
%-compile: %-prepare FORCE
$(MAKE) -C $* $(patsubst $*-%,%,$@)
%-install: %-compile FORCE
$(MAKE) -C $* $(patsubst $*-%,%,$@)

View File

@ -40,9 +40,17 @@ $(STAGING_DIR)/include-host:
$(TOOL_BUILD_DIR): $(TOOL_BUILD_DIR):
@mkdir -p $@ @mkdir -p $@
$(TARGETS_COMPILE) $(TARGETS_INSTALL): $(STAGING_DIR)/include-host $(TOOL_BUILD_DIR) %-prereq %-download %-clean: FORCE
$(MAKE) -C $* $(patsubst $*-%,%,$@)
$(eval $(call default_subtargets,)) %-prepare: $(STAGING_DIR)/include-host $(TOOL_BUILD_DIR) FORCE
$(MAKE) -C $* $(patsubst $*-%,%,$@)
%-compile: %-prepare FORCE
$(MAKE) -C $* $(patsubst $*-%,%,$@)
%-install: %-compile FORCE
$(MAKE) -C $* $(patsubst $*-%,%,$@)
ifeq ($(MAKECMDGOALS),install-targets) ifeq ($(MAKECMDGOALS),install-targets)
MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL) MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)