From 19051f5af80f1ba628507628d4499f644f2a5730 Mon Sep 17 00:00:00 2001 From: SerinaNya <34389622+SerinaNya@users.noreply.github.com> Date: Wed, 5 Aug 2026 16:04:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(build.sh):=20add=20host=20to?= =?UTF-8?q?ols=20and=20cross=20toolchain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++++++- build.sh | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fc1477..86011c0 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,8 @@ bash build.sh The script installs the required APT packages with `sudo`, clones ImmortalWrt `v25.12.1` into `.build/immortalwrt`, configures the generic x86/64 target, and -builds only mihomo. Generated APK files are copied to `./dist/`. +builds the required host tools, the x86/64 cross toolchain, and mihomo. Generated +APK files are copied to `./dist/`. To skip APT installation on later runs: @@ -45,6 +46,10 @@ To skip APT installation on later runs: SKIP_DEPS=1 bash build.sh ``` +If a previous build failed, keep `.build/immortalwrt` and run the same command +again. Make will reuse completed host tools and toolchain components and resume +the build. + The build directory, job count, and source version can be overridden: ```sh diff --git a/build.sh b/build.sh index dd293b8..be7f718 100644 --- a/build.sh +++ b/build.sh @@ -117,6 +117,14 @@ EOF grep -q '^CONFIG_PACKAGE_mihomo=m$' "${SOURCE_DIR}/.config" || die "mihomo package selection failed." } +prepare_build_system() { + log "Building ImmortalWrt host tools" + make -C "${SOURCE_DIR}" tools/install -j"${JOBS}" V=s + + log "Building the x86/64 cross toolchain" + make -C "${SOURCE_DIR}" toolchain/install -j"${JOBS}" V=s +} + build_package() { log "Building mihomo with ${JOBS} parallel jobs" make -C "${SOURCE_DIR}" package/feeds/mihomo/mihomo/download -j"${JOBS}" V=s @@ -151,5 +159,6 @@ install_dependencies prepare_source prepare_feeds configure_target +prepare_build_system build_package collect_artifacts