diff options
author | Michal Marek <mmarek@suse.cz> | 2014-04-29 05:54:47 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2014-05-14 16:43:04 -0400 |
commit | 5180d5f483486859c0a822c9020ec459f4504b59 (patch) | |
tree | 311341f201df4f2ce9d99a1fd1ed6ffc8aa84bec /scripts | |
parent | 3fbb43df983acf6f10a122e43e73daf6528ad7ed (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.fwinst | 24 |
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 | |||
24 | mod-fw += $(fw-shipped-y) | 24 | mod-fw += $(fw-shipped-y) |
25 | endif | 25 | endif |
26 | 26 | ||
27 | ifneq ($(KBUILD_SRC),) | ||
28 | # Create output directory if not already present | ||
29 | _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) | ||
30 | |||
31 | firmware-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))) | ||
34 | endif | ||
35 | |||
27 | installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) | 36 | installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) |
28 | 37 | ||
29 | installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) | 38 | installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) |
30 | installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./ | ||
31 | |||
32 | # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. | ||
33 | PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs | ||
34 | $(INSTALL_FW_PATH)/$$(%): install-all-dirs | ||
35 | @true | ||
36 | install-all-dirs: $(installed-fw-dirs) | ||
37 | @true | ||
38 | 39 | ||
39 | quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) | 40 | quiet_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 | ||
48 | PHONY += __fw_install __fw_modinst FORCE | 46 | PHONY += __fw_install __fw_modinst FORCE |