aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2006-06-01 21:28:50 -0400
committerSam Ravnborg <sam@mars.ravnborg.org>2006-06-08 14:18:05 -0400
commit9870a93d3118239fd7732a0f908e05f67b39a294 (patch)
tree64d39f2ebddcac59d0264497012c4449f521035b
parent1def630a6a49dda5bc89dfbd86656293640456f0 (diff)
kbuild: obj-dirs is calculated incorrectly if hostprogs-y is defined
When Makefile.host is included, $(obj-dirs) is subjected to the addprefix operation for the second time. Prefix only needs to be added to the newly added directories, but not to those that came from Makefile.lib. This causes the build system to create unneeded empty directories in the build tree when building in a separate directory. For instance, lib/lib/zlib_inflate is created in the build tree. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--scripts/Makefile.host8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 2d519704b8fd..2b066d12af2c 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -33,8 +33,8 @@
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 35# hostprogs-y := tools/build may have been specified. Retreive directory
36obj-dirs += $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f)))) 36host-objdirs := $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f))))
37obj-dirs := $(strip $(sort $(filter-out ./,$(obj-dirs)))) 37host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs))))
38 38
39 39
40# C code 40# C code
@@ -73,7 +73,9 @@ host-cxxmulti := $(addprefix $(obj)/,$(host-cxxmulti))
73host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs)) 73host-cxxobjs := $(addprefix $(obj)/,$(host-cxxobjs))
74host-cshlib := $(addprefix $(obj)/,$(host-cshlib)) 74host-cshlib := $(addprefix $(obj)/,$(host-cshlib))
75host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs)) 75host-cshobjs := $(addprefix $(obj)/,$(host-cshobjs))
76obj-dirs := $(addprefix $(obj)/,$(obj-dirs)) 76host-objdirs := $(addprefix $(obj)/,$(host-objdirs))
77
78obj-dirs += $(host-objdirs)
77 79
78##### 80#####
79# Handle options to gcc. Support building with separate output directory 81# Handle options to gcc. Support building with separate output directory