* [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host
@ 2014-06-06 1:30 Masahiro Yamada
2014-06-06 1:30 ` [PATCH 1/5] kbuild: fix a typo in scripts/Makefile.host Masahiro Yamada
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Masahiro Yamada @ 2014-06-06 1:30 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada
Masahiro Yamada (5):
kbuild: fix a typo in scripts/Makefile.host
kbuild: fix a bug of C++ host program handling
kbuild: clean up scripts/Makefile.host
kbuild: clean-up and bug fix of scripts/Makefile.host
kbuild: create directory of .o files from shlib-objs notation
scripts/Makefile.host | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/5] kbuild: fix a typo in scripts/Makefile.host
2014-06-06 1:30 [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Masahiro Yamada
@ 2014-06-06 1:30 ` Masahiro Yamada
2014-06-06 1:31 ` [PATCH 2/5] kbuild: fix a bug of C++ host program handling Masahiro Yamada
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2014-06-06 1:30 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada
---
scripts/Makefile.host | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 6689364..395a240 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -44,7 +44,7 @@ host-cmulti := $(foreach m,$(__hostprogs),\
host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs)))
# C++ code
-# C++ executables compiled from at least on .cc file
+# C++ executables compiled from at least one .cc file
# and zero or more .c files
host-cxxmulti := $(foreach m,$(__hostprogs),$(if $($(m)-cxxobjs),$(m)))
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5] kbuild: fix a bug of C++ host program handling
2014-06-06 1:30 [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Masahiro Yamada
2014-06-06 1:30 ` [PATCH 1/5] kbuild: fix a typo in scripts/Makefile.host Masahiro Yamada
@ 2014-06-06 1:31 ` Masahiro Yamada
2014-06-06 1:31 ` [PATCH 3/5] kbuild: clean up scripts/Makefile.host Masahiro Yamada
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2014-06-06 1:31 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada
The comment claims:
C++ executables compiled from at least one .cc file
and zero or more .c files
But C++ executables with zero .c file fail in build.
For example, assume Makefile is like this:
hostprogs-y := foo
foo-cxxobjs := bar.o
In this case, foo is treated as host-csingle
and Kbuild searches foo.c source.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
scripts/Makefile.host | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 395a240..2632adf 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -34,7 +34,8 @@ __hostprogs := $(sort $(hostprogs-y) $(hostprogs-m))
# C code
# Executables compiled from a single .c file
-host-csingle := $(foreach m,$(__hostprogs),$(if $($(m)-objs),,$(m)))
+host-csingle := $(foreach m,$(__hostprogs), \
+ $(if $($(m)-objs)$($(m)-cxxobjs),,$(m)))
# C executables linked based on several .o files
host-cmulti := $(foreach m,$(__hostprogs),\
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] kbuild: clean up scripts/Makefile.host
2014-06-06 1:30 [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Masahiro Yamada
2014-06-06 1:30 ` [PATCH 1/5] kbuild: fix a typo in scripts/Makefile.host Masahiro Yamada
2014-06-06 1:31 ` [PATCH 2/5] kbuild: fix a bug of C++ host program handling Masahiro Yamada
@ 2014-06-06 1:31 ` Masahiro Yamada
2014-06-06 1:31 ` [PATCH 4/5] kbuild: clean-up and bug fix of scripts/Makefile.host Masahiro Yamada
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2014-06-06 1:31 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada
$(dir $(f)) always returns non-empty string.
So, $(if $(dir $(f)),$(dir $(f)) is equivalent to $(dir $(f)).
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
scripts/Makefile.host | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index 2632adf..e6abc2e 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -63,15 +63,15 @@ host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
# output directory for programs/.o files
# hostprogs-y := tools/build may have been specified. Retrieve directory
-host-objdirs := $(foreach f,$(__hostprogs), $(if $(dir $(f)),$(dir $(f))))
+host-objdirs := $(foreach f,$(__hostprogs), $(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)))))
+ $(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)))))
+ $(dir $(m))))
host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs))))
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/5] kbuild: clean-up and bug fix of scripts/Makefile.host
2014-06-06 1:30 [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Masahiro Yamada
` (2 preceding siblings ...)
2014-06-06 1:31 ` [PATCH 3/5] kbuild: clean up scripts/Makefile.host Masahiro Yamada
@ 2014-06-06 1:31 ` Masahiro Yamada
2014-06-06 1:31 ` [PATCH 5/5] kbuild: create directory of .o files from shlib-objs notation Masahiro Yamada
2014-06-06 13:25 ` [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Sam Ravnborg
5 siblings, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2014-06-06 1:31 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada
Assume we have a Makefile like this:
hostprogs-y := foo
foo-cxxobjs := bar/baz.o
foo-objs := qux/quux.o
In this case, Kbuild creates bar/ directory,
but fails to create qux/ directory.
This commit re-writes directory creation more simply,
fixing that bug.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
scripts/Makefile.host | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index e6abc2e..b0e1a64 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -64,13 +64,9 @@ host-cshobjs := $(sort $(foreach m,$(host-cshlib),$($(m:.so=-objs))))
# output directory for programs/.o files
# hostprogs-y := tools/build may have been specified. Retrieve directory
host-objdirs := $(foreach f,$(__hostprogs), $(dir $(f)))
-# directory of .o files from prog-objs notation
-host-objdirs += $(foreach f,$(host-cmulti), \
- $(foreach m,$($(f)-objs), \
- $(dir $(m))))
-# directory of .o files from prog-cxxobjs notation
-host-objdirs += $(foreach f,$(host-cxxmulti), \
- $(foreach m,$($(f)-cxxobjs), \
+# directory of .o files from prog-objs or prog-cxxobjs notation
+host-objdirs += $(foreach f,$(__hostprogs), \
+ $(foreach m,$($(f)-objs) $($(f)-cxxobjs), \
$(dir $(m))))
host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs))))
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] kbuild: create directory of .o files from shlib-objs notation
2014-06-06 1:30 [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Masahiro Yamada
` (3 preceding siblings ...)
2014-06-06 1:31 ` [PATCH 4/5] kbuild: clean-up and bug fix of scripts/Makefile.host Masahiro Yamada
@ 2014-06-06 1:31 ` Masahiro Yamada
2014-06-06 13:25 ` [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Sam Ravnborg
5 siblings, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2014-06-06 1:31 UTC (permalink / raw)
To: linux-kbuild; +Cc: Masahiro Yamada
Assume we have a Makefile like this:
hostprogs-y := foo
foo-objs := bar.o baz.so
baz-objs := qux/quux.o
In this case, Kbuild fails to create qux/ directory.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
scripts/Makefile.host | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/Makefile.host b/scripts/Makefile.host
index b0e1a64..4bb237b 100644
--- a/scripts/Makefile.host
+++ b/scripts/Makefile.host
@@ -68,6 +68,8 @@ host-objdirs := $(foreach f,$(__hostprogs), $(dir $(f)))
host-objdirs += $(foreach f,$(__hostprogs), \
$(foreach m,$($(f)-objs) $($(f)-cxxobjs), \
$(dir $(m))))
+# directory of .o files from shlib-objs notation
+host-objdirs += $(foreach m,$(host-cshobjs), $(dir $(m)))
host-objdirs := $(strip $(sort $(filter-out ./,$(host-objdirs))))
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host
2014-06-06 1:30 [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Masahiro Yamada
` (4 preceding siblings ...)
2014-06-06 1:31 ` [PATCH 5/5] kbuild: create directory of .o files from shlib-objs notation Masahiro Yamada
@ 2014-06-06 13:25 ` Sam Ravnborg
2014-06-09 4:29 ` Masahiro Yamada
5 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2014-06-06 13:25 UTC (permalink / raw)
To: Masahiro Yamada; +Cc: linux-kbuild
On Fri, Jun 06, 2014 at 10:30:58AM +0900, Masahiro Yamada wrote:
>
> Masahiro Yamada (5):
> kbuild: fix a typo in scripts/Makefile.host
> kbuild: fix a bug of C++ host program handling
> kbuild: clean up scripts/Makefile.host
> kbuild: clean-up and bug fix of scripts/Makefile.host
> kbuild: create directory of .o files from shlib-objs notation
All bug-fixes looks good.
But rahter than fixing this please consider if
we can drop the features.
The shlib stuff is for example no longer used and should be deleted.
Do we have any host progrs where we need to create directories as
is fixed in these patches?
If not then rip it out too.
Anthing that can make all this simpler is good.
Sam
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host
2014-06-06 13:25 ` [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Sam Ravnborg
@ 2014-06-09 4:29 ` Masahiro Yamada
0 siblings, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2014-06-09 4:29 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kbuild
Hi Sam,
On Fri, 6 Jun 2014 15:25:54 +0200
Sam Ravnborg <sam@ravnborg.org> wrote:
> On Fri, Jun 06, 2014 at 10:30:58AM +0900, Masahiro Yamada wrote:
> >
> > Masahiro Yamada (5):
> > kbuild: fix a typo in scripts/Makefile.host
> > kbuild: fix a bug of C++ host program handling
> > kbuild: clean up scripts/Makefile.host
> > kbuild: clean-up and bug fix of scripts/Makefile.host
> > kbuild: create directory of .o files from shlib-objs notation
>
> All bug-fixes looks good.
> But rahter than fixing this please consider if
> we can drop the features.
OK.
I dropped shared object feature and posted v2.
> The shlib stuff is for example no longer used and should be deleted.
> Do we have any host progrs where we need to create directories as
> is fixed in these patches?
> If not then rip it out too.
I hesitate to remove directory creation feature because:
[1] Kbuild is already used in some other projects.
Makefile.build, Makefile.lib, Makefile.host etc.
are really useful build scripts.
So, I think they should be kept generic enough
for the maximum code re-use in other projects.
It is true that we no longer have hostprogs in Kernel where
we need to create directories.
But there might be necessity in other projects.
(At least, U-boot's hostprogs-y is depending on this feature.)
[2] For consistency.
obj-y supports automatic directory creation.
It is symmetrical that we support it for hostprogs-y.
In v2, I simplified Makefile.host much more,
so please let me keep it.
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-06-09 4:30 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06 1:30 [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Masahiro Yamada
2014-06-06 1:30 ` [PATCH 1/5] kbuild: fix a typo in scripts/Makefile.host Masahiro Yamada
2014-06-06 1:31 ` [PATCH 2/5] kbuild: fix a bug of C++ host program handling Masahiro Yamada
2014-06-06 1:31 ` [PATCH 3/5] kbuild: clean up scripts/Makefile.host Masahiro Yamada
2014-06-06 1:31 ` [PATCH 4/5] kbuild: clean-up and bug fix of scripts/Makefile.host Masahiro Yamada
2014-06-06 1:31 ` [PATCH 5/5] kbuild: create directory of .o files from shlib-objs notation Masahiro Yamada
2014-06-06 13:25 ` [PATCH 0/5] kbuild: Clean-up and bug fixes of scripts/Makefile.host Sam Ravnborg
2014-06-09 4:29 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox