From: Sam Ravnborg Date: Mon, 7 Aug 2006 19:55:33 +0000 (+0200) Subject: kbuild: create output directory for hostprogs with O=.. build X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7b5b82038184d19f611be166a70fd11824109a71;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git kbuild: create output directory for hostprogs with O=.. build hostprogs-y only supported creating output directory for the final program. Extend this to also cover the situation where a .o file (used when host program is made from compositie objects) is locate in another directory. First user of this is the built-in lxdialog that. Signed-off-by: Sam Ravnborg --- diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 060f4c563a5c..d74dd0fc69ca 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -32,11 +32,6 @@ __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) -# hostprogs-y := tools/build may have been specified. Retreive directory -host-objdirs := $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f)))) -host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs)))) - - # C code # Executables compiled from a single .c file host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m))) @@ -65,6 +60,21 @@ host-cobjs := $(filter-out %.so,$(host-cobjs)) #Object (.o) files used by the shared libaries host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs)))) +# output directory for programs/.o files +# hostprogs-y := tools/build may have been specified. Retreive directory +host-objdirs := $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f)))) +# directory of .o files from prog-objs notation +host-objdirs += $(foreach f,$(host-cmulti), \ + $(foreach m,$($(f)-objs), \ + $(if $(dir $(m)),$(dir $(m))))) +# directory of .o files from prog-cxxobjs notation +host-objdirs += $(foreach f,$(host-cxxmulti), \ + $(foreach m,$($(f)-cxxobjs), \ + $(if $(dir $(m)),$(dir $(m))))) + +host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs)))) + + __hostprogs := $(addprefix $(obj)/,$(__hostprogs)) host-csingle := $(addprefix $(obj)/,$(host-csingle)) host-cmulti := $(addprefix $(obj)/,$(host-cmulti)) @@ -75,6 +85,7 @@ host-cshlib := $(addprefix $(obj)/,$(host-cshlib)) host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs)) host-objdirs := $(addprefix $(obj)/,$(host-objdirs)) +$(warning host-objdirs=$(host-objdirs)) obj-dirs += $(host-objdirs) #####