diff options
| author | Jumail Mundekkat <mundekkat@hotmail.com> | 2019-02-19 05:00:33 +1100 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-02-18 10:00:33 -0800 |
| commit | 149015e799b5d5df49f7e22aa7bce8f607afdd28 (patch) | |
| tree | e95212c7f3534f0ceda29edddef2c6aa4aec0771 /tmk_core | |
| parent | 0cee0764fd9d53d6bb835e2db2340f2541870386 (diff) | |
| download | qmk_firmware-149015e799b5d5df49f7e22aa7bce8f607afdd28.tar.gz qmk_firmware-149015e799b5d5df49f7e22aa7bce8f607afdd28.zip | |
Fixed grep issue in bootloader build target (#3848)
* Changed use of '\s' in grep to '[ \t]' for portability
* Pushed DFU Keyboard.h into a shell script
* Fixed execution permissions on make_dfu_header,sh
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/avr.mk | 9 | ||||
| -rwxr-xr-x | tmk_core/make_dfu_header.sh | 16 |
2 files changed, 17 insertions, 8 deletions
diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 0c3a9624c..d22c3bbca 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk | |||
| @@ -292,14 +292,7 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf | |||
| 292 | 292 | ||
| 293 | bootloader: | 293 | bootloader: |
| 294 | make -C lib/lufa/Bootloaders/DFU/ clean | 294 | make -C lib/lufa/Bootloaders/DFU/ clean |
| 295 | printf "#ifndef QMK_KEYBOARD\n#define QMK_KEYBOARD\n\n" > lib/lufa/Bootloaders/DFU/Keyboard.h | 295 | $(TMK_DIR)/make_dfu_header.sh $(ALL_CONFIGS) |
| 296 | printf "%s\n" "`$(GREP) "MANUFACTURER\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h | ||
| 297 | printf "%s Bootloader\n" "`$(GREP) "PRODUCT\s" $(ALL_CONFIGS) -h | tail -1 | tr -d '\r'`" >> lib/lufa/Bootloaders/DFU/Keyboard.h | ||
| 298 | printf "%s\n" "`$(GREP) "QMK_ESC_OUTPUT\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h | ||
| 299 | printf "%s\n" "`$(GREP) "QMK_ESC_INPUT\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h | ||
| 300 | printf "%s\n" "`$(GREP) "QMK_LED\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h | ||
| 301 | printf "%s\n" "`$(GREP) "QMK_SPEAKER\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h | ||
| 302 | printf "\n#endif" >> lib/lufa/Bootloaders/DFU/Keyboard.h | ||
| 303 | make -C lib/lufa/Bootloaders/DFU/ | 296 | make -C lib/lufa/Bootloaders/DFU/ |
| 304 | printf "BootloaderDFU.hex copied to $(TARGET)_bootloader.hex\n" | 297 | printf "BootloaderDFU.hex copied to $(TARGET)_bootloader.hex\n" |
| 305 | cp lib/lufa/Bootloaders/DFU/BootloaderDFU.hex $(TARGET)_bootloader.hex | 298 | cp lib/lufa/Bootloaders/DFU/BootloaderDFU.hex $(TARGET)_bootloader.hex |
diff --git a/tmk_core/make_dfu_header.sh b/tmk_core/make_dfu_header.sh new file mode 100755 index 000000000..49ba66251 --- /dev/null +++ b/tmk_core/make_dfu_header.sh | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | ALL_CONFIGS=$* | ||
| 3 | GREP="grep" | ||
| 4 | |||
| 5 | cat <<- EOF > lib/lufa/Bootloaders/DFU/Keyboard.h | ||
| 6 | #ifndef QMK_KEYBOARD | ||
| 7 | #define QMK_KEYBOARD | ||
| 8 | |||
| 9 | $($GREP "MANUFACTURER[ \t]" $ALL_CONFIGS -h | tail -1) | ||
| 10 | $($GREP "PRODUCT[ \t]" $ALL_CONFIGS -h | tail -1 | tr -d '\r') Bootloader | ||
| 11 | $($GREP "QMK_ESC_OUTPUT[ \t]" $ALL_CONFIGS -h | tail -1) | ||
| 12 | $($GREP "QMK_ESC_INPUT[ \t]" $ALL_CONFIGS -h | tail -1) | ||
| 13 | $($GREP "QMK_LED[ \t]" $ALL_CONFIGS -h | tail -1) | ||
| 14 | $($GREP "QMK_SPEAKER[ \t]" $ALL_CONFIGS -h | tail -1) | ||
| 15 | #endif | ||
| 16 | EOF | ||
