aboutsummaryrefslogtreecommitdiffstats
path: root/build.zig
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2024-10-05 12:13:49 -0400
committerClyne Sullivan <clyne@bitgloo.com>2024-10-05 12:13:49 -0400
commitf529a3b0f8ee24229997e995021a2ee8cb25f065 (patch)
treee420a1ad98cc2efb2fbd9ccc566bdb131d200b8c /build.zig
initial commit
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig23
1 files changed, 23 insertions, 0 deletions
diff --git a/build.zig b/build.zig
new file mode 100644
index 0000000..10fe592
--- /dev/null
+++ b/build.zig
@@ -0,0 +1,23 @@
+const std = @import("std");
+
+pub fn build(b: *std.Build) void {
+ const target = b.resolveTargetQuery(.{
+ .cpu_arch = .thumb,
+ .os_tag = .freestanding,
+ .abi = .none
+ });
+ const optimize = .Debug; // .ReleaseSmall
+
+ const exe = b.addExecutable(.{
+ .name = "stm32",
+ .root_source_file = b.path("src/main.zig"),
+ .target = target,
+ .optimize = optimize,
+ .linkage = .static,
+ });
+
+ exe.addAssemblyFile(b.path("src/bootstrap.s"));
+ exe.setLinkerScriptPath(b.path("link.ld"));
+
+ b.installArtifact(exe);
+}