-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
64 lines (50 loc) · 1.44 KB
/
Makefile
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
56
57
58
59
60
61
62
63
64
.PHONY: all sochi debug release clean format clippy docs test
.DEFAULT_GOAL := all
########################################################
## Global variables
ifeq ($(OS),Windows_NT)
BROWSER := start
else
UNAME := $(shell uname -s)
ifeq ($(UNAME),Linux)
BROWSER := sensible-browser
endif
endif
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
########################################################
## Make' targets
all: debug
# Check code formatting, linting, and build all targets.
# This is useful to check the code base before committing.
precommit: format linting debug
# Build all targets in debug mode.
debug:
cargo +stable build
cp target/debug/sochi ./sochi -f
@echo "Output files were compiled to the folder: target/debug"
# Build all targets in release mode
release:
cargo +stable build --release
cp target/release/sochi ./sochi -f
@echo "Output files were compiled to the folder: target/release"
# Build sochi
sochi:
cargo +stable build --package sochi
cp target/debug/sochi ./sochi -f
@echo "Output files were compiled to the folder: target/debug"
# Format code
format:
cargo +stable fmt
# Check source code linting rules
linting: format
cargo +stable clippy --tests --benches --features linting
# Run unit tests
test:
cargo +stable test --workspace --features linting
# Update packages
update:
cargo +stable update
# Clean code
clean:
cargo +stable clean