-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmk_core_rules.mk.patch
17 lines (15 loc) · 1.15 KB
/
tmk_core_rules.mk.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
## ruslanas@kaledos:~/qmk_firmware$ git diff tmk_core/rules.mk
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index fc2dc68be2..57d39d20fd 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -458,7 +458,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 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
+ $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) -D__ASSEMBLER__ $(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)))
ruslanas@kaledos:~/qmk_firmware$
### https://gist.github.com/sigprof/8d85837036f7c96b6da63f4eb5fe0bd5