From de62693b6d693a8ae244f24d3d54cb62cea853ef Mon Sep 17 00:00:00 2001 From: Silver Kits Date: Tue, 11 Oct 2016 12:08:53 +0300 Subject: [PATCH] Add make size target. This target can be used to print firmware memory usage in AVR format --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 941fa71..fa74ada 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ CC = avr-gcc OBJCOPY = avr-objcopy AVRDUDE = avrdude CODE_FORMATTER = tooling/format-code.sh +AVRSIZE = avr-size BOARD = atmega2560 @@ -62,6 +63,9 @@ AVRDUDEARGS = -p $(BOARD) \ -V \ -D +AVRSIZEARGS = -C \ + --mcu=$(BOARD) + all: $(ELF) $(TARGET) %.o : %.c @@ -85,4 +89,7 @@ install: format: $(CODE_FORMATTER) $(SRC) -.PHONY: clean install format \ No newline at end of file +size: + $(AVRSIZE) $(AVRSIZEARGS) $(ELF) + +.PHONY: clean install format size