summaryrefslogtreecommitdiffstats
path: root/src/Makefile.housekeeping
diff options
context:
space:
mode:
authorMichael Brown2010-05-30 16:29:05 +0200
committerMichael Brown2010-05-31 04:11:57 +0200
commit6c0e8c14be9546b49c097f5e6e8307bda3e7f5ac (patch)
treeb04dd064c978bf0525649e9d1b936a9724deadaf /src/Makefile.housekeeping
parent[pxe] Remove obsolete pxe_errortab.c (diff)
downloadipxe-6c0e8c14be9546b49c097f5e6e8307bda3e7f5ac.tar.gz
ipxe-6c0e8c14be9546b49c097f5e6e8307bda3e7f5ac.tar.xz
ipxe-6c0e8c14be9546b49c097f5e6e8307bda3e7f5ac.zip
[libc] Enable automated extraction of error usage reports
Add preprocessor magic to the error definitions to enable every error usage to be tracked. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r--src/Makefile.housekeeping21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
index 2562e623..0d94987f 100644
--- a/src/Makefile.housekeeping
+++ b/src/Makefile.housekeeping
@@ -550,6 +550,18 @@ $(BIN)/embedded.o : override CC := env CCACHE_DISABLE=1 $(CC)
CFLAGS_embedded = -DEMBED_ALL="$(EMBED_ALL)"
+# Generate error usage information
+#
+$(BIN)/%.einfo : $(BIN)/%.o
+ $(QM)$(ECHO) " [EINFO] $@"
+ $(Q)$(OBJCOPY) -O binary -j .einfo --set-section-flags .einfo=alloc \
+ $< $@
+
+EINFOS := $(patsubst $(BIN)/%.o,$(BIN)/%.einfo,$(BOBJS))
+$(BIN)/errors : $(EINFOS) $(EINFO)
+ $(QM)$(ECHO) " [EINFO] $@"
+ $(Q)$(EINFO) $(EINFOS) | sort > $@
+
# Generate the NIC file from the parsed source files. The NIC file is
# only for rom-o-matic.
#
@@ -904,6 +916,15 @@ CLEANUP += $(ICCFIX)
###############################################################################
#
+# The error usage information utility
+#
+$(EINFO) : util/einfo.c $(MAKEDEPS)
+ $(QM)$(ECHO) " [HOSTCC] $@"
+ $(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
+CLEANUP += $(EINFO)
+
+###############################################################################
+#
# Local configs
#
config/local/%.h :