diff --git a/src/arch/arduino-nano-168/Makefile.inc b/src/arch/arduino-nano-168/Makefile.inc index 61492dbb96088ba6761dcebfdc3f36b8abb25f33..d89bf6dca7300a2b02d523881daf39738d557491 100644 --- a/src/arch/arduino-nano-168/Makefile.inc +++ b/src/arch/arduino-nano-168/Makefile.inc @@ -79,6 +79,7 @@ OBJECTS = ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} build/system.elf: ${OBJECTS} ${QUIET}${CXX} ${COMMON_FLAGS} ${CXXFLAGS} -Wl,--gc-sections -o $@ ${OBJECTS} ${QUIET}avr-size --format=avr --mcu=${MCU} $@ + ${QUIET}test $$(avr-size --format=avr --mcu=${MCU} build/system.elf | fgrep Program | grep -o '[0-9.]*%' | cut -d . -f 1) -lt 100 build/system.hex: build/system.elf ${QUIET}${OBJCOPY} -O ihex ${@:.hex=.elf} $@ diff --git a/src/arch/arduino-nano/Makefile.inc b/src/arch/arduino-nano/Makefile.inc index 889668147ba52bc654bdabaa9da2ee920f641ee0..50109ebba9ea9a74d18c8c8dd454afcb79a40a68 100644 --- a/src/arch/arduino-nano/Makefile.inc +++ b/src/arch/arduino-nano/Makefile.inc @@ -79,6 +79,7 @@ OBJECTS = ${CXX_TARGETS:.cc=.o} ${C_TARGETS:.c=.o} build/system.elf: ${OBJECTS} ${QUIET}${CXX} ${COMMON_FLAGS} ${CXXFLAGS} -Wl,--gc-sections -o $@ ${OBJECTS} ${QUIET}avr-size --format=avr --mcu=${MCU} $@ + ${QUIET}test $$(avr-size --format=avr --mcu=${MCU} build/system.elf | fgrep Program | grep -o '[0-9.]*%' | cut -d . -f 1) -lt 100 build/system.hex: build/system.elf ${QUIET}${OBJCOPY} -O ihex ${@:.hex=.elf} $@