Skip to content

Commit c1c1a59

Browse files
masselstinemichal42
authored andcommitted
firmware: fix directory creation rule matching with make 3.80
Since make 3.80 doesn't support secondary expansion it uses a fallback rule to create firmware directories which is matched after primary expansion of the $(installed-fw) rule's prerequisite. Commit 6c7080a [firmware: fix directory creation rule matching with make 3.82] changed the expression generated after primary expansion such that the fallback was not matched. Updating the fallback rule to match the new look primary expansion is not an option for various reasons. The trailing slash added here to $(INSTALL_FW_PATH)/. while defining installed-fw-dirs fixes builds with make 3.82 since this will provide a matching rule for $(INSTALL_FW_PATH)/$$(dir %) when % is in the base firmware directory (ie. $(dir %) gives './'). Versions of make prior to 3.82 will strip this trailing slash along with the one generated by $(dir %) when % is in the base firmware directory and as such continue to function as before. Signed-off-by: Mark Asselstine <[email protected]> Tested-by: Jan Beulich <[email protected]> Signed-off-by: Michal Marek <[email protected]>
1 parent 6c7080a commit c1c1a59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/Makefile.fwinst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endif
2727
installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw))
2828

2929
installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
30-
installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/.
30+
installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./
3131

3232
# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
3333
PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs
@@ -42,7 +42,7 @@ quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
4242
$(installed-fw-dirs):
4343
$(call cmd,mkdir)
4444

45-
$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $$(dir $(INSTALL_FW_PATH)/%)
45+
$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %)
4646
$(call cmd,install)
4747

4848
PHONY += __fw_install __fw_modinst FORCE

0 commit comments

Comments
 (0)