makefile now generates a .map

partial-rewrite
Ben Blazak 2012-06-11 16:11:56 -07:00
parent 3322844ed0
commit e37ff92137
2 changed files with 13 additions and 4 deletions

3
.gitignore vendored
View File

@ -1,9 +1,10 @@
*~
*.swp
*.hex
*.eep
*.elf
*.hex
*.map
*.o
*.o.dep

View File

@ -76,7 +76,9 @@ CFLAGS += -fdata-sections # / section in the output file if the
# unused code.
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LDFLAGS = -Wl,--relax # for some linker optimizations
LDFLAGS = -Wl,-Map=$(strip $(TARGET)).map,--cref # generate a link map, with
# a cross reference table
LDFLAGS += -Wl,--relax # for some linker optimizations
LDFLAGS += -Wl,--gc-sections # discard unused functions and data
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
@ -123,8 +125,14 @@ clean:
cd .. ; git clean -dX # remove ignored files and directories
# availability: linux
dist-hex: clean all
mv firmware.hex 'ergodox-firmware--$(shell git branch -l | grep '*' | cut -c 3-)--$(shell date +'%Y%m%d_%H%M%S').hex'
dist: clean all
name='ergodox-firmware'; \
branch='$(shell git branch -l | grep '*' | cut -c 3-)'; \
date='$(shell date +'%Y%m%d_%H%M%S')'; \
\
zip "$$name--$$branch--$$date.zip" "$(TARGET).hex" "$(TARGET).map"; \
\
make clean
# -----------------------------------------------------------------------------