From 8b8f68dbc87d2d15d894610b9ca85210a20a4188 Mon Sep 17 00:00:00 2001 From: Jeff Hemminger Date: Wed, 24 Dec 2025 10:21:36 +0900 Subject: [PATCH] added makefile so i know what targets to execute --- Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 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) + -- 2.49.1