-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (33 loc) · 1.18 KB
/
Makefile
File metadata and controls
42 lines (33 loc) · 1.18 KB
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
CARGO_RPM_VERSION ?= 0.18.1
CARGO_DEB_VERSION ?= 3.6.0
export SLURM_VERSION ?= 24.11
export TARGET ?= $(shell rustc -vV | awk '/host/{print $$2}')
.PHONY: target check debug release deb rpm clean
check: | target
cargo clippy --all-features --target $(TARGET)
debug: | target
cargo build --target $(TARGET)
ifdef WITH_SLURM
cargo rustc --target $(TARGET) --lib --crate-type=cdylib --features slurm
endif
release: | target
cargo build --locked --target $(TARGET) --release
ifdef WITH_SLURM
cargo rustc --locked --target $(TARGET) --release --lib --crate-type=cdylib --features slurm
endif
deb: | release
cargo install cargo-deb@$(CARGO_DEB_VERSION) --locked
cargo deb --target $(TARGET) --no-build --multiarch foreign $${TAG:+--deb-revision $$TAG}
ifdef WITH_SLURM
cargo deb --target $(TARGET) --no-build --multiarch foreign $${TAG:+--deb-revision $$TAG} --variant spank
endif
rpm: | release
cargo install cargo-generate-rpm@$(CARGO_RPM_VERSION) --locked
cargo generate-rpm --target $(TARGET) $${TAG:+-s "release = '$$TAG'"}
ifdef WITH_SLURM
cargo generate-rpm --target $(TARGET) $${TAG:+-s "release = '$$TAG'"} --variant spank
endif
target:
rustup target add $(TARGET)
clean:
cargo clean