aboutsummaryrefslogtreecommitdiffstats
path: root/build.zig
diff options
context:
space:
mode:
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);
+}