Skip to content

Commit 0704b44

Browse files
committed
Replace Makefile with build.zig
1 parent 572d12a commit 0704b44

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
main
22
build/
3+
zig-cache

Makefile

Lines changed: 0 additions & 14 deletions
This file was deleted.

build.zig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const Builder = @import("std").build.Builder;
2+
3+
pub fn build(b: &Builder) {
4+
const exe = b.addCExecutable("main");
5+
exe.addCompileFlags([][]const u8 {
6+
"-std=c99"
7+
});
8+
9+
const source_files = [][]const u8 {
10+
"compute.c",
11+
"compute_helper.c",
12+
"display.c",
13+
"main.c"
14+
};
15+
16+
for (source_files) |source| {
17+
exe.addSourceFile(source);
18+
}
19+
20+
exe.setOutputPath("./main");
21+
b.default_step.dependOn(&exe.step);
22+
}

0 commit comments

Comments
 (0)