diff options
-rw-r--r-- | scripts/Makefile.fwinst | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst index 3d2f4609578f..c972c0f54ce0 100644 --- a/scripts/Makefile.fwinst +++ b/scripts/Makefile.fwinst | |||
@@ -28,18 +28,39 @@ endif | |||
28 | installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) | 28 | installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) |
29 | installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. | 29 | installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. |
30 | 30 | ||
31 | # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. | ||
32 | PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs | ||
33 | $(INSTALL_FW_PATH)/$$(%): install-all-dirs | ||
34 | @true | ||
35 | install-all-dirs: $(installed-fw-dirs) | ||
36 | @true | ||
37 | |||
31 | quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) | 38 | quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) |
32 | cmd_install = $(INSTALL) -m0644 $< $@ | 39 | cmd_install = $(INSTALL) -m0644 $< $@ |
33 | 40 | ||
34 | $(installed-fw-dirs): | 41 | $(installed-fw-dirs): |
35 | $(call cmd,mkdir) | 42 | $(call cmd,mkdir) |
36 | 43 | ||
37 | $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)/ | 44 | $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %) |
38 | $(call cmd,install) | 45 | $(call cmd,install) |
39 | 46 | ||
40 | .PHONY: __fw_install __fw_modinst FORCE | 47 | PHONY += __fw_install __fw_modinst FORCE |
48 | |||
49 | .PHONY: $(PHONY) | ||
41 | 50 | ||
42 | __fw_install: $(installed-fw) | 51 | __fw_install: $(installed-fw) |
43 | __fw_modinst: $(mod-fw) | 52 | __fw_modinst: $(mod-fw) |
44 | 53 | ||
45 | FORCE: | 54 | FORCE: |
55 | |||
56 | # Read all saved command lines and dependencies for the $(targets) we | ||
57 | # may be building using $(if_changed{,_dep}). As an optimization, we | ||
58 | # don't need to read them if the target does not exist; we will rebuild | ||
59 | # anyway in that case. | ||
60 | |||
61 | targets := $(wildcard $(sort $(targets))) | ||
62 | cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) | ||
63 | |||
64 | ifneq ($(cmd_files),) | ||
65 | include $(cmd_files) | ||
66 | endif | ||