From 320fda7acc53ee53ca15e01a43213ab31b0ea622 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Wed, 30 Sep 2026 09:46:41 +0200 Subject: [PATCH] Add Makefile Targets: build, install, uninstall, test, check, fmt Installs to ~/.local/bin by default --- Makefile | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f802d93 --- /dev/null +++ b/Makefile @@ -0,0 +1,58 @@ +.PHONY: all build release debug install uninstall clean test check help + +PREFIX ?= $(HOME)/.local +BINDIR ?= $(PREFIX)/bin + +CARGO ?= cargo +CARGO_FLAGS ?= + +all: release + +build: release + +release: + $(CARGO) build --release $(CARGO_FLAGS) + +debug: + $(CARGO) build $(CARGO_FLAGS) + +install: release + install -d $(BINDIR) + install -m 755 target/release/ork $(BINDIR)/ork + +uninstall: + rm -f $(BINDIR)/ork + +clean: + $(CARGO) clean + +test: + $(CARGO) test $(CARGO_FLAGS) + +check: + $(CARGO) check $(CARGO_FLAGS) + $(CARGO) clippy $(CARGO_FLAGS) -- -D warnings + +fmt: + $(CARGO) fmt + +fmt-check: + $(CARGO) fmt -- --check + +help: + @echo "orkmode - org-mode parser and CLI" + @echo "" + @echo "Targets:" + @echo " all, build, release Build release binary" + @echo " debug Build debug binary" + @echo " install Install to $(BINDIR)" + @echo " uninstall Remove from $(BINDIR)" + @echo " clean Remove build artifacts" + @echo " test Run tests" + @echo " check Run cargo check and clippy" + @echo " fmt Format code" + @echo " fmt-check Check formatting" + @echo "" + @echo "Variables:" + @echo " PREFIX Installation prefix (default: ~/.local)" + @echo " CARGO Cargo command (default: cargo)"