Makefile.dtbinst 933 B

123456789101112131415161718192021222324252627282930313233343536
  1. # SPDX-License-Identifier: GPL-2.0
  2. # ==========================================================================
  3. # Installing dtb files
  4. #
  5. # Installs all dtb files listed in $(dtb-y) either in the
  6. # INSTALL_DTBS_PATH directory or the default location:
  7. #
  8. # $INSTALL_PATH/dtbs/$KERNELRELEASE
  9. # ==========================================================================
  10. src := $(obj)
  11. PHONY := __dtbs_install
  12. __dtbs_install:
  13. include include/config/auto.conf
  14. include scripts/Kbuild.include
  15. include $(src)/Makefile
  16. dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
  17. subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
  18. __dtbs_install: $(dtbs) $(subdirs)
  19. @:
  20. quiet_cmd_dtb_install = INSTALL $@
  21. cmd_dtb_install = install -D $< $@
  22. $(dst)/%.dtb: $(obj)/%.dtb
  23. $(call cmd,dtb_install)
  24. PHONY += $(subdirs)
  25. $(subdirs):
  26. $(Q)$(MAKE) $(dtbinst)=$@ dst=$(patsubst $(obj)/%,$(dst)/%,$@)
  27. .PHONY: $(PHONY)