• Masahiro Yamada's avatar
    kbuild: do not create orphan built-in.a or obj-y objects · 56d58936
    Masahiro Yamada authored
    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: default avatarMasahiro Yamada <masahiroy@kernel.org>
    56d58936
Makefile.lib 14.7 KB