summaryrefslogtreecommitdiffstats
path: root/compile-all-targets.sh
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2020-01-14 15:28:12 +0100
committerCanop <cano.petrole@gmail.com>2020-01-14 15:28:12 +0100
commit42186bf348b6598092c07cb34949b6e232c1012f (patch)
treec929eba7b5c074882717e3aa4edaf79cce7df54a /compile-all-targets.sh
parent7350ea22aa6fb74c810456b427c610cf876f49e6 (diff)
publish the site compiling for all targets
Diffstat (limited to 'compile-all-targets.sh')
-rwxr-xr-xcompile-all-targets.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/compile-all-targets.sh b/compile-all-targets.sh
new file mode 100755
index 0000000..ca2311c
--- /dev/null
+++ b/compile-all-targets.sh
@@ -0,0 +1,40 @@
+
+# WARNING: This script is NOT meant for normal installation, it's dedicated
+# to the compilation of all supported targets. This is a long process and
+# it involves specialized toolchains.
+# For usual compilation do
+# cargo build --release
+# or read all possible installation solutions on
+# https://dystroy.org/broot/documentation/installation/
+
+# clean previous build
+rm -rf build
+mkdir build
+
+# build the linux version
+cargo build --release
+strip target/release/broot
+mkdir build/x86_64-linux/
+cp target/release/broot build/x86_64-linux/
+
+# find and copy the completion scripts
+# (they're built as part of the normal compilation)
+mkdir build/completion
+cp "$(broot -c ":gi release :focus broot.bash :parent :pp" target)/"* build/completion
+
+# build the windows version
+# You need first to install the proper cargo toolchain:
+# rustup target add x86_64-pc-windows-gnu
+cargo build --target x86_64-pc-windows-gnu --release
+mkdir build/x86_64-pc-windows-gnu/
+cp target/x86_64-pc-windows-gnu/release/broot.exe build/x86_64-pc-windows-gnu/
+
+# build the Raspberry version
+# In order for this to work, you need to install the proper cargo toolchain
+# and a linker:
+# rustup target add armv7-unknown-linux-gnueabihf
+# sudo apt-get install gcc-8-multilib-arm-linux-gnueabihf
+RUSTFLAGS="-C linker=arm-linux-gnueabihf-gcc-8" cargo build --target armv7-unknown-linux-gnueabihf --release
+mkdir build/armv7-unknown-linux-gnueabihf
+cp target/armv7-unknown-linux-gnueabihf/release/broot build/armv7-unknown-linux-gnueabihf/
+