summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-08-13 23:23:32 +1000
committerGitHub <noreply@github.com>2022-08-13 23:23:32 +1000
commitdccb8ff7d6e2d73f0592c30e9f8498dcbf17c9e1 (patch)
treec68637cb82b0e2508efddfe8ba2ae970b737bb57
parentb881778f53217141c3fe0eee5e8c406ccb94cf9b (diff)
downloadqmk_firmware-dccb8ff7d6e2d73f0592c30e9f8498dcbf17c9e1.tar.gz
qmk_firmware-dccb8ff7d6e2d73f0592c30e9f8498dcbf17c9e1.zip
Remove old submodules if present (#17930)
-rw-r--r--Makefile6
-rwxr-xr-xutil/size_regression.sh9
2 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 4c2e6a04dc..beaf1132b7 100644
--- a/Makefile
+++ b/Makefile
@@ -428,9 +428,15 @@ lib/%:
.PHONY: git-submodule
git-submodule:
+ [ -e lib/ugfx ] && rm -rf lib/ugfx || true
+ [ -e lib/pico-sdk ] && rm -rf lib/pico-sdk || true
+ [ -e lib/chibios-contrib/ext/mcux-sdk ] && rm -rf lib/chibios-contrib/ext/mcux-sdk || true
git submodule sync --recursive
git submodule update --init --recursive --progress
+.PHONY: git-submodules
+git-submodules: git-submodule
+
.PHONY: list-keyboards
list-keyboards:
util/list_keyboards.sh | sort -u | tr '\n' ' '
diff --git a/util/size_regression.sh b/util/size_regression.sh
index 41ad5b68a3..6da2d360bb 100755
--- a/util/size_regression.sh
+++ b/util/size_regression.sh
@@ -59,6 +59,14 @@ done
shift $((OPTIND-1))
keyboard_target=$1
+# Helper for resetting submodule existence
+fixup_submodules() {
+ [ -e lib/ugfx ] && rm -rf lib/ugfx
+ [ -e lib/pico-sdk ] && rm -rf lib/pico-sdk
+ [ -e lib/chibios-contrib/ext/mcux-sdk ] && rm -rf lib/chibios-contrib/ext/mcux-sdk
+ make git-submodule
+}
+
last_size=0
last_line=""
function build_executor() {
@@ -68,6 +76,7 @@ function build_executor() {
make distclean >/dev/null 2>&1
git checkout -f $revision >/dev/null 2>&1 || { echo "Failed to check out revision ${revision}" >&2 ; exit 1 ; }
+ fixup_submodules >/dev/null 2>&1
make -j${job_count} $keyboard_target >/dev/null 2>&1 || true
file_size=$(arm-none-eabi-size .build/*.elf 2>/dev/null | awk '/elf/ {print $1}' 2>/dev/null || true)