-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
62 lines (58 loc) · 2.98 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
SHELL := /bin/bash
COLOR := \033[38;2;255;51;102m
TEXT := \033[38;2;53;192;145m
RESET := \033[0;39m\n
.PHONY: install build test
install:
@clear
@printf "$(COLOR)██████╗ █████╗ ███████╗██████╗ ██╗██████╗ ██╗ ██╗███████╗$(RESET)"
@printf "$(COLOR)██╔══██╗██╔══██╗██╔════╝██╔══██╗██║██╔══██╗██║ ██║██╔════╝$(RESET)"
@printf "$(COLOR)██████╔╝███████║███████╗██████╔╝██║██████╔╝██║ ██║███████╗$(RESET)"
@printf "$(COLOR)██╔══██╗██╔══██║╚════██║██╔═══╝ ██║██╔══██╗██║ ██║╚════██║$(RESET)"
@printf "$(COLOR)██║ ██║██║ ██║███████║██║ ██║██║ ██║╚██████╔╝███████║$(RESET)"
@printf "$(COLOR)╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝$(RESET)"
@printf "$(TEXT)🚀 Starting installation...$(RESET)"
@sleep 3
@printf "$(TEXT)🌑 >>>> Updating system and removing temps$(RESET)"
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get autoremove -y
@printf "$(TEXT)🌒 >>>> Installing curl$(RESET)"
sudo apt-get -y install curl
@printf "$(TEXT)🌓 >>>> Installing Rust for Linux$(RESET)"
sudo curl https://sh.rustup.rs -sSf | sh -s -- -y
@printf "$(TEXT)🌓 >>>> Adding variables to bashrc$(RESET)"
@if ! grep -q "export PATH=\$$HOME/.cargo/bin:\$$PATH" $(HOME)/.bashrc; then \
echo "export PATH=\$$HOME/.cargo/bin:\$$PATH" >> $(HOME)/.bashrc; \
fi
@if ! grep -q "source \$$HOME/.cargo/env" $(HOME)/.bashrc; then \
echo "source \$$HOME/.cargo/env" >> $(HOME)/.bashrc; \
echo "Appended source to ~/.bashrc"; \
fi
@printf "$(TEXT)🌔 >>>> Installing system deps$(RESET)"
sudo apt-get install -y pkg-config \
build-essential \
libssl-dev
@printf "$(TEXT)🌕 >>>> Checking project$(RESET)"
source $(HOME)/.cargo/env && cargo check
@printf "$(TEXT)🎉 >>>> Done!$(RESET)"
build:
@clear
@printf "$(TEXT)>>>> Building release$(RESET)"
cargo build --release --verbose
@printf "$(TEXT)>>>> Done!$(RESET)"
test:
@printf "$(TEXT)>>>> Executing cargo tests$(RESET)"
cargo test
@printf "$(TEXT)>>>> Done!$(RESET)"
check:
@printf "$(TEXT)>>>> Checking codebase$(RESET)"
cargo clippy --all-features
@printf "$(TEXT)>>>> Done!$(RESET)"
clean:
@printf "$(TEXT)>>>> Cleaning cwd$(RESET)"
cargo clean -v -v
@printf "$(TEXT)>>>> Done!$(RESET)"
docs:
@printf "$(TEXT)>>>> Generating docs$(RESET)"
cargo doc --no-deps --workspace --open
@printf "$(TEXT)>>>> Done!$(RESET)"