aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
authora_p_u_r_o <applause@elfmimi.jp>2019-11-24 01:01:03 +0900
committerfauxpark <fauxpark@gmail.com>2019-11-24 03:01:03 +1100
commit7874f297b384893a842e5d5cd953264eb3561b7c (patch)
tree0d8bf5c51c751cdb09c74cdbd82043a7031ef98d /tmk_core
parent3541f01a72c4bf2e284d6c96b9697d29c68a47bd (diff)
downloadfirmware-7874f297b384893a842e5d5cd953264eb3561b7c.tar.gz
firmware-7874f297b384893a842e5d5cd953264eb3561b7c.tar.bz2
firmware-7874f297b384893a842e5d5cd953264eb3561b7c.zip
Remove CR when computing BOOTLOADER_SIZE. (#7453)
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/avr.mk2
-rw-r--r--tmk_core/rules.mk2
2 files changed, 2 insertions, 2 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk
index 1846a9b4b..8207394d7 100644
--- a/tmk_core/avr.mk
+++ b/tmk_core/avr.mk
@@ -321,7 +321,7 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf
bootloader:
make -C lib/lufa/Bootloaders/DFU/ clean
$(TMK_DIR)/make_dfu_header.sh $(ALL_CONFIGS)
- $(eval MAX_SIZE=$(shell n=`$(CC) -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 MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
$(eval PROGRAM_SIZE_KB=$(shell n=`expr $(MAX_SIZE) / 1024` && echo $$(($$n)) || echo 0))
$(eval BOOT_SECTION_SIZE_KB=$(shell n=`expr $(BOOTLOADER_SIZE) / 1024` && echo $$(($$n)) || echo 0))
$(eval FLASH_SIZE_KB=$(shell n=`expr $(PROGRAM_SIZE_KB) + $(BOOT_SECTION_SIZE_KB)` && echo $$(($$n)) || echo 0))
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 31bce33c3..334ff314b 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -397,7 +397,7 @@ ifeq ($(findstring avr-gcc,$(CC)),avr-gcc)
SIZE_MARGIN = 1024
check-size:
- $(eval MAX_SIZE=$(shell n=`$(CC) -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 MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/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))
$(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE)))
$(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE)))