Skip to content

Commit ad05b87

Browse files
committed
Handle target installation in Makefile
1 parent dd6aff3 commit ad05b87

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,39 @@ CARGO_DEB_VERSION ?= 3.6.0
44
export SLURM_VERSION ?= 24.11
55
export TARGET ?= $(shell rustc -vV | awk '/host/{print $$2}')
66

7-
check:
7+
.PHONY: target check debug release deb rpm clean
8+
9+
check: | target
810
cargo clippy --all-features --target $(TARGET)
911

10-
debug:
12+
debug: | target
1113
cargo build --target $(TARGET)
1214
ifdef WITH_SLURM
1315
cargo rustc --target $(TARGET) --lib --crate-type=cdylib --features slurm
1416
endif
1517

16-
release:
18+
release: | target
1719
cargo build --locked --target $(TARGET) --release
1820
ifdef WITH_SLURM
1921
cargo rustc --locked --target $(TARGET) --release --lib --crate-type=cdylib --features slurm
2022
endif
2123

22-
deb: release
24+
deb: | release
2325
cargo install cargo-deb@$(CARGO_DEB_VERSION) --locked
2426
cargo deb --target $(TARGET) --no-build --multiarch foreign $${TAG:+--deb-revision $$TAG}
2527
ifdef WITH_SLURM
2628
cargo deb --target $(TARGET) --no-build --multiarch foreign $${TAG:+--deb-revision $$TAG} --variant spank
2729
endif
2830

29-
rpm: release
31+
rpm: | release
3032
cargo install cargo-generate-rpm@$(CARGO_RPM_VERSION) --locked
3133
cargo generate-rpm --target $(TARGET) $${TAG:+-s "release = '$$TAG'"}
3234
ifdef WITH_SLURM
3335
cargo generate-rpm --target $(TARGET) $${TAG:+-s "release = '$$TAG'"} --variant spank
3436
endif
3537

38+
target:
39+
rustup target add $(TARGET)
40+
3641
clean:
3742
cargo clean

0 commit comments

Comments
 (0)