- Move ci-test.sh and setup.sh to scripts/ - Trim docs/src/zig-cli.md to current structure - Replace hardcoded secrets with placeholders in configs - Update .gitignore to block .env*, secrets/, keys, build artifacts - Slim README.md to reflect current CLI/TUI split - Add cleanup trap to ci-test.sh - Ensure no secrets are committed
36 lines
No EOL
970 B
Makefile
36 lines
No EOL
970 B
Makefile
# Minimal build rules for the Zig CLI (no build.zig)
|
|
|
|
ZIG ?= zig
|
|
BUILD_DIR ?= build
|
|
BINARY := $(BUILD_DIR)/ml
|
|
|
|
.PHONY: all tiny fast install clean help
|
|
|
|
all: $(BINARY)
|
|
|
|
$(BUILD_DIR):
|
|
mkdir -p $(BUILD_DIR)
|
|
|
|
$(BINARY): src/main.zig | $(BUILD_DIR)
|
|
$(ZIG) build-exe -OReleaseSmall -fstrip -femit-bin=$(BINARY) src/main.zig
|
|
|
|
tiny: src/main.zig | $(BUILD_DIR)
|
|
$(ZIG) build-exe -OReleaseSmall -fstrip -femit-bin=$(BUILD_DIR)/ml-tiny src/main.zig
|
|
|
|
fast: src/main.zig | $(BUILD_DIR)
|
|
$(ZIG) build-exe -OReleaseFast -femit-bin=$(BUILD_DIR)/ml-fast src/main.zig
|
|
|
|
install: $(BINARY)
|
|
install -d $(DESTDIR)/usr/local/bin
|
|
install -m 0755 $(BINARY) $(DESTDIR)/usr/local/bin/ml
|
|
|
|
clean:
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
help:
|
|
@echo "Targets:"
|
|
@echo " all - build release-small binary (default)"
|
|
@echo " tiny - build with ReleaseSmall"
|
|
@echo " fast - build with ReleaseFast"
|
|
@echo " install - copy binary into /usr/local/bin"
|
|
@echo " clean - remove build artifacts"
|