path: root/firmware
diff options
authorMichal Marek <>2014-07-08 14:38:33 +0200
committerMichal Marek <>2014-07-09 15:16:35 +0200
commitdd5a6752ae7df4e0ba6ce3bcd0c3b4489bb3537f (patch)
tree4ec2a4aa8c23dcf41a7a62ffbd2510a8e0fe1f29 /firmware
parentc79624c1a698a82747b1e6fe54cc7effa4c07aa5 (diff)
firmware: Create directories for external firmware
Commit 5180d5f4 ("firmware: Simplify directory creation") broke including firmware specified in CONFIG_EXTRA_FIRMWARE: MK_FW firmware/amd-ucode/microcode_amd.bin.gen.S /bin/sh: firmware/amd-ucode/microcode_amd.bin.gen.S: No such file or directory ... firmware/Makefile:185: recipe for target 'firmware/amd-ucode/microcode_amd.bin.gen.S' failed It works with O= builds, because the directory is created by Create the directory in firmware/Makefile in non-O builds. Reported-and-tested-by: Ronald Uitermark <> Reported-and-tested-by: Torsten Kaiser <> Signed-off-by: Michal Marek <>
Diffstat (limited to 'firmware')
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
index 5747417..0862d34 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -219,6 +219,12 @@ $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep)
obj-y += $(patsubst %,%.gen.o, $(fw-external-y))
obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y))
+ifeq ($(KBUILD_SRC),)
+# only creates subdirectories for O= builds, but external
+# firmware might live outside the kernel source tree
+_dummy := $(foreach d,$(addprefix $(obj)/,$(dir $(fw-external-y))), $(shell [ -d $(d) ] || mkdir -p $(d)))
# Remove .S files and binaries created from ihex
# (during 'make clean' .config isn't included so they're all in $(fw-shipped-))
targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
OpenPOWER on IntegriCloud