Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Build artifacts
vcd
*.o
*.exe

# Zig build cache
zig-cache/
zig-out/

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
TARGET?=vcd
all: $(TARGET)
$(TARGET):
zig build-exe vcd.zig -femit-bin=$(TARGET)
install: $(TARGET); install -v -D $< $(DESTDIR)/usr/bin/$<
clean: ; $(RM) $(TARGET)
clean: ; $(RM) $(TARGET) && $(RM) -rf zig-cache zig-out
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,19 @@ Manually download install a [prebuilt binary](../../releases)

### From sources

Requires [Zig](https://ziglang.org/) compiler (v0.11.0 or later).

```bash
make
sudo make install
```

Or build directly with Zig:

```bash
zig build-exe vcd.zig -O ReleaseFast
```

### From Package Manager

Arch-based distribution:
Expand Down
25 changes: 25 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const std = @import("std");

pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});

const exe = b.addExecutable(.{
.name = "vcd",
.root_source_file = b.path("vcd.zig"),
.target = target,
.optimize = optimize,
});

b.installArtifact(exe);

const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());

if (b.args) |args| {
run_cmd.addArgs(args);
}

const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
}
233 changes: 0 additions & 233 deletions vcd.c

This file was deleted.

Loading