diff options
author | Rob Herring <robh@kernel.org> | 2018-01-10 16:19:37 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-10-02 10:23:21 -0400 |
commit | 37c8a5fafa3bb7dcdd51774be353be6cb2912b86 (patch) | |
tree | 4d31eb8716c1b685ff56d09da3e4ba394c018596 /Makefile | |
parent | be7cd2df1d22d29e5f23ce8744fc465cc07cc2bc (diff) |
kbuild: consolidate Devicetree dtb build rules
There is nothing arch specific about building dtb files other than their
location under /arch/*/boot/dts/. Keeping each arch aligned is a pain.
The dependencies and supported targets are all slightly different.
Also, a cross-compiler for each arch is needed, but really the host
compiler preprocessor is perfectly fine for building dtbs. Move the
build rules to a common location and remove the arch specific ones. This
is done in a single step to avoid warnings about overriding rules.
The build dependencies had been a mixture of 'scripts' and/or 'prepare'.
These pull in several dependencies some of which need a target compiler
(specifically devicetable-offsets.h) and aren't needed to build dtbs.
All that is really needed is dtc, so adjust the dependencies to only be
dtc.
This change enables support 'dtbs_install' on some arches which were
missing the target.
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Paul Burton <paul.burton@mips.com>
Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>
Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-kbuild@vger.kernel.org
Cc: linux-snps-arc@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: uclinux-h8-devel@lists.sourceforge.jp
Cc: linux-mips@linux-mips.org
Cc: nios2-dev@lists.rocketboards.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-xtensa@linux-xtensa.org
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 37 |
1 files changed, 36 insertions, 1 deletions
@@ -1071,7 +1071,7 @@ include/config/kernel.release: $(srctree)/Makefile FORCE | |||
1071 | # Carefully list dependencies so we do not try to build scripts twice | 1071 | # Carefully list dependencies so we do not try to build scripts twice |
1072 | # in parallel | 1072 | # in parallel |
1073 | PHONY += scripts | 1073 | PHONY += scripts |
1074 | scripts: scripts_basic asm-generic gcc-plugins $(autoksyms_h) | 1074 | scripts: scripts_basic scripts_dtc asm-generic gcc-plugins $(autoksyms_h) |
1075 | $(Q)$(MAKE) $(build)=$(@) | 1075 | $(Q)$(MAKE) $(build)=$(@) |
1076 | 1076 | ||
1077 | # Things we need to do before we recursively start building the kernel | 1077 | # Things we need to do before we recursively start building the kernel |
@@ -1216,6 +1216,35 @@ kselftest-merge: | |||
1216 | +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig | 1216 | +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig |
1217 | 1217 | ||
1218 | # --------------------------------------------------------------------------- | 1218 | # --------------------------------------------------------------------------- |
1219 | # Devicetree files | ||
1220 | |||
1221 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),) | ||
1222 | dtstree := arch/$(SRCARCH)/boot/dts | ||
1223 | endif | ||
1224 | |||
1225 | ifneq ($(dtstree),) | ||
1226 | |||
1227 | %.dtb: prepare3 scripts_dtc | ||
1228 | $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ | ||
1229 | |||
1230 | PHONY += dtbs dtbs_install | ||
1231 | dtbs: prepare3 scripts_dtc | ||
1232 | $(Q)$(MAKE) $(build)=$(dtstree) | ||
1233 | |||
1234 | dtbs_install: | ||
1235 | $(Q)$(MAKE) $(dtbinst)=$(dtstree) | ||
1236 | |||
1237 | ifdef CONFIG_OF_EARLY_FLATTREE | ||
1238 | all: dtbs | ||
1239 | endif | ||
1240 | |||
1241 | endif | ||
1242 | |||
1243 | PHONY += scripts_dtc | ||
1244 | scripts_dtc: scripts_basic | ||
1245 | $(Q)$(MAKE) $(build)=scripts/dtc | ||
1246 | |||
1247 | # --------------------------------------------------------------------------- | ||
1219 | # Modules | 1248 | # Modules |
1220 | 1249 | ||
1221 | ifdef CONFIG_MODULES | 1250 | ifdef CONFIG_MODULES |
@@ -1424,6 +1453,12 @@ help: | |||
1424 | @echo ' kselftest-merge - Merge all the config dependencies of kselftest to existing' | 1453 | @echo ' kselftest-merge - Merge all the config dependencies of kselftest to existing' |
1425 | @echo ' .config.' | 1454 | @echo ' .config.' |
1426 | @echo '' | 1455 | @echo '' |
1456 | @$(if $(dtstree), \ | ||
1457 | echo 'Devicetree:'; \ | ||
1458 | echo '* dtbs - Build device tree blobs for enabled boards'; \ | ||
1459 | echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'; \ | ||
1460 | echo '') | ||
1461 | |||
1427 | @echo 'Userspace tools targets:' | 1462 | @echo 'Userspace tools targets:' |
1428 | @echo ' use "make tools/help"' | 1463 | @echo ' use "make tools/help"' |
1429 | @echo ' or "cd tools; make help"' | 1464 | @echo ' or "cd tools; make help"' |