Makefile.dtbinst 1.06 KB
Newer Older
1 2 3 4 5 6 7 8
# ==========================================================================
# 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
#
9
# Traverse through subdirectories listed in $(dts-dirs).
10 11 12 13 14 15 16
# ==========================================================================

src := $(obj)

PHONY := __dtbs_install
__dtbs_install:

17
export dtbinst_root ?= $(obj)
18

19 20
include include/config/auto.conf
include scripts/Kbuild.include
21
include $(src)/Makefile
22 23

dtbinst-files	:= $(dtb-y)
24
dtbinst-dirs	:= $(dts-dirs)
25 26 27

# Helper targets for Installing DTBs into the boot directory
quiet_cmd_dtb_install =	INSTALL $<
28 29
      cmd_dtb_install =	mkdir -p $(2); cp $< $(2)

30
install-dir = $(patsubst $(dtbinst_root)%,$(INSTALL_DTBS_PATH)%,$(obj))
31 32 33

$(dtbinst-files): %.dtb: $(obj)/%.dtb
	$(call cmd,dtb_install,$(install-dir))
34

35 36
$(dtbinst-dirs):
	$(Q)$(MAKE) $(dtbinst)=$(obj)/$@
37

38 39
PHONY += $(dtbinst-files) $(dtbinst-dirs)
__dtbs_install: $(dtbinst-files) $(dtbinst-dirs)
40 41

.PHONY: $(PHONY)