File tree Expand file tree Collapse file tree 6 files changed +484
-1
lines changed
Expand file tree Collapse file tree 6 files changed +484
-1
lines changed Original file line number Diff line number Diff line change 1+ # Build artifacts
2+ vcd
3+ * .o
4+ * .exe
5+
6+ # Zig build cache
7+ zig-cache /
8+ zig-out /
9+
10+ # IDE files
11+ .vscode /
12+ .idea /
13+ * .swp
14+ * .swo
15+ * ~
Original file line number Diff line number Diff line change 11TARGET? =vcd
22all : $(TARGET )
3+ $(TARGET ) :
4+ zig build-exe vcd.zig -O ReleaseFast -femit-bin=$(TARGET )
35install : $(TARGET ) ; install -v -D $< $(DESTDIR ) /usr/bin/$<
4- clean : ; $(RM ) $(TARGET )
6+ clean : ; $(RM ) $(TARGET ) && $( RM ) -rf zig-cache zig-out
Original file line number Diff line number Diff line change @@ -46,11 +46,19 @@ Manually download install a [prebuilt binary](../../releases)
4646
4747### From sources
4848
49+ Requires [Zig](https://ziglang.org/) compiler (v0.11.0 or later).
50+
4951` ` ` bash
5052make
5153sudo make install
5254```
5355
56+ Or build directly with Zig:
57+
58+ ``` bash
59+ zig build-exe vcd.zig -O ReleaseFast
60+ ```
61+
5462### From Package Manager
5563
5664Arch-based distribution:
Original file line number Diff line number Diff line change 1+ const std = @import ("std" );
2+
3+ pub fn build (b : * std.Build ) void {
4+ const target = b .standardTargetOptions (.{});
5+ const optimize = b .standardOptimizeOption (.{});
6+
7+ const exe = b .addExecutable (.{
8+ .name = "vcd" ,
9+ .root_source_file = b .path ("vcd.zig" ),
10+ .target = target ,
11+ .optimize = optimize ,
12+ });
13+
14+ b .installArtifact (exe );
15+
16+ const run_cmd = b .addRunArtifact (exe );
17+ run_cmd .step .dependOn (b .getInstallStep ());
18+
19+ if (b .args ) | args | {
20+ run_cmd .addArgs (args );
21+ }
22+
23+ const run_step = b .step ("run" , "Run the app" );
24+ run_step .dependOn (& run_cmd .step );
25+ }
You can’t perform that action at this time.
0 commit comments