diff options
author | Masahiro Yamada <yamada.m@jp.panasonic.com> | 2014-07-16 03:12:22 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2014-07-16 11:15:26 -0400 |
commit | 663935593915ad8dc43d10f58ef5eeefc77ef8c4 (patch) | |
tree | 8e3589b7e4d44226347939a15bf150652aed2cca /scripts | |
parent | 62e2210798ed38928ab24841e8b4878a2c170af8 (diff) |
kbuild: clean up scripts/Makefile.host
The directory creation can be more simplified by two levels.
[1] Drop $(dir ...)
$(dir $(f)) always returns non-empty string.
So, $(if $(dir $(f)),$(dir $(f)) is equivalent to $(dir $(f)).
[2] Unroll $(foreach ...) loop
$(dir ...) can take one or more arguments and returns a list of
directories of them.
$(foreach f, $(progs), $(dir $(f))) can be unrolled as $(dir $(progs)).
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.host | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 1c2e57000f5a..bb6a11f4f193 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host | |||
@@ -44,15 +44,11 @@ host-cxxobjs := $(sort $(foreach m,$(host-cxxmulti),$($(m)-cxxobjs))) | |||
44 | 44 | ||
45 | # output directory for programs/.o files | 45 | # output directory for programs/.o files |
46 | # hostprogs-y := tools/build may have been specified. Retrieve directory | 46 | # hostprogs-y := tools/build may have been specified. Retrieve directory |
47 | host-objdirs := $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f)))) | 47 | host-objdirs := $(dir $(__hostprogs)) |
48 | # directory of .o files from prog-objs notation | 48 | # directory of .o files from prog-objs notation |
49 | host-objdirs += $(foreach f,$(host-cmulti), \ | 49 | host-objdirs += $(dir $(foreach f,$(host-cmulti), $($(f)-objs))) |
50 | $(foreach m,$($(f)-objs), \ | ||
51 | $(if $(dir $(m)),$(dir $(m))))) | ||
52 | # directory of .o files from prog-cxxobjs notation | 50 | # directory of .o files from prog-cxxobjs notation |
53 | host-objdirs += $(foreach f,$(host-cxxmulti), \ | 51 | host-objdirs += $(dir $(foreach f,$(host-cxxmulti), $($(f)-cxxobjs))) |
54 | $(foreach m,$($(f)-cxxobjs), \ | ||
55 | $(if $(dir $(m)),$(dir $(m))))) | ||
56 | 52 | ||
57 | host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs)))) | 53 | host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs)))) |
58 | 54 | ||