From 6c0e8c14be9546b49c097f5e6e8307bda3e7f5ac Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 30 May 2010 15:29:05 +0100 Subject: [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 --- src/Makefile.housekeeping | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/Makefile.housekeeping') 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. # @@ -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 -- cgit v1.2.3-55-g7522