Makefile.fwinst 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # ==========================================================================
  2. # Installing firmware
  3. #
  4. # We don't include the .config, so all firmware files are in $(fw-shipped-)
  5. # rather than in $(fw-shipped-y) or $(fw-shipped-n).
  6. # ==========================================================================
  7. INSTALL := install
  8. src := $(obj)
  9. # For modules_install installing firmware, we want to see .config
  10. # But for firmware_install, we don't care, but don't want to require it.
  11. -include $(objtree)/.config
  12. include scripts/Kbuild.include
  13. include $(srctree)/$(obj)/Makefile
  14. include scripts/Makefile.host
  15. mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-m))
  16. # If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the
  17. # firmware for in-kernel drivers too.
  18. ifndef CONFIG_FIRMWARE_IN_KERNEL
  19. mod-fw += $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-y))
  20. endif
  21. installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
  22. installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/.
  23. quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
  24. cmd_install = $(INSTALL) -m0644 $< $@
  25. $(installed-fw-dirs):
  26. $(call cmd,mkdir)
  27. $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)/
  28. $(call cmd,install)
  29. .PHONY: __fw_install __fw_modinst FORCE
  30. __fw_install: $(installed-fw)
  31. __fw_modinst: $(mod-fw)
  32. FORCE: