init
This commit is contained in:
40
scenario5-debug-symbols/Makefile
Normal file
40
scenario5-debug-symbols/Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
CC = gcc
|
||||
CFLAGS_BASE = -O2 -Wall
|
||||
|
||||
all: nodebug withdebug
|
||||
|
||||
nodebug: program.c
|
||||
$(CC) $(CFLAGS_BASE) -o $@ $< -lm
|
||||
|
||||
withdebug: program.c
|
||||
$(CC) $(CFLAGS_BASE) -g -o $@ $< -lm
|
||||
|
||||
# Show the size difference
|
||||
sizes: nodebug withdebug
|
||||
@echo "File sizes:"
|
||||
@ls -lh nodebug withdebug
|
||||
@echo ""
|
||||
@echo "Section sizes (nodebug):"
|
||||
@size nodebug
|
||||
@echo ""
|
||||
@echo "Section sizes (withdebug):"
|
||||
@size withdebug
|
||||
|
||||
# Show symbols
|
||||
symbols: nodebug withdebug
|
||||
@echo "Symbols in nodebug:"
|
||||
@nm nodebug | grep -E "compute|process|main" || true
|
||||
@echo ""
|
||||
@echo "Symbols in withdebug:"
|
||||
@nm withdebug | grep -E "compute|process|main" || true
|
||||
|
||||
# Strip the debug version to show what happens
|
||||
stripped: withdebug
|
||||
cp withdebug stripped
|
||||
strip stripped
|
||||
@echo "Stripped file created"
|
||||
|
||||
clean:
|
||||
rm -f nodebug withdebug stripped perf.data perf.data.old
|
||||
|
||||
.PHONY: all sizes symbols clean stripped
|
||||
Reference in New Issue
Block a user