1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-09 18:06:35 +03:00
mal/impls/zig/build.zig
Joel Martin 8a19f60386 Move implementations into impls/ dir
- Reorder README to have implementation list after "learning tool"
  bullet.

- This also moves tests/ and libs/ into impls. It would be preferrable
  to have these directories at the top level.  However, this causes
  difficulties with the wasm implementations which need pre-open
  directories and have trouble with paths starting with "../../". So
  in lieu of that, symlink those directories to the top-level.

- Move the run_argv_test.sh script into the tests directory for
  general hygiene.
2020-02-10 23:50:16 -06:00

36 lines
1.4 KiB
Zig

const LibExeObjStep = @import("std").build.LibExeObjStep;
const Builder = @import("std").build.Builder;
const builtin = @import("builtin");
const warn = @import("std").debug.warn;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const exes = [_] *LibExeObjStep {
b.addExecutable("step0_repl", "step0_repl.zig"),
b.addExecutable("step1_read_print", "step1_read_print.zig"),
b.addExecutable("step2_eval", "step2_eval.zig"),
b.addExecutable("step3_env", "step3_env.zig"),
b.addExecutable("step4_if_fn_do", "step4_if_fn_do.zig"),
b.addExecutable("step5_tco", "step5_tco.zig"),
b.addExecutable("step6_file", "step6_file.zig"),
b.addExecutable("step7_quote", "step7_quote.zig"),
b.addExecutable("step8_macros", "step8_macros.zig"),
b.addExecutable("step9_try", "step9_try.zig"),
b.addExecutable("stepA_mal", "stepA_mal.zig"),
};
for(exes) |exe| {
exe.setBuildMode(mode);
exe.linkSystemLibrary("c");
exe.linkSystemLibrary("pcre");
exe.linkSystemLibrary("readline");
const run_cmd = exe.run();
const step = b.step(exe.name, exe.name);
step.dependOn(&run_cmd.step);
b.default_step.dependOn(&exe.step);
b.installArtifact(exe);
}
}