aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2014-04-29 05:54:47 -0400
committerMichal Marek <mmarek@suse.cz>2014-05-14 16:43:04 -0400
commit5180d5f483486859c0a822c9020ec459f4504b59 (patch)
tree311341f201df4f2ce9d99a1fd1ed6ffc8aa84bec /scripts
parent3fbb43df983acf6f10a122e43e73daf6528ad7ed (diff)
firmware: Simplify directory creation
When building the firmware blobs, use a simple loop to create directories in $(objtree), like in Makefile.build. This simplifies the rules and also makes it possible to set $(objtree) to '.' later. Before this change, a dependency on $(objtree)/<dir> would be satisfied by <dir> in $(srctree). When installing the firmware blobs, call mkdir like in Makefile.modinst. Cc: David Woodhouse <dwmw2@infradead.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.fwinst24
1 files changed, 11 insertions, 13 deletions
diff --git a/scripts/Makefile.fwinst b/scripts/Makefile.fwinst
index 2c1d69c4345c..d8e335eed226 100644
--- a/scripts/Makefile.fwinst
+++ b/scripts/Makefile.fwinst
@@ -24,25 +24,23 @@ ifndef CONFIG_FIRMWARE_IN_KERNEL
24mod-fw += $(fw-shipped-y) 24mod-fw += $(fw-shipped-y)
25endif 25endif
26 26
27ifneq ($(KBUILD_SRC),)
28# Create output directory if not already present
29_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
30
31firmware-dirs := $(sort $(addprefix $(objtree)/$(obj)/,$(dir $(fw-external-y) $(fw-shipped-all))))
32# Create directories for firmware in subdirectories
33_dummy := $(foreach d,$(firmware-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
34endif
35
27installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) 36installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw))
28 37
29installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) 38installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all))
30installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./
31
32# Workaround for make < 3.81, where .SECONDEXPANSION doesn't work.
33PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs
34$(INSTALL_FW_PATH)/$$(%): install-all-dirs
35 @true
36install-all-dirs: $(installed-fw-dirs)
37 @true
38 39
39quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) 40quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@)
40 cmd_install = $(INSTALL) -m0644 $< $@ 41 cmd_install = mkdir -p $(@D); $(INSTALL) -m0644 $< $@
41
42$(installed-fw-dirs):
43 $(call cmd,mkdir)
44 42
45$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %) 43$(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/%
46 $(call cmd,install) 44 $(call cmd,install)
47 45
48PHONY += __fw_install __fw_modinst FORCE 46PHONY += __fw_install __fw_modinst FORCE