[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>
This commit is contained in:
Michael Brown
2010-05-30 15:29:05 +01:00
parent d2415be069
commit 6c0e8c14be
22 changed files with 1499 additions and 391 deletions

View File

@@ -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.
#
@@ -902,6 +914,15 @@ $(ICCFIX) : util/iccfix.c $(MAKEDEPS)
$(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
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