amdgpud/scripts/build.sh

51 lines
1.2 KiB
Bash
Raw Normal View History

2022-06-15 15:20:52 +02:00
#!/usr/bin/env zsh
2022-09-14 16:52:31 +02:00
BUILD_TYPE="$1"
set -e +x
2022-06-15 15:20:52 +02:00
ROOT="$(git rev-parse --show-toplevel)"
cd ${ROOT}
rm -Rf ${ROOT}/tmp
mkdir ${ROOT}/tmp
./scripts/compile.sh
strip target/x86_64-unknown-linux-musl/release/amdfand
strip target/x86_64-unknown-linux-musl/release/amdvold
strip target/x86_64-unknown-linux-musl/release/amdmond
2022-02-10 09:51:53 +01:00
#upx --best --lzma target/x86_64-unknown-linux-musl/release/amdfand
#upx --best --lzma target/x86_64-unknown-linux-musl/release/amdvold
#upx --best --lzma target/x86_64-unknown-linux-musl/release/amdmond
2022-06-15 15:20:52 +02:00
function build_and_zip() {
feature=$1
zip_name=$2
2022-06-15 15:20:52 +02:00
cd ${ROOT}
cargo build --release --target x86_64-unknown-linux-gnu --bin amdguid --no-default-features --features ${feature}
strip target/x86_64-unknown-linux-gnu/release/amdguid
#upx --best --lzma target/x86_64-unknown-linux-gnu/release/amdguid
cp ./target/x86_64-unknown-linux-gnu/release/amdguid ./tmp
cd ${ROOT}/tmp
zip ${zip_name}.zip ./amdguid
cd ${ROOT}
}
2022-02-10 09:51:53 +01:00
2022-09-14 16:52:31 +02:00
if [[ "$BUILD_TYPE" == 'local' ]];
then
if [[ "$WAYLAND_DISPLAY" == "" ]];
then
build_and_zip xorg-glow amdguid-glow
else
build_and_zip wayland amdguid-wayland
fi
else
build_and_zip xorg-glium amdguid-glium
build_and_zip xorg-glow amdguid-glow
build_and_zip wayland amdguid-wayland
fi