2021-05-24 04:51:10 +00:00
|
|
|
const std = @import("std");
|
|
|
|
|
2023-01-31 07:19:51 +00:00
|
|
|
pub fn build(b: *std.Build) !void {
|
2023-03-08 07:16:16 +00:00
|
|
|
const test_step = b.step("test", "Test it");
|
|
|
|
b.default_step = test_step;
|
|
|
|
|
|
|
|
const optimize: std.builtin.OptimizeMode = .Debug;
|
2021-05-24 04:51:10 +00:00
|
|
|
const target = std.zig.CrossTarget{
|
|
|
|
.os_tag = .freestanding,
|
|
|
|
.cpu_arch = .arm,
|
|
|
|
.cpu_model = .{
|
|
|
|
.explicit = &std.Target.arm.cpu.arm1176jz_s,
|
|
|
|
},
|
|
|
|
};
|
2023-03-08 07:16:16 +00:00
|
|
|
|
2023-01-31 04:39:43 +00:00
|
|
|
const kernel = b.addExecutable(.{
|
|
|
|
.name = "kernel",
|
|
|
|
.root_source_file = .{ .path = "./main.zig" },
|
|
|
|
.optimize = optimize,
|
|
|
|
.target = target,
|
|
|
|
});
|
2023-07-19 08:49:34 +00:00
|
|
|
kernel.addObjectFile(.{ .path = "./boot.S" });
|
|
|
|
kernel.setLinkerScript(.{ .path = "./linker.ld" });
|
2023-04-11 00:05:09 +00:00
|
|
|
b.installArtifact(kernel);
|
2021-05-24 04:51:10 +00:00
|
|
|
|
|
|
|
test_step.dependOn(&kernel.step);
|
|
|
|
}
|