]> localhost Git - algorithms.git/commitdiff
added makefile so i know what targets to execute
authorJeff Hemminger <jeff@hemminger.haus>
Wed, 24 Dec 2025 01:21:36 +0000 (10:21 +0900)
committerJeff Hemminger <jeff@hemminger.haus>
Wed, 24 Dec 2025 01:21:36 +0000 (10:21 +0900)
Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..6f8ca40
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+# Use `make` variables so you can override on the command line:
+# e.g. `make test FEATURES=serde`
+CARGO      ?= cargo
+FEATURES   ?=
+PROFILE    ?= debug       # or 'release'
+TARGET_DIR ?= target
+
+ifeq ($(PROFILE),release)
+    BUILD_FLAGS := --release
+else
+    BUILD_FLAGS :=
+endif
+
+ifeq ($(FEATURES),)
+    FEATURE_FLAGS :=
+else
+    FEATURE_FLAGS := --features "$(FEATURES)"
+endif
+
+.PHONY: all build test clean fmt clippy doc ci
+
+# Default: build and test
+all: build test
+
+build:
+       $(CARGO) build $(BUILD_FLAGS) $(FEATURE_FLAGS)
+
+test:
+       $(CARGO) test $(BUILD_FLAGS) $(FEATURE_FLAGS)
+
+clean:
+       $(CARGO) clean
+
+fmt:
+       $(CARGO) fmt
+
+clippy:
+       $(CARGO) clippy $(FEATURE_FLAGS) --all-targets --all-features
+
+doc:
+       $(CARGO) doc --no-deps $(BUILD_FLAGS) $(FEATURE_FLAGS)
+