#
# Main makefile for the host tools
#
-
-curdir:=$(patsubst %/Makefile,%,$(lastword $(MAKEFILE_LIST)))
+curdir:=tools
# subdirectories to descend into
$(curdir)/builddirs := sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage firmware-utils patch-cmdline $(if $(CONFIG_CCACHE),ccache)
$(curdir)/squashfs/compile := $(curdir)/lzma/install
# preparatory work
+define copy_include
$(STAGING_DIR)/include-host/.done:
- @mkdir -p $$(dirname $@)
- @cp $(curdir)/include/*.h $$(dirname $@)/
- @touch $@
+ @mkdir -p $$$$(dirname $$@)
+ @cp $(1)/include/*.h $$$$(dirname $$@)/
+ @touch $$@
+$(curdir)//prepare = $(STAGING_DIR)/include-host/.done
+$(curdir)//compile = $(STAGING_DIR)/include-host/.done
+endef
+$(eval $(call copy_include,$(curdir)))
# prerequisites for the individual targets
-$(curdir)/ := .config
-$(curdir)//prepare = $(STAGING_DIR)/include-host/.done
-$(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)))