From a5ffea9550ed2d95c70e931b9f45a3f7782a7dfd Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Fri, 25 Feb 2022 16:22:27 -0700 Subject: Makefile: Add a build target for .map We don't currently have a build target defined for .map files. This means they can't be used as a dependency. This change splits the .map creation into its own rule. BUG=b:221231786 TEST=Build guybrush and verify .map still exists Signed-off-by: Raul E Rangel Change-Id: I1ce21902e97390aa9520670299ef08debf4458db Reviewed-on: https://review.coreboot.org/c/coreboot/+/62399 Tested-by: build bot (Jenkins) Reviewed-by: Elyes Haouas Reviewed-by: Martin Roth --- Makefile.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Makefile.inc') diff --git a/Makefile.inc b/Makefile.inc index f58418951bd4..ec2d097b2dda 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -791,11 +791,14 @@ endif $(objcbfs)/%.bin: $(objcbfs)/%.raw.bin cp $< $@ -$(objcbfs)/%.elf: $(objcbfs)/%.debug +$(objcbfs)/%.map: $(objcbfs)/%.debug + $(eval class := $(call find-class,$(@F))) + $(NM_$(class)) -n $< | sort > $(basename $@).map + +$(objcbfs)/%.elf: $(objcbfs)/%.debug $(objcbfs)/%.map $(eval class := $(call find-class,$(@F))) @printf " OBJCOPY $(subst $(obj)/,,$(@))\n" cp $< $@.tmp - $(NM_$(class)) -n $@.tmp | sort > $(basename $@).map $(OBJCOPY_$(class)) --strip-debug $@.tmp $(OBJCOPY_$(class)) --add-gnu-debuglink=$< $@.tmp mv $@.tmp $@ -- cgit v1.2.3