summary refs log tree commit diff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig18
1 files changed, 2 insertions, 16 deletions
diff --git a/build.zig b/build.zig
index 14373c9..7609463 100644
--- a/build.zig
+++ b/build.zig
@@ -1,39 +1,25 @@
 //! Build recipe
-const builtin = @import("builtin");
 const std = @import("std");
 
 pub fn build(b: *std.Build) void {
     const target = b.standardTargetOptions(.{});
-    const arch = target.cpu_arch orelse builtin.target.cpu.arch;
     const optimize = b.standardOptimizeOption(.{});
 
     const bin = b.addExecutable(.{
         .name = "roux",
+        .root_source_file = .{ .path = "src/main.zig" },
         .target = target,
         .optimize = optimize,
         .link_libc = true,
     });
     const cflags = .{
         "-std=c99", "-g", "-Wall", "-Wextra", "-Wpedantic",
-        switch (target.os_tag orelse builtin.target.os.tag) {
-            .macos => switch (arch) {
-                .aarch64 => "-DDeftgt=T_arm64_apple",
-                .x86_64 => "-DDeftgt=T_amd64_apple",
-                else => unreachable,
-            },
-            else => switch (arch) {
-                .aarch64 => "-DDeftgt=T_arm64",
-                .riscv64 => "-DDeftgt=T_rv64",
-                .x86_64 => "-DDeftgt=T_amd64_sysv",
-                else => unreachable,
-            },
-        },
         // https://lists.sr.ht/~mpu/qbe/<CYB4FWK7MACC.2IF4DEL4C9BF1@loang.net>
         "-fno-sanitize=undefined",
     };
     bin.addIncludePath(.{ .path = "." });
     bin.addCSourceFiles(&.{
-        "main.c", "util.c", "parse.c", "abi.c", "cfg.c",
+        "util.c", "parse.c", "abi.c", "cfg.c",
         "mem.c", "ssa.c", "alias.c", "load.c", "copy.c", "fold.c",
         "simpl.c", "live.c", "spill.c", "rega.c", "emit.c",
     }, &cflags);