forked from Normation/rudder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rust.makefile
40 lines (31 loc) · 955 Bytes
/
rust.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
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2019-2020 Normation SAS
.DEFAULT_GOAL := build
SHELL := /bin/bash
PATH := $(PATH):$(HOME)/.cargo/bin:$(PATH)
DEBUGOPT:=$(shell make -v --debug=n >/dev/null 2>&1 && echo --debug=n)
DESTDIR := $(CURDIR)/make_target
version:
cargo --version
rustc --version
@echo "RUSTC_WRAPPER=$${RUSTC_WRAPPER}"
sccache --show-stats || true
# https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow
build: CARGO_INCREMENTAL=0
build: version
cargo build --release --locked
dev-doc:
cargo doc --document-private-items --open
lint: version
mkdir -p target
cargo fmt --all -- --check
cargo clippy --message-format json --all-targets --examples --tests -- --deny warnings > target/cargo-clippy.json
clean:
cargo clean
rm -rf target
veryclean: clean
rustup self uninstall
rm -rf ~/.rustup ~/.cargo
stats:
@ echo -n "TODOS: " && grep -r TODO src | wc -l
@ tokei -s lines