From 4d5465e9e438cfa52aa93caad3f18511351e9d25 Mon Sep 17 00:00:00 2001 From: Christopher Hock Date: Fri, 16 Aug 2024 15:24:35 +0200 Subject: [PATCH] Update Makefile Add all target to makefile as well as a dev and release build target. (latter is default for make all) Signed-off-by: Christopher Hock --- Makefile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 837ef54..ce2274f 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,16 @@ -.PHONY: install-pre-commit setup-hooks run-hooks format check clean help +.PHONY: all install-pre-commit setup-hooks run-hooks format check clean help + +all: build help: @echo "Available targets:" @echo " install-pre-commit - Install pre-commit" @echo " setup-hooks - Set up pre-commit hooks" @echo " run-hooks - Run pre-commit hooks" + @echo " build - Builds the application in release mode" + @echo " build-dev - Builds the application with debug symbols enabled. (release-mode off)" @echo " setup - Setup dev enironment" @echo " format - Format code" - @echo " tidy - Check code using clippy and apply suggestions" # TODO: Check if Cargo and Rustup are already installed. If not, install them # using the system's package manager. @@ -26,7 +29,7 @@ install-rustup: # Might fail when pip does not allow system wide installation install-pre-commit: @echo "Installing pre-commit..." - pip install pre-commit + pip install pre-commit || { echo 'Error installing pre-commit'; exit 1; } setup-hooks: @echo "Setting up pre-commit hooks..." @@ -39,6 +42,15 @@ run-hooks: setup: install-pre-commit setup-hooks run-hooks @echo "pre-commit setup completed." +build: + cargo build --bin --release + +build-dev: + cargo build --bin + +docs: + cargo docs --bin --no-deps --document-private-items --open + format: @echo "Formatting code with 'cargo fmt'..." cargo fmt