kbuild: add objectify
authorSam Ravnborg <sam@mars.ravnborg.org>
Sat, 10 Sep 2005 19:02:11 +0000 (21:02 +0200)
committerSam Ravnborg <sam@mars.ravnborg.org>
Sat, 10 Sep 2005 19:02:11 +0000 (21:02 +0200)
Use foo := $(call objectify, $(foo)) to prefix $(foo) with $(obj)/ unless
$(foo) is an absolute path.
For now no in-tree users - soon to come.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
scripts/Kbuild.include

index 9087273abf91665e078ea43884cbea00d8e3ea07..db3c708e546b81cfac87bd206998d87848252a70 100644 (file)
@@ -49,6 +49,9 @@ build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
 cmd = @$(if $($(quiet)cmd_$(1)),\
       echo '  $(subst ','\'',$($(quiet)cmd_$(1)))' &&) $(cmd_$(1))
 
+# Add $(obj)/ for paths that is not absolute
+objectify = $(foreach o,$(1),$(if $(filter /%,$(o)),$(o),$(obj)/$(o)))
+
 ###
 # if_changed      - execute command if any prerequisite is newer than 
 #                   target, or command line has changed