# Minimal build rules for the Zig CLI (no build.zig) ZIG ?= zig BUILD_DIR ?= zig-out/bin BINARY := $(BUILD_DIR)/ml .PHONY: all prod dev test build-rsync install clean help RSYNC_VERSION ?= 3.3.0 RSYNC_SRC_BASE ?= https://download.samba.org/pub/rsync/src RSYNC_TARBALL ?= rsync-$(RSYNC_VERSION).tar.gz RSYNC_TARBALL_SHA256 ?= all: $(BINARY) $(BUILD_DIR): mkdir -p $(BUILD_DIR) $(BINARY): | $(BUILD_DIR) $(ZIG) build --release=small prod: src/main.zig | $(BUILD_DIR) $(ZIG) build --release=small dev: src/main.zig | $(BUILD_DIR) $(ZIG) build --release=fast test: $(ZIG) build test build-rsync: @RSYNC_VERSION="$(RSYNC_VERSION)" \ RSYNC_SRC_BASE="$(RSYNC_SRC_BASE)" \ RSYNC_TARBALL="$(RSYNC_TARBALL)" \ RSYNC_TARBALL_SHA256="$(RSYNC_TARBALL_SHA256)" \ bash "$(CURDIR)/scripts/build_rsync.sh" install: $(BINARY) install -d $(DESTDIR)/usr/local/bin install -m 0755 $(BINARY) $(DESTDIR)/usr/local/bin/ml clean: rm -rf $(BUILD_DIR) zig-out .zig-cache help: @echo "Targets:" @echo " all - build release-small binary (default)" @echo " prod - build production binary with ReleaseSmall" @echo " dev - build development binary with ReleaseFast" @echo " test - run Zig unit tests" @echo " build-rsync - build pinned rsync from official source into src/assets (RSYNC_VERSION=... override)" @echo " install - copy binary into /usr/local/bin" @echo " clean - remove build artifacts"