aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/Makefile6
-rw-r--r--arch/arm/boot/dts/Makefile2
-rw-r--r--arch/arm64/Makefile6
-rw-r--r--arch/arm64/boot/dts/Makefile2
-rw-r--r--scripts/Kbuild.include6
-rw-r--r--scripts/Makefile.dtbinst38
-rw-r--r--scripts/Makefile.lib12
7 files changed, 54 insertions, 18 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 034a94904d69..c81e0674e568 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -312,9 +312,13 @@ $(INSTALL_TARGETS):
312 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ 312 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@
313 313
314PHONY += dtbs dtbs_install 314PHONY += dtbs dtbs_install
315dtbs dtbs_install: prepare scripts 315
316dtbs: prepare scripts
316 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@ 317 $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@
317 318
319dtbs_install:
320 $(Q)$(MAKE) $(dtbinst)=$(boot)/dts MACHINE=$(MACHINE)
321
318# We use MRPROPER_FILES and CLEAN_FILES now 322# We use MRPROPER_FILES and CLEAN_FILES now
319archclean: 323archclean:
320 $(Q)$(MAKE) $(clean)=$(boot) 324 $(Q)$(MAKE) $(clean)=$(boot)
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 38c89cafa1ab..e0d348b4d1fa 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -527,5 +527,3 @@ dtbs: $(addprefix $(obj)/, $(dtb-y))
527 $(Q)rm -f $(obj)/../*.dtb 527 $(Q)rm -f $(obj)/../*.dtb
528 528
529clean-files := *.dtb 529clean-files := *.dtb
530
531dtbs_install: $(addsuffix _dtbinst_, $(dtb-y))
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index a963b3a8fc34..8e9167a19b6b 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -71,9 +71,13 @@ zinstall install: vmlinux
71 $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ 71 $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
72 72
73PHONY += dtbs dtbs_install 73PHONY += dtbs dtbs_install
74dtbs dtbs_install: prepare scripts 74
75dtbs: prepare scripts
75 $(Q)$(MAKE) $(build)=$(boot)/dts $@ 76 $(Q)$(MAKE) $(build)=$(boot)/dts $@
76 77
78dtbs_install:
79 $(Q)$(MAKE) $(dtbinst)=$(boot)/dts
80
77PHONY += vdso_install 81PHONY += vdso_install
78vdso_install: 82vdso_install:
79 $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@ 83 $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@
diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
index 3a75cdc2d087..29ac5adf50ae 100644
--- a/arch/arm64/boot/dts/Makefile
+++ b/arch/arm64/boot/dts/Makefile
@@ -8,5 +8,3 @@ targets += $(dtb-y)
8dtbs: $(addprefix $(obj)/, $(dtb-y)) 8dtbs: $(addprefix $(obj)/, $(dtb-y))
9 9
10clean-files := *.dtb 10clean-files := *.dtb
11
12dtbs_install: $(addsuffix _dtbinst_, $(dtb-y))
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 65e7b08bb2cc..5374b1bdf02f 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -179,6 +179,12 @@ build := -f $(srctree)/scripts/Makefile.build obj
179# $(Q)$(MAKE) $(modbuiltin)=dir 179# $(Q)$(MAKE) $(modbuiltin)=dir
180modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj 180modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
181 181
182###
183# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.dtbinst obj=
184# Usage:
185# $(Q)$(MAKE) $(dtbinst)=dir
186dtbinst := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.dtbinst obj
187
182# Prefix -I with $(srctree) if it is not an absolute path. 188# Prefix -I with $(srctree) if it is not an absolute path.
183# skip if -I has no parameter 189# skip if -I has no parameter
184addtree = $(if $(patsubst -I%,%,$(1)), \ 190addtree = $(if $(patsubst -I%,%,$(1)), \
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
new file mode 100644
index 000000000000..54286cccc289
--- /dev/null
+++ b/scripts/Makefile.dtbinst
@@ -0,0 +1,38 @@
1# ==========================================================================
2# Installing dtb files
3#
4# Installs all dtb files listed in $(dtb-y) either in the
5# INSTALL_DTBS_PATH directory or the default location:
6#
7# $INSTALL_PATH/dtbs/$KERNELRELEASE
8#
9# ==========================================================================
10
11src := $(obj)
12
13PHONY := __dtbs_install
14__dtbs_install:
15
16include include/config/auto.conf
17include scripts/Kbuild.include
18include $(srctree)/$(obj)/Makefile
19
20PHONY += __dtbs_install_prep
21__dtbs_install_prep:
22 $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi
23 $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi
24 $(Q)mkdir -p $(INSTALL_DTBS_PATH)
25
26dtbinst-files := $(dtb-y)
27
28# Helper targets for Installing DTBs into the boot directory
29quiet_cmd_dtb_install = INSTALL $<
30 cmd_dtb_install = cp $< $(2)
31
32$(dtbinst-files): %.dtb: $(obj)/%.dtb | __dtbs_install_prep
33 $(call cmd,dtb_install,$(INSTALL_DTBS_PATH))
34
35PHONY += $(dtbinst-files)
36__dtbs_install: $(dtbinst-files)
37
38.PHONY: $(PHONY)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 54be19a0fa51..511755200634 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -283,18 +283,6 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
283 283
284dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) 284dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
285 285
286# Helper targets for Installing DTBs into the boot directory
287quiet_cmd_dtb_install = INSTALL $<
288 cmd_dtb_install = cp $< $(2)
289
290_dtbinst_pre_:
291 $(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi
292 $(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi
293 $(Q)mkdir -p $(INSTALL_DTBS_PATH)
294
295%.dtb_dtbinst_: $(obj)/%.dtb _dtbinst_pre_
296 $(call cmd,dtb_install,$(INSTALL_DTBS_PATH))
297
298# Bzip2 286# Bzip2
299# --------------------------------------------------------------------------- 287# ---------------------------------------------------------------------------
300 288