diff options
| author | U-LANDSRAAD\drashna <drashna@live.com> | 2018-03-29 12:26:09 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-03-29 15:38:42 -0400 |
| commit | c2bec5b3f0149758f89ad6b84ea8781fde41fce1 (patch) | |
| tree | de3c7e83dd5ecde8713f5aa1c65bddf63a1f2115 /tmk_core | |
| parent | fb34fdbbc969435917917f447bca12261f7d4498 (diff) | |
| download | qmk_firmware-c2bec5b3f0149758f89ad6b84ea8781fde41fce1.tar.gz qmk_firmware-c2bec5b3f0149758f89ad6b84ea8781fde41fce1.zip | |
Properly always copy firmware
This finishes fixing #2314, which mostly copies the firmware when compiling.
However, it misses `:teensy`, `:avrdude` and most importantly, `:production`
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/avr.mk | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index eb55dba95..bd58bd285 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk | |||
| @@ -9,7 +9,7 @@ SIZE = avr-size | |||
| 9 | AR = avr-ar rcs | 9 | AR = avr-ar rcs |
| 10 | NM = avr-nm | 10 | NM = avr-nm |
| 11 | HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature | 11 | HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature |
| 12 | EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) | 12 | EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) |
| 13 | BIN = | 13 | BIN = |
| 14 | 14 | ||
| 15 | COMMON_VPATH += $(DRIVER_PATH)/avr | 15 | COMMON_VPATH += $(DRIVER_PATH)/avr |
| @@ -124,16 +124,16 @@ qmk: $(BUILD_DIR)/$(TARGET).hex | |||
| 124 | program: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep check-size | 124 | program: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep check-size |
| 125 | $(PROGRAM_CMD) | 125 | $(PROGRAM_CMD) |
| 126 | 126 | ||
| 127 | teensy: $(BUILD_DIR)/$(TARGET).hex check-size | 127 | teensy: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware |
| 128 | $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(BUILD_DIR)/$(TARGET).hex | 128 | $(TEENSY_LOADER_CLI) -mmcu=$(MCU) -w -v $(BUILD_DIR)/$(TARGET).hex |
| 129 | 129 | ||
| 130 | BATCHISP ?= batchisp | 130 | BATCHISP ?= batchisp |
| 131 | 131 | ||
| 132 | flip: $(BUILD_DIR)/$(TARGET).hex check-size | 132 | flip: $(BUILD_DIR)/$(TARGET).hex check-size |
| 133 | $(BATCHISP) -hardware usb -device $(MCU) -operation erase f | 133 | $(BATCHISP) -hardware usb -device $(MCU) -operation erase f |
| 134 | $(BATCHISP) -hardware usb -device $(MCU) -operation loadbuffer $(BUILD_DIR)/$(TARGET).hex program | 134 | $(BATCHISP) -hardware usb -device $(MCU) -operation loadbuffer $(BUILD_DIR)/$(TARGET).hex program |
| 135 | $(BATCHISP) -hardware usb -device $(MCU) -operation start reset 0 | 135 | $(BATCHISP) -hardware usb -device $(MCU) -operation start reset 0 |
| 136 | 136 | ||
| 137 | DFU_PROGRAMMER ?= dfu-programmer | 137 | DFU_PROGRAMMER ?= dfu-programmer |
| 138 | GREP ?= grep | 138 | GREP ?= grep |
| 139 | 139 | ||
| @@ -169,7 +169,7 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep | |||
| 169 | fi | 169 | fi |
| 170 | $(DFU_PROGRAMMER) $(MCU) reset | 170 | $(DFU_PROGRAMMER) $(MCU) reset |
| 171 | 171 | ||
| 172 | avrdude: $(BUILD_DIR)/$(TARGET).hex check-size | 172 | avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware |
| 173 | if $(GREP) -q -s Microsoft /proc/version; then \ | 173 | if $(GREP) -q -s Microsoft /proc/version; then \ |
| 174 | echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \ | 174 | echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \ |
| 175 | else \ | 175 | else \ |
| @@ -199,7 +199,7 @@ bin: $(BUILD_DIR)/$(TARGET).hex | |||
| 199 | 199 | ||
| 200 | # copy bin to FLASH.bin | 200 | # copy bin to FLASH.bin |
| 201 | flashbin: bin | 201 | flashbin: bin |
| 202 | $(COPY) $(BUILD_DIR)/$(TARGET).bin FLASH.bin; | 202 | $(COPY) $(BUILD_DIR)/$(TARGET).bin FLASH.bin; |
| 203 | 203 | ||
| 204 | # Generate avr-gdb config/init file which does the following: | 204 | # Generate avr-gdb config/init file which does the following: |
| 205 | # define the reset signal, load the target file, connect to target, and set | 205 | # define the reset signal, load the target file, connect to target, and set |
| @@ -250,7 +250,7 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf | |||
| 250 | @$(SECHO) $(MSG_EXTENDED_COFF) $(BUILD_DIR)/$(TARGET).cof | 250 | @$(SECHO) $(MSG_EXTENDED_COFF) $(BUILD_DIR)/$(TARGET).cof |
| 251 | $(COFFCONVERT) -O coff-ext-avr $< $(BUILD_DIR)/$(TARGET).cof | 251 | $(COFFCONVERT) -O coff-ext-avr $< $(BUILD_DIR)/$(TARGET).cof |
| 252 | 252 | ||
| 253 | bootloader: | 253 | bootloader: |
| 254 | make -C lib/lufa/Bootloaders/DFU/ clean | 254 | make -C lib/lufa/Bootloaders/DFU/ clean |
| 255 | echo -e "#ifndef QMK_KEYBOARD\n#define QMK_KEYBOARD\n" > lib/lufa/Bootloaders/DFU/Keyboard.h | 255 | echo -e "#ifndef QMK_KEYBOARD\n#define QMK_KEYBOARD\n" > lib/lufa/Bootloaders/DFU/Keyboard.h |
| 256 | echo -e `$(GREP) "MANUFACTURER" $(ALL_CONFIGS) -h | tail -1` >> lib/lufa/Bootloaders/DFU/Keyboard.h | 256 | echo -e `$(GREP) "MANUFACTURER" $(ALL_CONFIGS) -h | tail -1` >> lib/lufa/Bootloaders/DFU/Keyboard.h |
| @@ -264,7 +264,7 @@ bootloader: | |||
| 264 | echo -e "BootloaderDFU.hex copied to $(TARGET)_bootloader.hex" | 264 | echo -e "BootloaderDFU.hex copied to $(TARGET)_bootloader.hex" |
| 265 | cp lib/lufa/Bootloaders/DFU/BootloaderDFU.hex $(TARGET)_bootloader.hex | 265 | cp lib/lufa/Bootloaders/DFU/BootloaderDFU.hex $(TARGET)_bootloader.hex |
| 266 | 266 | ||
| 267 | production: $(BUILD_DIR)/$(TARGET).hex bootloader | 267 | production: $(BUILD_DIR)/$(TARGET).hex bootloader cpfirmware |
| 268 | @cat $(BUILD_DIR)/$(TARGET).hex | awk '/^:00000001FF/ == 0' > $(TARGET)_production.hex | 268 | @cat $(BUILD_DIR)/$(TARGET).hex | awk '/^:00000001FF/ == 0' > $(TARGET)_production.hex |
| 269 | @cat $(TARGET)_bootloader.hex >> $(TARGET)_production.hex | 269 | @cat $(TARGET)_bootloader.hex >> $(TARGET)_production.hex |
| 270 | echo "File sizes:" | 270 | echo "File sizes:" |
