Add compilation size reporting

pull/18/head
Jesse Vincent 9 years ago
parent 30d55a84fe
commit be5a8e13ad

@ -2,6 +2,8 @@
#BOARD_TAG = keyboardio #BOARD_TAG = keyboardio
BOARD = model01 BOARD = model01
MCU = atmega32u4
DEVICE_PORT = /dev/cu.usbmodemHIDO1 DEVICE_PORT = /dev/cu.usbmodemHIDO1
DEVICE_PORT_BOOTLOADER = /dev/cu.usbmodem1421 DEVICE_PORT_BOOTLOADER = /dev/cu.usbmodem1421
ARDUINO_LIBS = ARDUINO_LIBS =
@ -19,8 +21,7 @@ SKETCH=KeyboardioFirmware.ino
HEXFILE_NAME=$(SKETCH)-$(GIT_VERSION).hex OUTPUT_FILE_PREFIX=$(SKETCH)-$(GIT_VERSION)
HEXFILE_PATH=$(OUTPUT_PATH)/$(HEXFILE_NAME)
@ -39,6 +40,8 @@ generate-keymaps:
dirs: dirs:
mkdir -p $(OUTPUT_PATH) mkdir -p $(OUTPUT_PATH)
build: compile size
compile: dirs compile: dirs
$(ARDUINO_PATH)/arduino-builder \ $(ARDUINO_PATH)/arduino-builder \
-hardware $(ARDUINO_PATH)/hardware \ -hardware $(ARDUINO_PATH)/hardware \
@ -50,13 +53,16 @@ compile: dirs
-build-path $(BUILD_PATH) \ -build-path $(BUILD_PATH) \
-ide-version $(ARDUINO_IDE_VERSION) \ -ide-version $(ARDUINO_IDE_VERSION) \
$(SKETCH) $(SKETCH)
cp $(BUILD_PATH)/$(SKETCH).hex $(HEXFILE_PATH); cp $(BUILD_PATH)/$(SKETCH).hex $(OUTPUT_PATH)/$(OUTPUT_FILE_PREFIX).hex
cp $(BUILD_PATH)/$(SKETCH).elf $(OUTPUT_PATH)/$(OUTPUT_FILE_PREFIX).elf
size:
avr-size -C --mcu=$(MCU) $(OUTPUT_PATH)/$(OUTPUT_FILE_PREFIX).elf
reset-device: reset-device:
stty -f $(DEVICE_PORT) 1200 ; stty -f $(DEVICE_PORT) 1200 ;
flash: compile reset-device flash: compile reset-device
sleep 3 sleep 3
$(ARDUINO_TOOLS_PATH)/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega32u4 -cavr109 -P$(DEVICE_PORT_BOOTLOADER) -b57600 -D -Uflash:w:$(HEXFILE_PATH):i $(ARDUINO_TOOLS_PATH)/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -p$(MCU) -cavr109 -P$(DEVICE_PORT_BOOTLOADER) -b57600 -D -Uflash:w:$(HEXFILE_PATH):i

Loading…
Cancel
Save