diff options
author | Masahiro Yamada <yamada.m@jp.panasonic.com> | 2014-07-16 16:12:20 +0900 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2014-07-16 17:15:25 +0200 |
commit | edb950c17de09ed04be1ed2c451ba207e3b0a29b (patch) | |
tree | e0deeb4d35a78c8949e82e14b5997c248e832608 /scripts | |
parent | d8d9efe22709b62eb29fa9f4eb61fd882fc2b2c4 (diff) | |
download | talos-obmc-linux-edb950c17de09ed04be1ed2c451ba207e3b0a29b.tar.gz talos-obmc-linux-edb950c17de09ed04be1ed2c451ba207e3b0a29b.zip |
kbuild: fix a bug of C++ host program handling
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 we have a Makefile like this:
hostprogs-y := foo
foo-cxxobjs := bar.o
In this case, foo is treated as host-csingle
and Kbuild tries to search non-existing foo.c source.
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 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 395a2403593f..bf44e7988bf4 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),\ |