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

+22 -23
View File
@@ -10,27 +10,26 @@
# 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.
# Shared target selection. Source this file from build steps.
# Load a target profile by convention rather than branching in build steps.
ASURO_ARCH="${ASURO_ARCH:-x86}"
case "$ASURO_ARCH" in
x86)
OBJ_DIR=lib
BIN_DIR=bin
ISO_ROOT=iso
ISO_FILE=Asuro.iso
NASM_FORMAT=elf
LD_FORMAT=elf_i386
LINKER_SCRIPT=toolchain/linker.script
;;
x86_64)
OBJ_DIR=lib/x86_64
BIN_DIR=bin/x86_64
ISO_ROOT=bin/x86_64/iso
ISO_FILE=Asuro-x86_64.iso
NASM_FORMAT=elf64
LD_FORMAT=elf_x86_64
LINKER_SCRIPT=toolchain/x86_64/linker.script
;;
*) echo "Unsupported ASURO_ARCH: $ASURO_ARCH" >&2; exit 1 ;;
esac
export ASURO_ARCH OBJ_DIR BIN_DIR ISO_ROOT ISO_FILE NASM_FORMAT LD_FORMAT LINKER_SCRIPT
if [[ ! "$ASURO_ARCH" =~ ^[a-zA-Z0-9_]+$ ]]; then
echo "Invalid ASURO_ARCH" >&2; exit 1
fi
profile="$(dirname "${BASH_SOURCE[0]}")/targets/$ASURO_ARCH.sh"
if [ ! -f "$profile" ]; then echo "Unsupported ASURO_ARCH: $ASURO_ARCH" >&2; exit 1; fi
ARCH_SOURCE_ROOT="src/arch/$ASURO_ARCH"
TARGET_TOOLCHAIN_DIR="toolchain/$ASURO_ARCH"
OBJ_DIR="lib/$ASURO_ARCH"
BIN_DIR="bin/$ASURO_ARCH"
ISO_ROOT="$BIN_DIR/iso"
ISO_FILE="Asuro-$ASURO_ARCH.iso"
GRUB_CONFIG=iso/boot/grub/grub.cfg
ASM_ENTRY="$ARCH_SOURCE_ROOT/boot/stub.asm"
C_COMPILER=gcc
LINK_OPTIONS=()
LINK_COMPILER_RUNTIME=false
ASM_SHARED_ROOTS=()
FINISH_SCRIPT=
LVGL_CACHE_NAME="liblvgl-$ASURO_ARCH.a"
source "$profile"
export ASURO_ARCH OBJ_DIR BIN_DIR ISO_ROOT ISO_FILE