-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (44 loc) · 1.4 KB
/
Makefile
File metadata and controls
58 lines (44 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# The shell to run the makefile with must be defined to work properly in Linux systems
SHELL := /bin/bash
# all the recipes are phony (no files to check).
.PHONY: build dev test fmt clean help local pre-commit
.DEFAULT_GOAL := help
# Output descriptions of all commands
help:
@echo "Please use 'make <target>', where <target> is one of"
@echo ""
@echo " help outputs this helper"
@echo " build builds the project"
@echo " dev runs the project in development mode"
@echo " test runs the tests"
@echo " fmt runs the golang fmt"
@echo " clean cleans the project"
@echo " all-local runs all the local targets"
@echo " pre-commit runs the pre-commit hooks"
@echo ""
@echo "Check the Makefile to know exactly what each target is doing."
# Build the project
build:
@echo "Building the project..."
@cargo build --release
# Run the project in development mode
dev:
@echo "Running the project in development mode..."
@cargo run
# Run the tests
test:
@echo "Running the tests..."
@cargo test
# Run the golang fmt
fmt:
@echo "Running the cargo fmt..."
@cargo fmt
# Clean the project
clean:
@echo "Cleaning the project..."
@cargo clean
# Run all-local targets
#dev is commented out because our project doesn't have a main function
all-local: clean fmt build #dev
# Run the pre-commit hooks
pre-commit: fmt test