Add make size target. This target can be used to print firmware memory usage in AVR format

This commit is contained in:
Silver Kits 2016-10-11 12:08:53 +03:00
parent 40c0ac6888
commit de62693b6d

View File

@ -8,6 +8,7 @@ CC = avr-gcc
OBJCOPY = avr-objcopy OBJCOPY = avr-objcopy
AVRDUDE = avrdude AVRDUDE = avrdude
CODE_FORMATTER = tooling/format-code.sh CODE_FORMATTER = tooling/format-code.sh
AVRSIZE = avr-size
BOARD = atmega2560 BOARD = atmega2560
@ -62,6 +63,9 @@ AVRDUDEARGS = -p $(BOARD) \
-V \ -V \
-D -D
AVRSIZEARGS = -C \
--mcu=$(BOARD)
all: $(ELF) $(TARGET) all: $(ELF) $(TARGET)
%.o : %.c %.o : %.c
@ -85,4 +89,7 @@ install:
format: format:
$(CODE_FORMATTER) $(SRC) $(CODE_FORMATTER) $(SRC)
.PHONY: clean install format size:
$(AVRSIZE) $(AVRSIZEARGS) $(ELF)
.PHONY: clean install format size