X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/f889a9c250e02ea2b4cb8cc8a6641603d89f23f5..04ad31e55867caab690b8337b4808ce15d95f0a4:/tools/Makefile diff --git a/tools/Makefile b/tools/Makefile index 8c5f699d3..513ecccb5 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -32,15 +32,26 @@ endif $(STAMP): $(TOPDIR)/.config mkdir -p $(shell dirname $@) touch $@ - -$(STAGING_DIR)/include-host: - @mkdir -p $@ - @$(CP) ./include/*.h $@/ + +TOOL_HOST_INCLUDES:=$(patsubst ./include/%.h,$(STAGING_DIR)/include-host/%.h,$(wildcard ./include/*.h)) +$(TOOL_HOST_INCLUDES): $(STAGING_DIR)/include-host/%.h: ./include/%.h + @mkdir -p $(STAGING_DIR)/include-host + $(CP) $< $@ $(TOOL_BUILD_DIR): @mkdir -p $@ -$(eval $(call default_subtargets,$(STAGING_DIR)/include-host $(TOOL_BUILD_DIR))) +%-prereq %-download %-clean: FORCE + $(MAKE) -C $* $(patsubst $*-%,%,$@) + +%-prepare: $(TOOL_HOST_INCLUDES) $(TOOL_BUILD_DIR) FORCE + $(MAKE) -C $* $(patsubst $*-%,%,$@) + +%-compile: %-prepare FORCE + $(MAKE) -C $* $(patsubst $*-%,%,$@) + +%-install: %-compile FORCE + $(MAKE) -C $* $(patsubst $*-%,%,$@) ifeq ($(MAKECMDGOALS),install-targets) MAKEFLAGS:=$(MAKEFLAGS) -j$(CONFIG_JLEVEL)