-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (48 loc) · 1.4 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
##
# ai lab - GUI for annotating, training, and evaluating AI models, simplifying workflows
# Copyright (C) 2024 - Felix Drees - GNU General Public License v3.0
#
# @file
# @version 0.1
#===========================================================================#
# You've stumbled upon a Makefile in a Rust project. Apologies to the Rust #
# community — I'm just a Makefile in a world of cargo. But hey, if it ain't #
# broke, don't cargo it, right? ;) Now, let's make something! #
#===========================================================================#
all: build run
build:
cargo build --release
.PHONY: run
run:
cargo run --release
clean:
cargo clean
# rm -fr ./docs/
test:
cargo test
c: checkstyle
checkstyle:
cargo clippy
cargo fmt --all -- --check
cloc:
cloc `git ls-files`
doc:
cargo doc --no-deps
# rm -fr ./docs/
# cp -r ./target/doc/ ./docs/ # for github pages
# Check for xdg-open and open doc
.PHONY: open_docs
open-doc:
@if command -v xdg-open >/dev/null 2>&1; then \
# xdg-open is installed. Opening docs ... \
xdg-open ./target/doc/ai_lab/index.html; \
elif command -v firefox >/dev/null 2>&1; then \
# xdg-open is not installed. Using firefox to open docs ... \
firefox ./target/doc/ai_lab/index.html; \
else \
echo "Neither xdg-open nor firefox is installed. Please install one to open docs via this Makefile."; \
fi
f: format
format:
cargo fmt
# end