diff --git a/.gitignore b/.gitignore index b7bdca1..5f82de9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ *~ *.swp -*.hex *.eep *.elf +*.hex +*.map *.o *.o.dep diff --git a/src/makefile b/src/makefile index bea17a9..367fa3e 100644 --- a/src/makefile +++ b/src/makefile @@ -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 # -----------------------------------------------------------------------------