diff options
-rw-r--r-- | arch/arm/Makefile | 6 | ||||
-rw-r--r-- | arch/arm/boot/dts/Makefile | 2 | ||||
-rw-r--r-- | arch/arm64/Makefile | 6 | ||||
-rw-r--r-- | arch/arm64/boot/dts/Makefile | 2 | ||||
-rw-r--r-- | scripts/Kbuild.include | 6 | ||||
-rw-r--r-- | scripts/Makefile.dtbinst | 38 | ||||
-rw-r--r-- | scripts/Makefile.lib | 12 |
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 | ||
314 | PHONY += dtbs dtbs_install | 314 | PHONY += dtbs dtbs_install |
315 | dtbs dtbs_install: prepare scripts | 315 | |
316 | dtbs: prepare scripts | ||
316 | $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@ | 317 | $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $@ |
317 | 318 | ||
319 | dtbs_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 |
319 | archclean: | 323 | archclean: |
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 | ||
529 | clean-files := *.dtb | 529 | clean-files := *.dtb |
530 | |||
531 | dtbs_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 | ||
73 | PHONY += dtbs dtbs_install | 73 | PHONY += dtbs dtbs_install |
74 | dtbs dtbs_install: prepare scripts | 74 | |
75 | dtbs: prepare scripts | ||
75 | $(Q)$(MAKE) $(build)=$(boot)/dts $@ | 76 | $(Q)$(MAKE) $(build)=$(boot)/dts $@ |
76 | 77 | ||
78 | dtbs_install: | ||
79 | $(Q)$(MAKE) $(dtbinst)=$(boot)/dts | ||
80 | |||
77 | PHONY += vdso_install | 81 | PHONY += vdso_install |
78 | vdso_install: | 82 | vdso_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) | |||
8 | dtbs: $(addprefix $(obj)/, $(dtb-y)) | 8 | dtbs: $(addprefix $(obj)/, $(dtb-y)) |
9 | 9 | ||
10 | clean-files := *.dtb | 10 | clean-files := *.dtb |
11 | |||
12 | dtbs_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 |
180 | modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj | 180 | modbuiltin := -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 | ||
186 | dtbinst := -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 |
184 | addtree = $(if $(patsubst -I%,%,$(1)), \ | 190 | addtree = $(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 | |||
11 | src := $(obj) | ||
12 | |||
13 | PHONY := __dtbs_install | ||
14 | __dtbs_install: | ||
15 | |||
16 | include include/config/auto.conf | ||
17 | include scripts/Kbuild.include | ||
18 | include $(srctree)/$(obj)/Makefile | ||
19 | |||
20 | PHONY += __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 | |||
26 | dtbinst-files := $(dtb-y) | ||
27 | |||
28 | # Helper targets for Installing DTBs into the boot directory | ||
29 | quiet_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 | |||
35 | PHONY += $(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 | ||
284 | dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) | 284 | dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) |
285 | 285 | ||
286 | # Helper targets for Installing DTBs into the boot directory | ||
287 | quiet_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 | ||