Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ByteOtter authored Aug 16, 2024
1 parent fcb8a11 commit 4d5465e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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..."
Expand All @@ -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
Expand Down

0 comments on commit 4d5465e

Please sign in to comment.