build(make): clean before build

This commit is contained in:
xfy
2024-07-01 17:24:54 +08:00
parent 778a3431c0
commit 872b1464e7
3 changed files with 5 additions and 63 deletions

View File

@ -50,19 +50,19 @@ lint:
fix:
$(CARGO) fix --allow-dirty --all-features
build-linux-musl:
build-linux-musl: clean-release
$(CROSS) build --release --target x86_64-unknown-linux-musl
build-linux-gnu:
build-linux-gnu: clean-release
$(CROSS) build --release --target x86_64-unknown-linux-gnu
build-windows-gnu:
build-windows-gnu: clean-release
$(CROSS) build --release --target x86_64-pc-windows-gnu
build-freebsd:
build-freebsd: clean-release
$(CROSS) build --release --target x86_64-unknown-freebsd
build-loongarch:
build-loongarch: clean-release
$(CROSS) build --release --target loongarch64-unknown-linux-gnu
# Phony targets to avoid conflicts with file names

View File

@ -1,27 +0,0 @@
[tasks.format]
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--", "--emit=files"]
dependencies = ["fix"]
[tasks.fix]
command = "cargo"
args = ["fix", "--allow-dirty", "--all-features"]
[tasks.clean]
command = "cargo"
args = ["clean"]
[tasks.build]
command = "cargo"
args = ["build", "--release"]
dependencies = ["clean"]
[tasks.test]
command = "cargo"
args = ["test"]
dependencies = ["clean"]
[tasks.dev]
command = "cargo"
args = ["watch", "-x", "'run'"]

View File

@ -1,31 +0,0 @@
#!/bin/bash
set -xue
rm -rf ./target/release/
rm -rf ./target/debug/
cargo build --release --target x86_64-unknown-linux-gnu
rm -rf ./target/release/
rm -rf ./target/debug/
cargo build --release --target x86_64-unknown-linux-musl
rm -rf ./target/release/
rm -rf ./target/debug/
cross build --release --target aarch64-unknown-linux-gnu
rm -rf ./target/release/
rm -rf ./target/debug/
cross build --release --target aarch64-unknown-linux-musl
rm -rf ./target/release/
rm -rf ./target/debug/
cross build --release --target x86_64-pc-windows-gnu
rm -rf ./target/release/
rm -rf ./target/debug/
cross build --release --target x86_64-unknown-freebsd
rm -rf ./target/release/
rm -rf ./target/debug/
cross build --release --target loongarch64-unknown-linux-gnu