diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2019-12-18 17:04:28 +0100 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2020-01-06 18:18:38 +0100 |
commit | 56d5893615727bce4a8769c6b22340e20f9a3c33 (patch) | |
tree | 83fbc8a94b2bdbdc7c1c873454db396cbea3f90f /scripts/Makefile.build | |
parent | kbuild: rename header-test- to no-header-test in usr/include/Makefile (diff) | |
download | linux-56d5893615727bce4a8769c6b22340e20f9a3c33.tar.xz linux-56d5893615727bce4a8769c6b22340e20f9a3c33.zip |
kbuild: do not create orphan built-in.a or obj-y objects
Both 'obj-y += foo/' and 'obj-m += foo/' request Kbuild to visit the
sub-directory foo/, but the difference is that only the former combines
foo/built-in.a into the built-in.a of the current directory because
everything in sub-directories visited by obj-m is supposed to be modular.
So, it makes sense to create built-in.a only if that sub-directory is
reachable by the chain of obj-y. Otherwise, built-in.a will not be
linked into vmlinux anyway. For the same reason, it is pointless to
compile obj-y objects in the directory visited by obj-m.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r-- | scripts/Makefile.build | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index b734ac8a654e..e46b4ee9a120 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -66,7 +66,7 @@ lib-target := $(obj)/lib.a real-obj-y += $(obj)/lib-ksyms.o endif -ifneq ($(strip $(real-obj-y) $(need-builtin)),) +ifdef need-builtin builtin-target := $(obj)/built-in.a endif |