gb3dplatformer/build.zig

36 lines
1.0 KiB
Zig

const std = @import("std");
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const rgbds = b.dependency("rgbds", .{
.target = target,
.optimize = optimize,
});
const assemble = b.addRunArtifact(rgbds.artifact("rgbasm"));
assemble.addArg("-H");
assemble.addArg("-L");
assemble.addArg("-o");
const main_obj = assemble.addOutputFileArg("main.o");
assemble.addFileArg(.{ .path = "main.asm" });
const link = b.addRunArtifact(rgbds.artifact("rgblink"));
link.addArg("-o");
const rom = link.addOutputFileArg("3dp.gb");
link.addFileArg(main_obj);
const fix = b.addRunArtifact(rgbds.artifact("rgbfix"));
fix.addArg("-v");
fix.addArg("-p");
fix.addArg("0xFF");
fix.addFileArg(rom);
const install_file = b.addInstallFile(rom, "3dp.gb");
install_file.step.dependOn(&fix.step);
const install = b.getInstallStep();
install.dependOn(&install_file.step);
}