diff options
author | Michael F. Lamb <mike@datagrok.org> | 2018-02-06 16:32:31 -0800 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2018-02-08 16:47:18 -0500 |
commit | fca31693df15f62cc3fd5851a0d1bae40eb179c2 (patch) | |
tree | 3ff75aaa46d59a409c69febc552d89c3c86d80d8 /tmk_core/rules.mk | |
parent | fae81322959a2e6877238ca4e542cac805a2e7c2 (diff) |
add conditional to perform check-size only for supported architectures
Diffstat (limited to 'tmk_core/rules.mk')
-rw-r--r-- | tmk_core/rules.mk | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 18aef8d8ca..ff6af4a882 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -370,6 +370,7 @@ show_path: @echo SRC=$(SRC) @echo OBJ=$(OBJ) +ifeq ($(CC),avr-gcc) check-size: $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'`; echo $$(($$n)) || echo 0)) $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) @@ -377,6 +378,10 @@ check-size: $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then $(PRINT_WARNING_PLAIN); $(SILENT) || printf " * $(MSG_FILE_TOO_BIG)" ; else $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; fi \ fi +else +check-size: + echo "(Firmware size check does not yet support $(MCU) microprocessors; skipping.)" +endif # Create build directory $(shell mkdir -p $(BUILD_DIR) 2>/dev/null) |