summaryrefslogtreecommitdiffstats
path: root/compile-all-targets.sh
blob: ec6f81accba83195195a07c7ababcb913f4334a0 (plain)
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
43
44
45
 
# 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
echo "cleaning build"
rm -rf build
mkdir build

# build the linux version
echo "compiling 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)
echo "copying completion scripts"
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
echo "compiling the Windows version"
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
echo "compiling the Raspberry version"
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/