summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-01-10 16:19:37 -0500
committerRob Herring <robh@kernel.org>2018-10-02 10:23:21 -0400
commit37c8a5fafa3bb7dcdd51774be353be6cb2912b86 (patch)
tree4d31eb8716c1b685ff56d09da3e4ba394c018596 /Makefile
parentbe7cd2df1d22d29e5f23ce8744fc465cc07cc2bc (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--Makefile37
1 files changed, 36 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 19948e556941..021e274c4b03 100644
--- a/Makefile
+++ b/Makefile
@@ -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
1073PHONY += scripts 1073PHONY += scripts
1074scripts: scripts_basic asm-generic gcc-plugins $(autoksyms_h) 1074scripts: 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
1221ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),)
1222dtstree := arch/$(SRCARCH)/boot/dts
1223endif
1224
1225ifneq ($(dtstree),)
1226
1227%.dtb: prepare3 scripts_dtc
1228 $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
1229
1230PHONY += dtbs dtbs_install
1231dtbs: prepare3 scripts_dtc
1232 $(Q)$(MAKE) $(build)=$(dtstree)
1233
1234dtbs_install:
1235 $(Q)$(MAKE) $(dtbinst)=$(dtstree)
1236
1237ifdef CONFIG_OF_EARLY_FLATTREE
1238all: dtbs
1239endif
1240
1241endif
1242
1243PHONY += scripts_dtc
1244scripts_dtc: scripts_basic
1245 $(Q)$(MAKE) $(build)=scripts/dtc
1246
1247# ---------------------------------------------------------------------------
1219# Modules 1248# Modules
1220 1249
1221ifdef CONFIG_MODULES 1250ifdef 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"'