summaryrefslogtreecommitdiff
path: root/Makefile.inc
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile.inc b/Makefile.inc
index ff77747a5b..6225152b13 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -278,6 +278,18 @@ cbfs-files-processor-defconfig= \
\mv -f $(2).tmp $(2))
#######################################################################
+# Compile a C file with a bare struct definition into binary
+# arg1: C source file
+# arg2: binary file
+cbfs-files-processor-struct= \
+ $(eval $(2): $(1) $(obj)/build.h $(KCONFIG_AUTOHEADER); \
+ printf " CC+STRIP $(@)\n"; \
+ $(CC_ramstage) -MMD $(CPPFLAGS_ramstage) $(CFLAGS_ramstage) $(ramstage-c-ccopts) -include $(KCONFIG_AUTOHEADER) -MT $(2) -o $(2).tmp -c $(1) && \
+ $(OBJCOPY_ramstage) -O binary $(2).tmp $(2); \
+ rm -f $(2).tmp) \
+ $(eval DEPENDENCIES += $(2).d)
+
+#######################################################################
# Add handler for arbitrary files in CBFS
$(call add-special-class,cbfs-files)
cbfs-files-handler= \