2014-09-03 15:29:24 +02:00
|
|
|
# ==========================================================================
|
|
|
|
# Installing dtb files
|
|
|
|
#
|
|
|
|
# Installs all dtb files listed in $(dtb-y) either in the
|
|
|
|
# INSTALL_DTBS_PATH directory or the default location:
|
|
|
|
#
|
|
|
|
# $INSTALL_PATH/dtbs/$KERNELRELEASE
|
|
|
|
#
|
2014-09-03 16:17:02 +02:00
|
|
|
# Traverse through subdirectories listed in $(dts-dirs).
|
2014-09-03 15:29:24 +02:00
|
|
|
# ==========================================================================
|
|
|
|
|
|
|
|
src := $(obj)
|
|
|
|
|
|
|
|
PHONY := __dtbs_install
|
|
|
|
__dtbs_install:
|
|
|
|
|
2014-09-03 16:17:02 +02:00
|
|
|
export dtbinst-root ?= $(obj)
|
|
|
|
|
2014-09-03 15:29:24 +02:00
|
|
|
include include/config/auto.conf
|
|
|
|
include scripts/Kbuild.include
|
2015-03-27 12:43:37 +01:00
|
|
|
include $(src)/Makefile
|
2014-09-03 15:29:24 +02:00
|
|
|
|
|
|
|
PHONY += __dtbs_install_prep
|
|
|
|
__dtbs_install_prep:
|
2014-09-03 16:17:02 +02:00
|
|
|
ifeq ("$(dtbinst-root)", "$(obj)")
|
2014-09-03 15:29:24 +02:00
|
|
|
$(Q)if [ -d $(INSTALL_DTBS_PATH).old ]; then rm -rf $(INSTALL_DTBS_PATH).old; fi
|
|
|
|
$(Q)if [ -d $(INSTALL_DTBS_PATH) ]; then mv $(INSTALL_DTBS_PATH) $(INSTALL_DTBS_PATH).old; fi
|
|
|
|
$(Q)mkdir -p $(INSTALL_DTBS_PATH)
|
2014-09-03 16:17:02 +02:00
|
|
|
endif
|
2014-09-03 15:29:24 +02:00
|
|
|
|
|
|
|
dtbinst-files := $(dtb-y)
|
2014-09-03 16:17:02 +02:00
|
|
|
dtbinst-dirs := $(dts-dirs)
|
2014-09-03 15:29:24 +02:00
|
|
|
|
|
|
|
# Helper targets for Installing DTBs into the boot directory
|
|
|
|
quiet_cmd_dtb_install = INSTALL $<
|
2014-09-03 16:17:02 +02:00
|
|
|
cmd_dtb_install = mkdir -p $(2); cp $< $(2)
|
|
|
|
|
|
|
|
install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj))
|
|
|
|
|
|
|
|
$(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep
|
|
|
|
|
|
|
|
$(dtbinst-files): %.dtb: $(obj)/%.dtb
|
|
|
|
$(call cmd,dtb_install,$(install-dir))
|
2014-09-03 15:29:24 +02:00
|
|
|
|
2014-09-03 16:17:02 +02:00
|
|
|
$(dtbinst-dirs):
|
|
|
|
$(Q)$(MAKE) $(dtbinst)=$(obj)/$@
|
2014-09-03 15:29:24 +02:00
|
|
|
|
2014-09-03 16:17:02 +02:00
|
|
|
PHONY += $(dtbinst-files) $(dtbinst-dirs)
|
|
|
|
__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
|
2014-09-03 15:29:24 +02:00
|
|
|
|
|
|
|
.PHONY: $(PHONY)
|