]> git.baikalelectronics.ru Git - kernel.git/commit
kbuild: do not create orphan built-in.a or obj-y objects
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 18 Dec 2019 16:04:28 +0000 (01:04 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 6 Jan 2020 17:18:38 +0000 (02:18 +0900)
commit7e2ebbf623fbf06bf4121265ccf8a8c17bdd757e
tree83fbc8a94b2bdbdc7c1c873454db396cbea3f90f
parent60e6a6249990155055f26a19afc0c950d62472a7
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>
scripts/Makefile.build
scripts/Makefile.lib