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 | |
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>
-rw-r--r-- | Makefile | 37 | ||||
-rw-r--r-- | arch/arc/Makefile | 6 | ||||
-rw-r--r-- | arch/arm/Makefile | 20 | ||||
-rw-r--r-- | arch/arm64/Makefile | 17 | ||||
-rw-r--r-- | arch/c6x/Makefile | 2 | ||||
-rw-r--r-- | arch/h8300/Makefile | 11 | ||||
-rw-r--r-- | arch/microblaze/Makefile | 4 | ||||
-rw-r--r-- | arch/microblaze/boot/dts/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/Makefile | 15 | ||||
-rw-r--r-- | arch/nds32/Makefile | 2 | ||||
-rw-r--r-- | arch/nios2/Makefile | 7 | ||||
-rw-r--r-- | arch/nios2/boot/Makefile | 4 | ||||
-rw-r--r-- | arch/powerpc/Makefile | 3 | ||||
-rw-r--r-- | arch/xtensa/Makefile | 12 | ||||
-rw-r--r-- | scripts/Makefile | 3 | ||||
-rw-r--r-- | scripts/Makefile.lib | 2 | ||||
-rw-r--r-- | scripts/dtc/Makefile | 2 |
17 files changed, 48 insertions, 101 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"' |
diff --git a/arch/arc/Makefile b/arch/arc/Makefile index fb026196aaab..5c7bc6d62f43 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile | |||
@@ -132,11 +132,5 @@ boot_targets += uImage uImage.bin uImage.gz | |||
132 | $(boot_targets): vmlinux | 132 | $(boot_targets): vmlinux |
133 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | 133 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
134 | 134 | ||
135 | %.dtb %.dtb.S %.dtb.o: scripts | ||
136 | $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ | ||
137 | |||
138 | dtbs: scripts | ||
139 | $(Q)$(MAKE) $(build)=$(boot)/dts | ||
140 | |||
141 | archclean: | 135 | archclean: |
142 | $(Q)$(MAKE) $(clean)=$(boot) | 136 | $(Q)$(MAKE) $(clean)=$(boot) |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index d1516f85f25d..161c2df6567e 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -307,12 +307,7 @@ else | |||
307 | KBUILD_IMAGE := $(boot)/zImage | 307 | KBUILD_IMAGE := $(boot)/zImage |
308 | endif | 308 | endif |
309 | 309 | ||
310 | # Build the DT binary blobs if we have OF configured | 310 | all: $(notdir $(KBUILD_IMAGE)) |
311 | ifeq ($(CONFIG_USE_OF),y) | ||
312 | KBUILD_DTBS := dtbs | ||
313 | endif | ||
314 | |||
315 | all: $(notdir $(KBUILD_IMAGE)) $(KBUILD_DTBS) | ||
316 | 311 | ||
317 | 312 | ||
318 | archheaders: | 313 | archheaders: |
@@ -339,17 +334,6 @@ $(BOOT_TARGETS): vmlinux | |||
339 | $(INSTALL_TARGETS): | 334 | $(INSTALL_TARGETS): |
340 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ | 335 | $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@ |
341 | 336 | ||
342 | %.dtb: | scripts | ||
343 | $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ | ||
344 | |||
345 | PHONY += dtbs dtbs_install | ||
346 | |||
347 | dtbs: prepare scripts | ||
348 | $(Q)$(MAKE) $(build)=$(boot)/dts | ||
349 | |||
350 | dtbs_install: | ||
351 | $(Q)$(MAKE) $(dtbinst)=$(boot)/dts | ||
352 | |||
353 | PHONY += vdso_install | 337 | PHONY += vdso_install |
354 | vdso_install: | 338 | vdso_install: |
355 | ifeq ($(CONFIG_VDSO),y) | 339 | ifeq ($(CONFIG_VDSO),y) |
@@ -371,8 +355,6 @@ define archhelp | |||
371 | echo ' uImage - U-Boot wrapped zImage' | 355 | echo ' uImage - U-Boot wrapped zImage' |
372 | echo ' bootpImage - Combined zImage and initial RAM disk' | 356 | echo ' bootpImage - Combined zImage and initial RAM disk' |
373 | echo ' (supply initrd image via make variable INITRD=<path>)' | 357 | echo ' (supply initrd image via make variable INITRD=<path>)' |
374 | echo '* dtbs - Build device tree blobs for enabled boards' | ||
375 | echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)' | ||
376 | echo ' install - Install uncompressed kernel' | 358 | echo ' install - Install uncompressed kernel' |
377 | echo ' zinstall - Install compressed kernel' | 359 | echo ' zinstall - Install compressed kernel' |
378 | echo ' uinstall - Install U-Boot wrapped compressed kernel' | 360 | echo ' uinstall - Install U-Boot wrapped compressed kernel' |
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 106039d25e2f..b4e994cd3a42 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile | |||
@@ -113,9 +113,8 @@ core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a | |||
113 | # Default target when executing plain make | 113 | # Default target when executing plain make |
114 | boot := arch/arm64/boot | 114 | boot := arch/arm64/boot |
115 | KBUILD_IMAGE := $(boot)/Image.gz | 115 | KBUILD_IMAGE := $(boot)/Image.gz |
116 | KBUILD_DTBS := dtbs | ||
117 | 116 | ||
118 | all: Image.gz $(KBUILD_DTBS) | 117 | all: Image.gz |
119 | 118 | ||
120 | 119 | ||
121 | Image: vmlinux | 120 | Image: vmlinux |
@@ -127,17 +126,6 @@ Image.%: Image | |||
127 | zinstall install: | 126 | zinstall install: |
128 | $(Q)$(MAKE) $(build)=$(boot) $@ | 127 | $(Q)$(MAKE) $(build)=$(boot) $@ |
129 | 128 | ||
130 | %.dtb: scripts | ||
131 | $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ | ||
132 | |||
133 | PHONY += dtbs dtbs_install | ||
134 | |||
135 | dtbs: prepare scripts | ||
136 | $(Q)$(MAKE) $(build)=$(boot)/dts | ||
137 | |||
138 | dtbs_install: | ||
139 | $(Q)$(MAKE) $(dtbinst)=$(boot)/dts | ||
140 | |||
141 | PHONY += vdso_install | 129 | PHONY += vdso_install |
142 | vdso_install: | 130 | vdso_install: |
143 | $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@ | 131 | $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@ |
@@ -145,7 +133,6 @@ vdso_install: | |||
145 | # We use MRPROPER_FILES and CLEAN_FILES now | 133 | # We use MRPROPER_FILES and CLEAN_FILES now |
146 | archclean: | 134 | archclean: |
147 | $(Q)$(MAKE) $(clean)=$(boot) | 135 | $(Q)$(MAKE) $(clean)=$(boot) |
148 | $(Q)$(MAKE) $(clean)=$(boot)/dts | ||
149 | 136 | ||
150 | # We need to generate vdso-offsets.h before compiling certain files in kernel/. | 137 | # We need to generate vdso-offsets.h before compiling certain files in kernel/. |
151 | # In order to do that, we should use the archprepare target, but we can't since | 138 | # In order to do that, we should use the archprepare target, but we can't since |
@@ -160,8 +147,6 @@ vdso_prepare: prepare0 | |||
160 | define archhelp | 147 | define archhelp |
161 | echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)' | 148 | echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)' |
162 | echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' | 149 | echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' |
163 | echo '* dtbs - Build device tree blobs for enabled boards' | ||
164 | echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)' | ||
165 | echo ' install - Install uncompressed kernel' | 150 | echo ' install - Install uncompressed kernel' |
166 | echo ' zinstall - Install compressed kernel' | 151 | echo ' zinstall - Install compressed kernel' |
167 | echo ' Install using (your) ~/bin/installkernel or' | 152 | echo ' Install using (your) ~/bin/installkernel or' |
diff --git a/arch/c6x/Makefile b/arch/c6x/Makefile index 3fe8a948e94c..b7aa854f7008 100644 --- a/arch/c6x/Makefile +++ b/arch/c6x/Makefile | |||
@@ -40,9 +40,7 @@ boot := arch/$(ARCH)/boot | |||
40 | DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS))) | 40 | DTB:=$(subst dtbImage.,,$(filter dtbImage.%, $(MAKECMDGOALS))) |
41 | export DTB | 41 | export DTB |
42 | 42 | ||
43 | ifneq ($(DTB),) | ||
44 | core-y += $(boot)/dts/ | 43 | core-y += $(boot)/dts/ |
45 | endif | ||
46 | 44 | ||
47 | # With make 3.82 we cannot mix normal and wildcard targets | 45 | # With make 3.82 we cannot mix normal and wildcard targets |
48 | 46 | ||
diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile index 58634e6bae92..4003ddc616e1 100644 --- a/arch/h8300/Makefile +++ b/arch/h8300/Makefile | |||
@@ -31,21 +31,12 @@ CROSS_COMPILE := h8300-unknown-linux- | |||
31 | endif | 31 | endif |
32 | 32 | ||
33 | core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ | 33 | core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ |
34 | ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""' | 34 | core-y += arch/$(ARCH)/boot/dts/ |
35 | core-y += arch/h8300/boot/dts/ | ||
36 | endif | ||
37 | 35 | ||
38 | libs-y += arch/$(ARCH)/lib/ | 36 | libs-y += arch/$(ARCH)/lib/ |
39 | 37 | ||
40 | boot := arch/h8300/boot | 38 | boot := arch/h8300/boot |
41 | 39 | ||
42 | %.dtb %.dtb.S %.dtb.o: | scripts | ||
43 | $(Q)$(MAKE) $(build)=arch/h8300/boot/dts arch/h8300/boot/dts/$@ | ||
44 | |||
45 | PHONY += dtbs | ||
46 | dtbs: scripts | ||
47 | $(Q)$(MAKE) $(build)=arch/h8300/boot/dts | ||
48 | |||
49 | archmrproper: | 40 | archmrproper: |
50 | 41 | ||
51 | archclean: | 42 | archclean: |
diff --git a/arch/microblaze/Makefile b/arch/microblaze/Makefile index 4f3ab5707265..0823d291fbeb 100644 --- a/arch/microblaze/Makefile +++ b/arch/microblaze/Makefile | |||
@@ -65,9 +65,7 @@ boot := arch/microblaze/boot | |||
65 | # Are we making a simpleImage.<boardname> target? If so, crack out the boardname | 65 | # Are we making a simpleImage.<boardname> target? If so, crack out the boardname |
66 | DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS))) | 66 | DTB:=$(subst simpleImage.,,$(filter simpleImage.%, $(MAKECMDGOALS))) |
67 | 67 | ||
68 | ifneq ($(DTB),) | 68 | core-y += $(boot)/dts/ |
69 | core-y += $(boot)/dts/ | ||
70 | endif | ||
71 | 69 | ||
72 | # defines filename extension depending memory management type | 70 | # defines filename extension depending memory management type |
73 | ifeq ($(CONFIG_MMU),) | 71 | ifeq ($(CONFIG_MMU),) |
diff --git a/arch/microblaze/boot/dts/Makefile b/arch/microblaze/boot/dts/Makefile index 1f77913d404d..fe9af267f598 100644 --- a/arch/microblaze/boot/dts/Makefile +++ b/arch/microblaze/boot/dts/Makefile | |||
@@ -1,6 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | # | 2 | # |
3 | 3 | ||
4 | ifneq ($(DTB),) | ||
4 | obj-y += linked_dtb.o | 5 | obj-y += linked_dtb.o |
5 | 6 | ||
6 | # Ensure system.dtb exists | 7 | # Ensure system.dtb exists |
@@ -11,6 +12,7 @@ ifneq ($(DTB),system) | |||
11 | $(obj)/system.dtb: $(obj)/$(DTB).dtb | 12 | $(obj)/system.dtb: $(obj)/$(DTB).dtb |
12 | $(call if_changed,cp) | 13 | $(call if_changed,cp) |
13 | endif | 14 | endif |
15 | endif | ||
14 | 16 | ||
15 | quiet_cmd_cp = CP $< $@$2 | 17 | quiet_cmd_cp = CP $< $@$2 |
16 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) | 18 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) |
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index d74b3742fa5d..d43eeaa6d75b 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -407,18 +407,7 @@ endif | |||
407 | CLEAN_FILES += vmlinux.32 vmlinux.64 | 407 | CLEAN_FILES += vmlinux.32 vmlinux.64 |
408 | 408 | ||
409 | # device-trees | 409 | # device-trees |
410 | core-$(CONFIG_BUILTIN_DTB) += arch/mips/boot/dts/ | 410 | core-y += arch/mips/boot/dts/ |
411 | |||
412 | %.dtb %.dtb.S %.dtb.o: | scripts | ||
413 | $(Q)$(MAKE) $(build)=arch/mips/boot/dts arch/mips/boot/dts/$@ | ||
414 | |||
415 | PHONY += dtbs | ||
416 | dtbs: scripts | ||
417 | $(Q)$(MAKE) $(build)=arch/mips/boot/dts | ||
418 | |||
419 | PHONY += dtbs_install | ||
420 | dtbs_install: | ||
421 | $(Q)$(MAKE) $(dtbinst)=arch/mips/boot/dts | ||
422 | 411 | ||
423 | archprepare: | 412 | archprepare: |
424 | ifdef CONFIG_MIPS32_N32 | 413 | ifdef CONFIG_MIPS32_N32 |
@@ -461,8 +450,6 @@ define archhelp | |||
461 | echo ' uImage.lzma - U-Boot image (lzma)' | 450 | echo ' uImage.lzma - U-Boot image (lzma)' |
462 | echo ' uImage.lzo - U-Boot image (lzo)' | 451 | echo ' uImage.lzo - U-Boot image (lzo)' |
463 | echo ' uzImage.bin - U-Boot image (self-extracting)' | 452 | echo ' uzImage.bin - U-Boot image (self-extracting)' |
464 | echo ' dtbs - Device-tree blobs for enabled boards' | ||
465 | echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)' | ||
466 | echo | 453 | echo |
467 | echo ' These will be default as appropriate for a configured platform.' | 454 | echo ' These will be default as appropriate for a configured platform.' |
468 | echo | 455 | echo |
diff --git a/arch/nds32/Makefile b/arch/nds32/Makefile index 63f4f173e5f4..adcac830d051 100644 --- a/arch/nds32/Makefile +++ b/arch/nds32/Makefile | |||
@@ -43,7 +43,7 @@ CHECKFLAGS += -D__NDS32_EB__ | |||
43 | endif | 43 | endif |
44 | 44 | ||
45 | boot := arch/nds32/boot | 45 | boot := arch/nds32/boot |
46 | core-$(BUILTIN_DTB) += $(boot)/dts/ | 46 | core-y += $(boot)/dts/ |
47 | 47 | ||
48 | .PHONY: FORCE | 48 | .PHONY: FORCE |
49 | 49 | ||
diff --git a/arch/nios2/Makefile b/arch/nios2/Makefile index db2e78fe65c7..52c03e60b114 100644 --- a/arch/nios2/Makefile +++ b/arch/nios2/Makefile | |||
@@ -56,12 +56,6 @@ all: vmImage | |||
56 | archclean: | 56 | archclean: |
57 | $(Q)$(MAKE) $(clean)=$(nios2-boot) | 57 | $(Q)$(MAKE) $(clean)=$(nios2-boot) |
58 | 58 | ||
59 | %.dtb %.dtb.S %.dtb.o: | scripts | ||
60 | $(Q)$(MAKE) $(build)=$(nios2-boot)/dts $(nios2-boot)/dts/$@ | ||
61 | |||
62 | dtbs: | ||
63 | $(Q)$(MAKE) $(build)=$(nios2-boot)/dts | ||
64 | |||
65 | $(BOOT_TARGETS): vmlinux | 59 | $(BOOT_TARGETS): vmlinux |
66 | $(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@ | 60 | $(Q)$(MAKE) $(build)=$(nios2-boot) $(nios2-boot)/$@ |
67 | 61 | ||
@@ -74,5 +68,4 @@ define archhelp | |||
74 | echo ' (your) ~/bin/$(INSTALLKERNEL) or' | 68 | echo ' (your) ~/bin/$(INSTALLKERNEL) or' |
75 | echo ' (distribution) /sbin/$(INSTALLKERNEL) or' | 69 | echo ' (distribution) /sbin/$(INSTALLKERNEL) or' |
76 | echo ' install to $$(INSTALL_PATH)' | 70 | echo ' install to $$(INSTALL_PATH)' |
77 | echo ' dtbs - Build device tree blobs for enabled boards' | ||
78 | endef | 71 | endef |
diff --git a/arch/nios2/boot/Makefile b/arch/nios2/boot/Makefile index 0b48f1bf086d..37dfc7e584bc 100644 --- a/arch/nios2/boot/Makefile +++ b/arch/nios2/boot/Makefile | |||
@@ -31,9 +31,5 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | |||
31 | $(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE | 31 | $(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE |
32 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ | 32 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
33 | 33 | ||
34 | targets += $(dtb-y) | ||
35 | |||
36 | $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y)) | ||
37 | |||
38 | install: | 34 | install: |
39 | sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" | 35 | sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" |
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 53ea887eb34e..42f225f6ec93 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -293,9 +293,6 @@ $(BOOT_TARGETS2): vmlinux | |||
293 | bootwrapper_install: | 293 | bootwrapper_install: |
294 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | 294 | $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
295 | 295 | ||
296 | %.dtb: scripts | ||
297 | $(Q)$(MAKE) $(build)=$(boot)/dts $(patsubst %,$(boot)/dts/%,$@) | ||
298 | |||
299 | # Used to create 'merged defconfigs' | 296 | # Used to create 'merged defconfigs' |
300 | # To use it $(call) it with the first argument as the base defconfig | 297 | # To use it $(call) it with the first argument as the base defconfig |
301 | # and the second argument as a space separated list of .config files to merge, | 298 | # and the second argument as a space separated list of .config files to merge, |
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile index 295c120ed099..13fd3301c517 100644 --- a/arch/xtensa/Makefile +++ b/arch/xtensa/Makefile | |||
@@ -84,28 +84,18 @@ LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | |||
84 | head-y := arch/xtensa/kernel/head.o | 84 | head-y := arch/xtensa/kernel/head.o |
85 | core-y += arch/xtensa/kernel/ arch/xtensa/mm/ | 85 | core-y += arch/xtensa/kernel/ arch/xtensa/mm/ |
86 | core-y += $(buildvar) $(buildplf) | 86 | core-y += $(buildvar) $(buildplf) |
87 | core-y += arch/xtensa/boot/dts/ | ||
87 | 88 | ||
88 | libs-y += arch/xtensa/lib/ $(LIBGCC) | 89 | libs-y += arch/xtensa/lib/ $(LIBGCC) |
89 | drivers-$(CONFIG_OPROFILE) += arch/xtensa/oprofile/ | 90 | drivers-$(CONFIG_OPROFILE) += arch/xtensa/oprofile/ |
90 | 91 | ||
91 | ifneq ($(CONFIG_BUILTIN_DTB),"") | ||
92 | core-$(CONFIG_OF) += arch/xtensa/boot/dts/ | ||
93 | endif | ||
94 | |||
95 | boot := arch/xtensa/boot | 92 | boot := arch/xtensa/boot |
96 | 93 | ||
97 | all Image zImage uImage: vmlinux | 94 | all Image zImage uImage: vmlinux |
98 | $(Q)$(MAKE) $(build)=$(boot) $@ | 95 | $(Q)$(MAKE) $(build)=$(boot) $@ |
99 | 96 | ||
100 | %.dtb: | ||
101 | $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ | ||
102 | |||
103 | dtbs: scripts | ||
104 | $(Q)$(MAKE) $(build)=$(boot)/dts | ||
105 | |||
106 | define archhelp | 97 | define archhelp |
107 | @echo '* Image - Kernel ELF image with reset vector' | 98 | @echo '* Image - Kernel ELF image with reset vector' |
108 | @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' | 99 | @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' |
109 | @echo '* uImage - U-Boot wrapped image' | 100 | @echo '* uImage - U-Boot wrapped image' |
110 | @echo ' dtbs - Build device tree blobs for enabled boards' | ||
111 | endef | 101 | endef |
diff --git a/scripts/Makefile b/scripts/Makefile index 61affa300d25..ece52ff20171 100644 --- a/scripts/Makefile +++ b/scripts/Makefile | |||
@@ -39,8 +39,7 @@ build_unifdef: $(obj)/unifdef | |||
39 | subdir-$(CONFIG_MODVERSIONS) += genksyms | 39 | subdir-$(CONFIG_MODVERSIONS) += genksyms |
40 | subdir-y += mod | 40 | subdir-y += mod |
41 | subdir-$(CONFIG_SECURITY_SELINUX) += selinux | 41 | subdir-$(CONFIG_SECURITY_SELINUX) += selinux |
42 | subdir-$(CONFIG_DTC) += dtc | ||
43 | subdir-$(CONFIG_GDB_SCRIPTS) += gdb | 42 | subdir-$(CONFIG_GDB_SCRIPTS) += gdb |
44 | 43 | ||
45 | # Let clean descend into subdirs | 44 | # Let clean descend into subdirs |
46 | subdir- += basic kconfig package gcc-plugins | 45 | subdir- += basic dtc kconfig package gcc-plugins |
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 61e596650ed3..8fe4468f9bda 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -283,7 +283,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE | |||
283 | 283 | ||
284 | quiet_cmd_dtc = DTC $@ | 284 | quiet_cmd_dtc = DTC $@ |
285 | cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ | 285 | cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ |
286 | $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ | 286 | $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ |
287 | $(DTC) -O dtb -o $@ -b 0 \ | 287 | $(DTC) -O dtb -o $@ -b 0 \ |
288 | $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ | 288 | $(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \ |
289 | -d $(depfile).dtc.tmp $(dtc-tmp) ; \ | 289 | -d $(depfile).dtc.tmp $(dtc-tmp) ; \ |
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 1c943e03eaf2..e535b457babb 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | # scripts/dtc makefile | 2 | # scripts/dtc makefile |
3 | 3 | ||
4 | hostprogs-y := dtc | 4 | hostprogs-$(CONFIG_DTC) := dtc |
5 | always := $(hostprogs-y) | 5 | always := $(hostprogs-y) |
6 | 6 | ||
7 | dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ | 7 | dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ |