From e8b85e738712e493d1eb033ea5321c3c3e6bb3af Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Fri, 12 Jun 2026 17:56:10 +0800
Subject: [PATCH] Update QT build shell script for clean
---
build.sh | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 106 insertions(+), 0 deletions(-)
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..039b673
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+# Cross compiler for cross compile on Linux server
+CROSS_COMPILE=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf-
+
+# this project absolute path
+PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
+
+# binaries install path
+PREFIX_PATH=$PRJ_PATH/install
+
+# shell script will exit once get command error
+set -e
+
+#+-------------------------+
+#| Shell script functions |
+#+-------------------------+
+
+function pr_error() {
+ echo -e "\033[40;31m $1 \033[0m"
+}
+
+function pr_warn() {
+ echo -e "\033[40;33m $1 \033[0m"
+}
+
+function pr_info() {
+ echo -e "\033[40;32m $1 \033[0m"
+}
+
+function check_result()
+{
+ if [ $? != 0 ] ; then
+ pr_error $1
+ fi
+}
+
+do_build()
+{
+ pr_warn "build all the project..."
+
+ for dir in */; do
+ [ -d "$dir" ] || continue
+
+ if [ -x "$dir/build.sh" ]; then
+ (
+ cd "$dir" || exit 1
+ ./build.sh
+ )
+ fi
+ done
+
+ pr_info "==== Build: done ===="
+}
+
+do_clean()
+{
+ pr_warn "clean all the project..."
+
+ for dir in */; do
+ [ -d "$dir" ] || continue
+
+ if [ -x "$dir/build.sh" ]; then
+ (
+ cd "$dir" || exit 1
+ ./build.sh -c
+ )
+ fi
+ done
+
+ pr_info "==== Clean: install ===="
+ rm -rf $PREFIX_PATH
+}
+
+do_cross()
+{
+ pr_warn "update crosstool $CROSS_COMPILE..."
+
+ for dir in */; do
+ [ -d "$dir" ] || continue
+
+ if [ -x "$dir/build.sh" ]; then
+ echo "==== update: ${dir%/} ===="
+ (
+ cd "$dir" || exit 1
+ sed -i "s|^CROSS_COMPILE=.*|CROSS_COMPILE=${CROSS_COMPILE}|g" build.sh
+ )
+ fi
+ done
+}
+
+case "$1" in
+ build)
+ do_build
+ ;;
+ clean)
+ do_clean
+ ;;
+ cross)
+ do_cross
+ ;;
+ *)
+ echo "Usage: $0 {build|clean|cross}"
+ exit 1
+ ;;
+esac
--
Gitblit v1.10.0