[COMMON] support exynos in-kernel firmware
[GitHub/moto-9609/android_kernel_motorola_exynos9610.git] / firmware / Makefile
index fa0808853883e3715ec413a54602f37ae3432121..83fbcf2f5275fd52b2c38f6b44393dff6c6cd2cf 100644 (file)
@@ -1,7 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0
 #
 # kbuild file for firmware/
 #
 
+CONFIG_EXTRA_FIRMWARE_DIR="firmware"
+
 # Create $(fwabs) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a
 # leading /, it's relative to $(srctree).
 fwdir := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR))
@@ -41,13 +44,17 @@ wordsize_deps := $(wildcard include/config/64bit.h include/config/32bit.h \
                include/config/x86_32.h include/config/x86_64.h \
                firmware/Makefile)
 
-$(patsubst %,$(obj)/%.gen.S, $(fw-external-y)): %: $(wordsize_deps) \
-               include/config/extra/firmware/dir.h
+$(patsubst %,$(obj)/%.gen.S, $(fw-external-y)): %: $(wordsize_deps)
        $(call cmd,fwbin,$(fwabs)/$(patsubst $(obj)/%.gen.S,%,$@))
 
 # The .o files depend on the binaries directly; the .S files don't.
 $(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/%
 
+# .ihex is used just as a simple way to hold binary files in a source tree
+# where binaries are frowned upon. They are directly converted with objcopy.
+$(obj)/%: $(obj)/%.ihex
+       $(call cmd,ihex)
+
 obj-y                           += $(patsubst %,%.gen.o, $(fw-external-y))
 
 ifeq ($(KBUILD_SRC),)