553bc7f9e1
Vendor packages frequently install a set of DTBs based on a collection of targets. For instance, DTBs which are installed as part of a target supporting "Kalama" include the base DTBs and board DTBOs. Collecting that list of DTBs is less ideal because the list of DTBs must be maintained in Makefile which is responsible for compiling the DTBs plus in another file which knows to package all those DTBs. Ideally, list can be maintained in one Makefile. Makefiles can specify a list of DTBs for "foo" with foo-dtbs-y. Build script can run "make dtbs" as normal and (now) also run "make DTB_TYPES="foo-" dtb_install" to install only the dtbs supporting foo. Change-Id: Ic162038b03a37ba822e131a92e3a8d540194b021 Signed-off-by: Elliot Berman <quic_eberman@quicinc.com> Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
40 lines
1023 B
Makefile
40 lines
1023 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# ==========================================================================
|
|
# 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
|
|
# ==========================================================================
|
|
|
|
src := $(obj)
|
|
|
|
PHONY := __dtbs_install
|
|
__dtbs_install:
|
|
|
|
include include/config/auto.conf
|
|
include $(srctree)/scripts/Kbuild.include
|
|
include $(src)/Makefile
|
|
|
|
dtbs := $(addprefix $(dst)/, $($(DTB_TYPES)dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$($(DTB_TYPES)dtb-)))
|
|
subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
|
|
|
|
__dtbs_install: $(dtbs) $(subdirs)
|
|
@:
|
|
|
|
quiet_cmd_dtb_install = INSTALL $@
|
|
cmd_dtb_install = install -D $< $@
|
|
|
|
$(dst)/%.dtb: $(obj)/%.dtb
|
|
$(call cmd,dtb_install)
|
|
|
|
$(dst)/%.dtbo: $(obj)/%.dtbo
|
|
$(call cmd,dtb_install)
|
|
|
|
PHONY += $(subdirs)
|
|
$(subdirs):
|
|
$(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@)
|
|
|
|
.PHONY: $(PHONY)
|