Refactor builds to use target profiles and discovery; remove architecture checker

This commit is contained in:
Aaron committed 2026-11-07 20:50:04 +00:00
1 parent 6a1eb5e2ac
commit 7a6be7f66e
15 files changed
+238 -232

No files matched your search

+23 -66
View File
@@ -1,73 +1,30 @@
#!/usr/bin/env bash
# Multi-architecture build updates: Copyright 2026 Aaron Hance.
ERRCOUNT=0
echo " "
echo "======================="
echo " "
echo "Asuro Compilation"
echo " "
# Copyright 2026 Aaron Hance
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
TOOLCHAIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$TOOLCHAIN_DIR/target.sh"
mkdir -p "$OBJ_DIR" "$BIN_DIR"
# Clean only this target's generated objects; preserve other architectures.
# Preserve generated objects belonging to other targets.
find "$OBJ_DIR" -maxdepth 1 -type f \( -name '*.o' -o -name '*.ppu' -o -name '*.a' \) -delete
runOrFail() {
local binary=$1
local errorText=$2
if $binary; then
echo "Success."
else
echo "$errorText"
ERRCOUNT=$((ERRCOUNT+1))
fi
}
declare -a run_steps=(
"compile_stub.sh" "Failed to compile stub!"
"compile_vergen.sh" "Versions failed to compile"
"compile_lvgl.sh" "Failed to compile LVGL!"
"compile_icons.sh" "Failed to generate icons!"
"compile_wasuro.sh" "Failed to pull Wasuro!"
"compile_sources.sh" "Failed to compile FPC Sources!"
"compile_initcalls.sh" "Failed to generate INITFINAL table!"
"compile_link.sh" "Failed linking!"
"compile_isogen.sh" "Failed to create ISO!"
"compile_docs.sh" "Failed to generate documentation!"
)
if [ "$ASURO_ARCH" = x86_64 ]; then
# Bootstrap milestone: no desktop/runtime dependencies until they are ported.
run_steps=(
"compile_stub.sh" "Failed to compile stub!"
"compile_sources.sh" "Failed to compile FPC Sources!"
"compile_link.sh" "Failed linking!"
"compile_isogen.sh" "Failed to create ISO!"
)
fi
for ((i=0; i<${#run_steps[@]}; i+=2))
do
if [ "$ERRCOUNT" -eq "0" ]
then
script="${TOOLCHAIN_DIR}/${run_steps[$i]}"
message="${run_steps[$i+1]}"
runOrFail "$script" "$message"
fi
for step in "${BUILD_STEPS[@]}"; do
if bash "$TOOLCHAIN_DIR/compile_$step.sh"; then
echo "Success."
else
echo "Failed build step: $step" >&2
if [ -n "$FINISH_SCRIPT" ]; then bash "$TOOLCHAIN_DIR/$FINISH_SCRIPT" failed; fi
exit 1
fi
done
#Call generate final artifacts based on failure or success of the above.
if [ "$ASURO_ARCH" = x86_64 ]; then
if [ "$ERRCOUNT" -ne 0 ]; then exit 1; fi
echo "No errors. Bootstrap image: $ISO_FILE"
exit 0
fi
if [ "$ERRCOUNT" -ne "0" ]
then
. "${TOOLCHAIN_DIR}/compile_finish.sh" "failed"
else
. "${TOOLCHAIN_DIR}/compile_finish.sh" "success"
fi
cd ..
if [ -n "$FINISH_SCRIPT" ]; then bash "$TOOLCHAIN_DIR/$FINISH_SCRIPT" success; fi
echo "No errors. Image: $ISO_FILE"