kbuild: handle dtb-y and CONFIG_OF_ALL_DTBS natively in Makefile.lib
Masahiro Yamada authored

If CONFIG_OF_ALL_DTBS is enabled, "make ARCH=arm64 dtbs" compiles each
DTB twice; one from arch/arm64/boot/dts/*/Makefile and the other from
the dtb-$(CONFIG_OF_ALL_DTBS) line in arch/arm64/boot/dts/Makefile.
It could be a race problem when building DTBS in parallel.

Another minor issue is CONFIG_OF_ALL_DTBS covers only *.dts in vendor
sub-directories, so this broke when Broadcom added one more hierarchy
in arch/arm64/boot/dts/broadcom/<soc>/.

One idea to fix the issues in a clean way is to move DTB handling
to Kbuild core scripts.  Makefile.dtbinst already recognizes dtb-y
natively, so it should not hurt to do so.

Add $(dtb-y) to extra-y, and $(dtb-) as well if CONFIG_OF_ALL_DTBS is
enabled.  All clutter things in Makefiles go away.

As a bonus clean-up, I also removed dts-dirs.  Just use subdir-y
directly to traverse sub-directories.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
[robh: corrected BUILTIN_DTB to CONFIG_BUILTIN_DTB]
Signed-off-by: default avatarRob Herring <robh@kernel.org>
7e7962dd
Name Last commit Last update
Documentation kbuild: clean up *.dtb and *.dtb.S patterns from top-level Makefile
arch kbuild: handle dtb-y and CONFIG_OF_ALL_DTBS natively in Makefile.lib
block block: directly insert blk-mq request from blk_insert_cloned_request()
certs modsign: add markers to endif-statements in certs/Makefile
crypto crypto: af_alg - get_page upon reassignment to TX SGL
drivers .gitignore: move *.dtb and *.dtb.S patterns to the top-level .gitignore
firmware firmware: Restore support for built-in firmware
fs Merge tag 'for-linus-4.14-ofs2' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux
include Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
init Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
ipc Merge branch 'work.ipc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
kernel Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
lib Merge branch 'zstd-minimal' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs
mm Merge branch 'work.read_write' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
samples Merge tag 'media/v4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
scripts kbuild: handle dtb-y and CONFIG_OF_ALL_DTBS natively in Makefile.lib
security Merge branch 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
sound vfs: constify path argument to kernel_read_file_from_path
tools Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
usr ramfs: clarify help text that compression applies to ramfs as well as legacy ramdisk.
virt kvm: Serialize wq active checks in kvm_vcpu_wake_up()
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.