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 <rrangel@chromium.org>
Change-Id: I1ce21902e97390aa9520670299ef08debf4458db
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62399
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Raul E Rangel 2022-02-25 16:22:27 -07:00 committed by Martin Roth
parent dd6efce934
commit a5ffea9550
1 changed files with 5 additions and 2 deletions

View File

@ -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 $@