55 lines
1.6 KiB
Zig
55 lines
1.6 KiB
Zig
// Rumpk Build System
|
|
// Orchestrates L0 (Zig) and L1 (Nim) compilation
|
|
|
|
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
// =========================================================
|
|
// L0: Hardware Abstraction Layer (Zig)
|
|
// =========================================================
|
|
|
|
const hal = b.addStaticLibrary(.{
|
|
.name = "rumpk_hal",
|
|
.root_source_file = b.path("hal/abi.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
// Freestanding kernel - no libc
|
|
hal.root_module.red_zone = false;
|
|
hal.root_module.stack_check = .none;
|
|
|
|
b.installArtifact(hal);
|
|
|
|
// =========================================================
|
|
// Boot: Entry Point (Assembly + Zig)
|
|
// =========================================================
|
|
|
|
const boot = b.addObject(.{
|
|
.name = "boot",
|
|
.root_source_file = b.path("boot/header.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
boot.root_module.red_zone = false;
|
|
boot.root_module.stack_check = .none;
|
|
|
|
// =========================================================
|
|
// Tests
|
|
// =========================================================
|
|
|
|
const hal_tests = b.addTest(.{
|
|
.root_source_file = b.path("hal/abi.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
const run_tests = b.addRunArtifact(hal_tests);
|
|
const test_step = b.step("test", "Run Rumpk HAL tests");
|
|
test_step.dependOn(&run_tests.step);
|
|
}
|