X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=tools%2FMakefile;h=ea4ce7081aff8aa99fe34db632876e6bf984e3a0;hb=d67567dc2a562eb02459ba68260344d97db4b476;hp=49b30be44b01c0e8c5c7d1050ef52b613132ea09;hpb=69ac130ada34e7792c1b86d82949123d7573a7d9;p=openwrt.git diff --git a/tools/Makefile b/tools/Makefile index 49b30be44b..ea4ce7081a 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -7,7 +7,8 @@ # Main makefile for the host tools # -curdir:=$(patsubst %/Makefile,%,$(lastword $(MAKEFILE_LIST))) +file:=${lastword ${MAKEFILE_LIST}} +curdir:=$(patsubst %/Makefile,%,${file}) # subdirectories to descend into $(curdir)/builddirs := sed sstrip ipkg-utils ext2fs squashfs mtd-utils lzma mkimage firmware-utils patch-cmdline $(if $(CONFIG_CCACHE),ccache) @@ -16,14 +17,17 @@ $(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 $(curdir)/include/*.h $$(dirname $@)/ - @touch $@ + @mkdir -p $$$$(dirname $$@) + @cp $(1)/include/*.h $$$$(dirname $$@)/ + @touch $$@ +$(curdir)//prepare = $(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)//install = $(1)/compile