-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 900 Bytes
/
Makefile
File metadata and controls
40 lines (30 loc) · 900 Bytes
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
prog := wallrust
local_bin := ./bin
user_bin := ~/.local/bin
release := --release
target := release
.PHONY: build install clean all help
build:
cargo build $(release)
$(local_bin):
mkdir -p $(local_bin)
local-install: build $(local_bin)
cp target/$(target)/$(prog) $(local_bin)/$(prog)
install: local-install
mkdir -p $(user_bin)
cp $(local_bin)/$(prog) $(user_bin)/$(prog)
clean:
cargo clean
rm -rf $(local_bin)
all: build install
help:
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " build - Build the $(prog) binary (release mode)"
@echo " local-install - Copy binary to ./bin directory"
@echo " install - Copy binary to ~/.local/bin"
@echo " clean - Clean cargo build artifacts (keeps binaries in ./bin)"
@echo " all - Build and install (default)"
@echo " help - Show this help message"
.DEFAULT_GOAL := all