From: Felix Fietkau Date: Sun, 21 Oct 2007 07:18:10 +0000 (+0000) Subject: make aliases for package targets if the package directories are in further subdirecto... X-Git-Tag: reboot~27769 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ac40a80f35074b43039e25f8e9d8017cab1a3263;p=openwrt%2Fstaging%2Fnoltari.git make aliases for package targets if the package directories are in further subdirectories example: if there is a package/libs/foo/compile, then package/foo/compile will be an alias for it SVN-Revision: 9384 --- diff --git a/include/subdir.mk b/include/subdir.mk index 68afcc48a2..d62df7efa7 100644 --- a/include/subdir.mk +++ b/include/subdir.mk @@ -17,6 +17,10 @@ define subtarget endef + +lastdir=$(word $(words $(subst /, ,$(1))),$(subst /, ,$(1))) +diralias=$(if $(findstring $(1),$(call lastdir,$(1))),,$(call lastdir,$(1))) + # Parameters: define subdir $(call warn,$(1),d,D $(1)) @@ -29,6 +33,8 @@ define subdir # legacy targets $(call warn_eval,$(1)/$(bd),l,T,$(1)/$(bd)-$(target): $(1)/$(bd)/$(target)) + # aliases + $(if $(call diralias,$(bd)),$(call warn_eval,$(1)/$(bd),l,T,$(1)/$(call diralias,$(bd))/$(target): $(1)/$(bd)/$(target))) ) ) $(foreach target,$(SUBTARGETS),$(call subtarget,$(1),$(target)))