diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-08-07 15:55:33 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.ravnborg.org> | 2006-09-25 03:04:42 -0400 |
commit | 7b5b82038184d19f611be166a70fd11824109a71 (patch) | |
tree | 7b15974983018edbe8125d2bb670f2e2b6610091 /scripts | |
parent | 93659af1ce4974b1882668fee06458c0ac9315fd (diff) |
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 <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.host | 21 |
1 files changed, 16 insertions, 5 deletions
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 @@ | |||
32 | 32 | ||
33 | __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) | 33 | __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m)) |
34 | 34 | ||
35 | # hostprogs-y := tools/build may have been specified. Retreive directory | ||
36 | host-objdirs := $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f)))) | ||
37 | host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs)))) | ||
38 | |||
39 | |||
40 | # C code | 35 | # C code |
41 | # Executables compiled from a single .c file | 36 | # Executables compiled from a single .c file |
42 | host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m))) | 37 | host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m))) |
@@ -65,6 +60,21 @@ host-cobjs := $(filter-out %.so,$(host-cobjs)) | |||
65 | #Object (.o) files used by the shared libaries | 60 | #Object (.o) files used by the shared libaries |
66 | host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs)))) | 61 | host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs)))) |
67 | 62 | ||
63 | # output directory for programs/.o files | ||
64 | # hostprogs-y := tools/build may have been specified. Retreive directory | ||
65 | host-objdirs := $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f)))) | ||
66 | # directory of .o files from prog-objs notation | ||
67 | host-objdirs += $(foreach f,$(host-cmulti), \ | ||
68 | $(foreach m,$($(f)-objs), \ | ||
69 | $(if $(dir $(m)),$(dir $(m))))) | ||
70 | # directory of .o files from prog-cxxobjs notation | ||
71 | host-objdirs += $(foreach f,$(host-cxxmulti), \ | ||
72 | $(foreach m,$($(f)-cxxobjs), \ | ||
73 | $(if $(dir $(m)),$(dir $(m))))) | ||
74 | |||
75 | host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs)))) | ||
76 | |||
77 | |||
68 | __hostprogs := $(addprefix $(obj)/,$(__hostprogs)) | 78 | __hostprogs := $(addprefix $(obj)/,$(__hostprogs)) |
69 | host-csingle := $(addprefix $(obj)/,$(host-csingle)) | 79 | host-csingle := $(addprefix $(obj)/,$(host-csingle)) |
70 | host-cmulti := $(addprefix $(obj)/,$(host-cmulti)) | 80 | host-cmulti := $(addprefix $(obj)/,$(host-cmulti)) |
@@ -75,6 +85,7 @@ host-cshlib := $(addprefix $(obj)/,$(host-cshlib)) | |||
75 | host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs)) | 85 | host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs)) |
76 | host-objdirs := $(addprefix $(obj)/,$(host-objdirs)) | 86 | host-objdirs := $(addprefix $(obj)/,$(host-objdirs)) |
77 | 87 | ||
88 | $(warning host-objdirs=$(host-objdirs)) | ||
78 | obj-dirs += $(host-objdirs) | 89 | obj-dirs += $(host-objdirs) |
79 | 90 | ||
80 | ##### | 91 | ##### |