Skip to content

Commit

Permalink
Replace Makefile with build.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
tiehuis committed Jul 19, 2017
1 parent 572d12a commit 0704b44
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
main
build/
zig-cache
14 changes: 0 additions & 14 deletions Makefile

This file was deleted.

22 changes: 22 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const Builder = @import("std").build.Builder;

pub fn build(b: &Builder) {
const exe = b.addCExecutable("main");
exe.addCompileFlags([][]const u8 {
"-std=c99"
});

const source_files = [][]const u8 {
"compute.c",
"compute_helper.c",
"display.c",
"main.c"
};

for (source_files) |source| {
exe.addSourceFile(source);
}

exe.setOutputPath("./main");
b.default_step.dependOn(&exe.step);
}

0 comments on commit 0704b44

Please sign in to comment.