Makefile-AVR: remove deprecated -C option
replace it with -A and parse this like in the Makefile-ARM
This commit is contained in:
parent
77d8583cca
commit
963a1ad76f
25
Makefile-AVR
25
Makefile-AVR
|
|
@ -163,22 +163,25 @@ program: $(PROGRAM).hex config.h
|
||||||
$(UPLOADER) $(UPLOADER_FLAGS) -U flash:w:$(PROGRAM).hex
|
$(UPLOADER) $(UPLOADER_FLAGS) -U flash:w:$(PROGRAM).hex
|
||||||
|
|
||||||
## Interpret TARGET section sizes wrt different AVR chips.
|
## Interpret TARGET section sizes wrt different AVR chips.
|
||||||
## Usage: $(call show_size,section-name,168-size,328p-size,644p-size,1280-size)
|
## Usage: $(call show_size,section-name,section-regex,168-size,328p-size,644p-size,1280-size)
|
||||||
define show_size
|
define show_size
|
||||||
@$(SIZE) -C $^ | awk '/$1/ { \
|
@$(SIZE) -A $^ | perl -MPOSIX -ne \
|
||||||
printf("%8s %6d bytes %3d%% %3d%% %3d%% %3d%%\n", \
|
'/\.($2)\s+([0-9]+)/g && \
|
||||||
$$1, $$2, \
|
do {$$data += $$2}; \
|
||||||
($$2 * 100 / ($2 * 1024)) + 1, \
|
END { printf "%8s %6d bytes %3d%% %3d%% %3d%% %3d%%\n", \
|
||||||
($$2 * 100 / ($3 * 1024)) + 1, \
|
$1, $$data, \
|
||||||
($$2 * 100 / ($4 * 1024)) + 1, \
|
ceil($$data * 100 / ($3 * 1024)), \
|
||||||
($$2 * 100 / ($5 * 1024)) + 1); }'
|
ceil($$data * 100 / ($4 * 1024)), \
|
||||||
|
ceil($$data * 100 / ($5 * 1024)), \
|
||||||
|
ceil($$data * 100 / ($6 * 1024));\
|
||||||
|
}'
|
||||||
endef
|
endef
|
||||||
|
|
||||||
size: $(BUILDDIR)/$(PROGRAM).elf
|
size: $(BUILDDIR)/$(PROGRAM).elf
|
||||||
@echo "ATmega sizes '168 '328(P) '644(P) '1280"
|
@echo "ATmega sizes '168 '328(P) '644(P) '1280"
|
||||||
$(call show_size,Program,14,30,62,126)
|
$(call show_size,FLASH,text|data|bootloader,14,30,62,126)
|
||||||
$(call show_size,Data,1,2,4,8)
|
$(call show_size,RAM,data|bss|noinit,1,2,4,8)
|
||||||
$(call show_size,EEPROM,1,2,2,4)
|
$(call show_size,EEPROM,eeprom,1,2,2,4)
|
||||||
|
|
||||||
.PHONY: simulavr-check simulavr performancetest
|
.PHONY: simulavr-check simulavr performancetest
|
||||||
simulavr-check:
|
simulavr-check:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue