b24413180f560 (Greg Kroah-Hartman 2017-11-01 15:07:57 +0100 1) # SPDX-License-Identifier: GPL-2.0
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 2) # ==========================================================================
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 3) # Installing dtb files
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 4) #
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 5) # Installs all dtb files listed in $(dtb-y) either in the
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 6) # INSTALL_DTBS_PATH directory or the default location:
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 7) #
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 8) # $INSTALL_PATH/dtbs/$KERNELRELEASE
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 9) # ==========================================================================
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 10)
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 11) src := $(obj)
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 12)
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 13) PHONY := __dtbs_install
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 14) __dtbs_install:
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 15)
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 16) include include/config/auto.conf
3204a7fb98a3b (Masahiro Yamada 2021-02-28 15:10:26 +0900 17) include $(srctree)/scripts/Kbuild.include
5f655c7a4c9fc (Masahiro Yamada 2015-03-27 20:43:37 +0900 18) include $(src)/Makefile
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 19)
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 20) dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 21) subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 22)
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 23) __dtbs_install: $(dtbs) $(subdirs)
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 24) @:
323a028d39cd8 (Robert Richter 2014-09-03 16:17:02 +0200 25)
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 26) quiet_cmd_dtb_install = INSTALL $@
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 27) cmd_dtb_install = install -D $< $@
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 28)
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 29) $(dst)/%.dtb: $(obj)/%.dtb
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 30) $(call cmd,dtb_install)
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 31)
ce88c9c79455f (Viresh Kumar 2021-01-29 12:54:08 +0530 32) $(dst)/%.dtbo: $(obj)/%.dtbo
ce88c9c79455f (Viresh Kumar 2021-01-29 12:54:08 +0530 33) $(call cmd,dtb_install)
ce88c9c79455f (Viresh Kumar 2021-01-29 12:54:08 +0530 34)
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 35) PHONY += $(subdirs)
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 36) $(subdirs):
aefd80307a05e (Masahiro Yamada 2020-03-07 02:08:52 +0900 37) $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@)
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 38)
9fb5e53722089 (Robert Richter 2014-09-03 15:29:24 +0200 39) .PHONY: $(PHONY)