summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2023-08-04 09:30:21 +0200
committerCanop <cano.petrole@gmail.com>2023-08-04 09:30:21 +0200
commitae750767221ce2b6c1c527b0d7d1dd0ea5ba04f7 (patch)
tree832c09d83ab1636b80efcc0b5fb2488a864193f5
parentc0caf31c137fe25e33f1cdb7ecd5b3b5512d11f3 (diff)
reorganize compile script
(so that the local release exe is present at end)
-rwxr-xr-xcompile-all-targets.sh31
1 files changed, 16 insertions, 15 deletions
diff --git a/compile-all-targets.sh b/compile-all-targets.sh
index 4f4a004..b1d32ea 100755
--- a/compile-all-targets.sh
+++ b/compile-all-targets.sh
@@ -16,9 +16,25 @@ rm -rf build
mkdir build
echo " build cleaned"
+# build versions for other platforms using cargo cross
+cross_build() {
+ name="$1"
+ target="$2"
+ echo -e "${H2}Compiling the $name / $target version${EH}"
+ cargo clean
+ cross build --target "$target" --release
+ mkdir "build/$target"
+ cp "target/$target/release/dysk" "build/$target/"
+}
+cross_build "Raspberry 32" "armv7-unknown-linux-gnueabihf"
+# cross_build "Android" "aarch64-linux-android"
+cross_build "MUSL" "x86_64-unknown-linux-musl"
+cross_build "NetBSD/amd64" "x86_64-unknown-netbsd"
+
# build the linux version
target="x86_64-linux"
echo -e "${H2}Compiling the linux version - $target${EH}"
+cargo clean
cargo build --release
mkdir "build/$target/"
cp target/release/dysk "build/$target/"
@@ -33,19 +49,4 @@ mkdir build/man
mv build/completion/dysk.1 build/man
echo " Done"
-# build versions for other platforms using cargo cross
-cross_build() {
- name="$1"
- target="$2"
- echo -e "${H2}Compiling the $name / $target version${EH}"
- cargo clean
- cross build --target "$target" --release
- mkdir "build/$target"
- cp "target/$target/release/dysk" "build/$target/"
-}
-cross_build "Raspberry 32" "armv7-unknown-linux-gnueabihf"
-# cross_build "Android" "aarch64-linux-android"
-cross_build "MUSL" "x86_64-unknown-linux-musl"
-cross_build "NetBSD/amd64" "x86_64-unknown-netbsd"
-
echo -e "${H1}Compilations done${EH}"