compile.sh¶
Top-level build orchestrator for the Asuro kernel.
Overview¶
compile.sh is the main entry point for building the Asuro operating system. It sequentially invokes each stage of the build pipeline, halting on the first failure. After all stages complete (or a failure occurs), it calls compile_finish.sh to generate a build-status badge and set the exit code.
Prerequisites¶
- All sub-scripts must be present in the same directory as
compile.sh. - The Docker build container must provide:
bash,nasm,fpc,gcc,ld,grub-mkrescue,git,wget, and standard POSIX utilities.
Inputs¶
None directly. Each sub-script reads its own inputs from the source tree.
Outputs¶
- All artifacts produced by the sub-scripts (object files, kernel binary, ISO image, version info, badges, documentation).
- Final exit code:
0on success,1on failure.
Behavior¶
- Clears the
lib/directory to ensure a clean build. - Defines a helper function
runOrFailthat runs a command and incrementsERRCOUNTon failure. - Resolves its own directory (
TOOLCHAIN_DIR) so sub-scripts can be located by absolute path. - Declares an ordered list of build steps (script name and error message pairs):
compile_stub.sh-- Assemble boot stubs.compile_vergen.sh-- Generate version information.compile_lvgl.sh-- Compile the LVGL graphics library.compile_wasuro.sh-- Pull the Wasuro WASM runtime sources.compile_sources.sh-- Compile Free Pascal kernel sources.compile_link.sh-- Link all object files intokernel.bin.compile_isogen.sh-- Create the bootable ISO image.compile_docs.sh-- Generate project documentation.- Iterates through the steps. If
ERRCOUNTis non-zero, all remaining steps are skipped. - Calls
compile_finish.shwith either"success"or"failed"depending on whether any errors were recorded. - Changes directory back up one level (
cd ..).
Notes¶
compile_finish.shis sourced (. script) rather than executed as a sub-process, so itsexitcall terminates the entire pipeline.- The build is fail-fast: the first failing step prevents all subsequent steps from running, but the finish step always runs to produce a status badge.