diff options
| author | Drashna Jaelre <drashna@live.com> | 2019-02-12 16:46:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-12 16:46:04 -0800 |
| commit | d3f7910e680379edd80f8fbe76dd756f7f35c0f3 (patch) | |
| tree | 05dea40555dd9ee481d005eed1124cd1933ad0e3 | |
| parent | c5e10b7203f140e747ac3a95b6964c52110e07df (diff) | |
| download | qmk_firmware-d3f7910e680379edd80f8fbe76dd756f7f35c0f3.tar.gz qmk_firmware-d3f7910e680379edd80f8fbe76dd756f7f35c0f3.zip | |
Remove AUTOGEN and fix Travis Compiled Push scripts (#5077)
* Grab HEX and BIN files from autogen
And push them to qmk.fm/compiled
* Make autogen copy extension agnostic
This way, when travis cl scrpit looks for hex files, it will actually grab bin files, and not hex files for ARM boards
* Handle the AUTOGEN in :bin target to properly handle edge cases
Both the TADA68 and ATSAM boards generate the hex file and then convert it to a bin file. The changes I made does not handle this well, at all. This removes the hex and replaces it with a bin, if a bin is normally generated.
* Revert hex target to original copy command
* Check hex and bin separately in compile push script
Since I don't know how to script this, well
* Simplify push to compiled folder
* Further simplify compiled push script
* Move AUTOGEN parsing to a more sane location to prevent tech debt
Thanks to skully!
* Remove AUTOGEN completely, as it's not needed
This has the benefit of making everything super simple, since we can pull every hex and bin from the root of the qmk_firmware folder, and move that to th compiled folder. This also removes old and unneeded code, and removes some tech debt that has been accrued, without adding more, in theory.
| -rw-r--r-- | .travis.yml | 2 | ||||
| -rw-r--r-- | tmk_core/rules.mk | 13 | ||||
| -rwxr-xr-x | util/travis_build.sh | 12 | ||||
| -rwxr-xr-x | util/travis_compiled_push.sh | 7 |
4 files changed, 13 insertions, 21 deletions
diff --git a/.travis.yml b/.travis.yml index 6cfc9e067..41a101997 100644 --- a/.travis.yml +++ b/.travis.yml | |||
| @@ -20,7 +20,7 @@ before_script: | |||
| 20 | - avr-gcc --version | 20 | - avr-gcc --version |
| 21 | script: | 21 | script: |
| 22 | - git rev-parse --short HEAD | 22 | - git rev-parse --short HEAD |
| 23 | - make test:all AUTOGEN=false | 23 | - make test:all |
| 24 | - bash util/travis_build.sh | 24 | - bash util/travis_build.sh |
| 25 | - bash util/travis_docs.sh | 25 | - bash util/travis_docs.sh |
| 26 | addons: | 26 | addons: |
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 2e419dd66..c43f14292 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk | |||
| @@ -48,9 +48,6 @@ FORMAT = ihex | |||
| 48 | # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) | 48 | # (Note: 3 is not always the best optimization level. See avr-libc FAQ.) |
| 49 | OPT = s | 49 | OPT = s |
| 50 | 50 | ||
| 51 | AUTOGEN ?= false | ||
| 52 | |||
| 53 | |||
| 54 | # Compiler flag to set the C Standard level. | 51 | # Compiler flag to set the C Standard level. |
| 55 | # c89 = "ANSI" C | 52 | # c89 = "ANSI" C |
| 56 | # gnu89 = c89 plus GCC extensions | 53 | # gnu89 = c89 plus GCC extensions |
| @@ -142,7 +139,7 @@ CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst) | |||
| 142 | # files -- see avr-libc docs [FIXME: not yet described there] | 139 | # files -- see avr-libc docs [FIXME: not yet described there] |
| 143 | # -listing-cont-lines: Sets the maximum number of continuation lines of hex | 140 | # -listing-cont-lines: Sets the maximum number of continuation lines of hex |
| 144 | # dump that will be displayed for a given single line of source input. | 141 | # dump that will be displayed for a given single line of source input. |
| 145 | ASFLAGS += $(ADEFS) | 142 | ASFLAGS += $(ADEFS) |
| 146 | ifndef SKIP_DEBUG_INFO | 143 | ifndef SKIP_DEBUG_INFO |
| 147 | ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 | 144 | ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 |
| 148 | else | 145 | else |
| @@ -260,10 +257,6 @@ gccversion : | |||
| 260 | @$(SILENT) || printf "$(MSG_FLASH) $@" | $(AWK_CMD) | 257 | @$(SILENT) || printf "$(MSG_FLASH) $@" | $(AWK_CMD) |
| 261 | $(eval CMD=$(HEX) $< $@) | 258 | $(eval CMD=$(HEX) $< $@) |
| 262 | @$(BUILD_CMD) | 259 | @$(BUILD_CMD) |
| 263 | @if $(AUTOGEN); then \ | ||
| 264 | $(SILENT) || printf "Copying $(TARGET).hex to keymaps/$(KEYMAP)/$(TARGET).hex\n"; \ | ||
| 265 | $(COPY) $@ $(KEYMAP_PATH)/$(TARGET).hex; \ | ||
| 266 | fi | ||
| 267 | 260 | ||
| 268 | %.eep: %.elf | 261 | %.eep: %.elf |
| 269 | @$(SILENT) || printf "$(MSG_EEPROM) $@" | $(AWK_CMD) | 262 | @$(SILENT) || printf "$(MSG_EEPROM) $@" | $(AWK_CMD) |
| @@ -297,7 +290,7 @@ BEGIN = gccversion sizebefore | |||
| 297 | @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) | 290 | @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) |
| 298 | $(eval CMD=$(CC) $(ALL_CFLAGS) $(filter-out %.txt,$^) --output $@ $(LDFLAGS)) | 291 | $(eval CMD=$(CC) $(ALL_CFLAGS) $(filter-out %.txt,$^) --output $@ $(LDFLAGS)) |
| 299 | @$(BUILD_CMD) | 292 | @$(BUILD_CMD) |
| 300 | 293 | ||
| 301 | 294 | ||
| 302 | define GEN_OBJRULE | 295 | define GEN_OBJRULE |
| 303 | $1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC)) | 296 | $1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC)) |
| @@ -371,7 +364,7 @@ DEPS = $(patsubst %.o,%.d,$(patsubst %.a,%.o,$(OBJ))) | |||
| 371 | .PRECIOUS: $(DEPS) | 364 | .PRECIOUS: $(DEPS) |
| 372 | # Empty rule to force recompilation if the .d file is missing | 365 | # Empty rule to force recompilation if the .d file is missing |
| 373 | $(DEPS): | 366 | $(DEPS): |
| 374 | 367 | ||
| 375 | 368 | ||
| 376 | $(foreach OUTPUT,$(OUTPUTS),$(eval $(call GEN_OBJRULE,$(OUTPUT)))) | 369 | $(foreach OUTPUT,$(OUTPUTS),$(eval $(call GEN_OBJRULE,$(OUTPUT)))) |
| 377 | 370 | ||
diff --git a/util/travis_build.sh b/util/travis_build.sh index d12a87a94..a25d871e2 100755 --- a/util/travis_build.sh +++ b/util/travis_build.sh | |||
| @@ -5,9 +5,9 @@ | |||
| 5 | 5 | ||
| 6 | TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" | 6 | TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE:-none}" |
| 7 | TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" | 7 | TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" |
| 8 | MAKE_ALL="make all:default AUTOGEN=\"true\"" | 8 | MAKE_ALL="make all:default" |
| 9 | 9 | ||
| 10 | if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then | 10 | if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then |
| 11 | exit_code=0 | 11 | exit_code=0 |
| 12 | git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | 12 | git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} |
| 13 | if [ $? -eq 128 ]; then | 13 | if [ $? -eq 128 ]; then |
| @@ -30,15 +30,15 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then | |||
| 30 | KEYMAP_ONLY=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/'${KB}'/keymaps/)' | wc -l) | 30 | KEYMAP_ONLY=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/'${KB}'/keymaps/)' | wc -l) |
| 31 | if [[ $KEYMAP_ONLY -gt 0 ]]; then | 31 | if [[ $KEYMAP_ONLY -gt 0 ]]; then |
| 32 | echo "Making all keymaps for $KB" | 32 | echo "Making all keymaps for $KB" |
| 33 | make ${KB}:all AUTOGEN=true | 33 | make ${KB}:all |
| 34 | : $((exit_code = $exit_code + $?)) | 34 | : $((exit_code = $exit_code + $?)) |
| 35 | else | 35 | else |
| 36 | MKM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards/'${KB}'/keymaps/)([a-zA-Z0-9_]+)(?=\/)' | sort -u) | 36 | MKM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards/'${KB}'/keymaps/)([a-zA-Z0-9_]+)(?=\/)' | sort -u) |
| 37 | for KM in $MKM ; do | 37 | for KM in $MKM ; do |
| 38 | echo "Making $KM for $KB" | 38 | echo "Making $KM for $KB" |
| 39 | make ${KB}:${KM} AUTOGEN=true | 39 | make ${KB}:${KM} |
| 40 | : $((exit_code = $exit_code + $?)) | 40 | : $((exit_code = $exit_code + $?)) |
| 41 | done | 41 | done |
| 42 | fi | 42 | fi |
| 43 | done | 43 | done |
| 44 | fi | 44 | fi |
diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh index 66b3beb6c..155a9a8d2 100755 --- a/util/travis_compiled_push.sh +++ b/util/travis_compiled_push.sh | |||
| @@ -69,10 +69,9 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then | |||
| 69 | # rm -f compiled/*.hex | 69 | # rm -f compiled/*.hex |
| 70 | 70 | ||
| 71 | # ignore errors here | 71 | # ignore errors here |
| 72 | for file in ../qmk_firmware/keyboards/*/keymaps/*/*_default.hex; do mv -v "$file" "compiled/${file##*/}" || true; done | 72 | # In theory, this is more flexible, and will allow for additional expansion of additional types of files and other names |
| 73 | for file in ../qmk_firmware/keyboards/*/*/keymaps/*/*_default.hex; do mv -v "$file" "compiled/${file##*/}" || true; done | 73 | mv -t compiled ../qmk_firmware/*_default.*(hex|bin) || true |
| 74 | for file in ../qmk_firmware/keyboards/*/*/*/keymaps/*/*_default.hex; do mv -v "$file" "compiled/${file##*/}" || true; done | 74 | |
| 75 | for file in ../qmk_firmware/keyboards/*/*/*/*/keymaps/*/*_default.hex; do mv -v "$file" "compiled/${file##*/}" || true; done | ||
| 76 | bash _util/generate_keyboard_page.sh | 75 | bash _util/generate_keyboard_page.sh |
| 77 | git add -A | 76 | git add -A |
| 78 | git commit -m "generated from qmk/qmk_firmware@${rev}" | 77 | git commit -m "generated from qmk/qmk_firmware@${rev}" |
