summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2024-03-23 16:44:25 -0500
committerzachir <zachir@librem.one>2024-03-23 16:44:25 -0500
commitb494331cbbd3d0d17d625f66cef27b60cf125ce1 (patch)
tree197521b7fb3eb0dde99f30ee64f51e8b70145997 /Makefile
Add initial zhttpd
It is functional, however it relies on "mime.zig", which I don't yet know how to link. It also currently only supports error codes 200 and 404. It deserves to be made better, but I'll have to see how to make that happen as I go along.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bcb7224
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+ZIG_DOPTIMIZE := -Doptimize=ReleaseSafe
+ZIG_DTARGET := -Dtarget=native
+ZIG_DCPU := -Dcpu=native
+
+all:
+ zig build ${ZIG_DOPTIMIZE} ${ZIG_DTARGET} ${ZIG_DCPU}
+
+debug:
+ zig build -Doptimize=Debug ${ZIG_DTARGET} ${ZIG_DCPU}
+
+fast:
+ zig build -Doptimize=ReleaseFast ${ZIG_DTARGET} ${ZIG_DCPU}
+
+safe:
+ zig build -Doptimize=ReleaseSafe ${ZIG_DTARGET} ${ZIG_DCPU}
+
+small:
+ zig build -Doptimize=ReleaseSmall ${ZIG_DTARGET} ${ZIG_DCPU}
+
+clean:
+ rm -rf zig-cache/ zig-out/
+
+run:
+ zig build run
+
+install: zig-out/bin/zhttpd
+ install -Dm755 zig-out/bin/zhttpd ~/.local/bin/zhttpd