X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/506d2a0161e0a82f842f2473f66aa22c9985ad9b..fc91d8b69ab8294956ce45efcbfd7daac6a8603b:/tools/Makefile diff --git a/tools/Makefile b/tools/Makefile index 2c093c0aa..d1ca6508f 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -6,8 +6,6 @@ # # Main makefile for the host tools # - -file:=${lastword ${MAKEFILE_LIST}} curdir:=tools # subdirectories to descend into @@ -17,19 +15,23 @@ $(curdir)/builddirs := sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkim $(curdir)/squashfs/compile := $(curdir)/lzma/install # preparatory work -define copy_include -$(STAGING_DIR)/include-host/.done: - @mkdir -p $$$$(dirname $$@) - @cp $(1)/include/*.h $$$$(dirname $$@)/ - @touch $$@ -$(curdir)//prepare = $(STAGING_DIR)/include-host/.done -endef -$(eval $(call copy_include,$(curdir))) +$(STAGING_DIR)/.prepared: $(TMP_DIR)/.build + @for dir in $(STAGING_DIR) $(STAGING_DIR_HOST); do ( \ + set -x; \ + mkdir -p "$$dir"; \ + cd "$$dir"; \ + mkdir -p bin lib include stamp; \ + ); done + mkdir -p $(BUILD_DIR_HOST)/stamp $(BUILD_DIR)/stamp + $(INSTALL_DATA) $(TOPDIR)/tools/include/*.h $(STAGING_DIR_HOST)/include/ + touch $@ + +$(curdir)//prepare = $(STAGING_DIR)/.prepared +$(curdir)//compile = $(STAGING_DIR)/.prepared # prerequisites for the individual targets -$(curdir)/ := .config -$(curdir)//compile = $(1)/prepare +$(curdir)/ := .config prereq $(curdir)//install = $(1)/compile -$(eval $(call stampfile,$(curdir),tools)) +$(eval $(call stampfile,$(curdir),tools,install)) $(eval $(call subdir,$(curdir)))