2020-09-25 12:43:53 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-09-16 22:00:40 -04:00
|
|
|
# Build
|
|
|
|
build() {
|
2022-03-06 15:53:27 -05:00
|
|
|
# Use Build Dir
|
|
|
|
if [ ! -d "build/${MODE}-${ARCH}" ]; then
|
|
|
|
./scripts/setup.sh "${MODE}" "${ARCH}"
|
2021-06-17 17:32:24 -04:00
|
|
|
fi
|
2022-03-06 15:53:27 -05:00
|
|
|
cd "build/${MODE}-${ARCH}"
|
2021-06-24 12:40:34 -04:00
|
|
|
|
|
|
|
# Create Prefix
|
2022-03-06 15:53:27 -05:00
|
|
|
local prefix="$(cd ../../; pwd)/out/${MODE}-${ARCH}"
|
2021-06-24 12:40:34 -04:00
|
|
|
rm -rf "${prefix}"
|
|
|
|
mkdir -p "${prefix}"
|
|
|
|
|
|
|
|
# Build ARM Components
|
|
|
|
cd arm
|
2022-03-06 20:13:41 -05:00
|
|
|
cmake --build .
|
|
|
|
DESTDIR="${prefix}" cmake --install .
|
2021-06-24 12:40:34 -04:00
|
|
|
cd ../
|
|
|
|
|
|
|
|
# Build Native Components
|
|
|
|
cd native
|
2022-03-06 20:13:41 -05:00
|
|
|
cmake --build .
|
|
|
|
DESTDIR="${prefix}" cmake --install .
|
2021-06-24 12:40:34 -04:00
|
|
|
cd ../
|
|
|
|
|
|
|
|
# Exit
|
|
|
|
cd ../../
|
|
|
|
}
|
|
|
|
|
2021-06-17 17:32:24 -04:00
|
|
|
# Build For ARM
|
2021-11-10 22:17:04 -05:00
|
|
|
armhf_build() {
|
2022-03-06 15:53:27 -05:00
|
|
|
# Use Build Dir
|
|
|
|
if [ ! -d "build/${MODE}-armhf" ]; then
|
|
|
|
./scripts/setup.sh "${MODE}" armhf
|
|
|
|
fi
|
|
|
|
cd "build/${MODE}-armhf"
|
2021-06-17 17:32:24 -04:00
|
|
|
|
|
|
|
# Create Prefix
|
2022-03-06 15:53:27 -05:00
|
|
|
local prefix="$(cd ../../; pwd)/out/${MODE}-armhf"
|
2021-06-17 17:32:24 -04:00
|
|
|
rm -rf "${prefix}"
|
|
|
|
mkdir -p "${prefix}"
|
|
|
|
|
|
|
|
# Build All Components
|
2022-03-06 20:13:41 -05:00
|
|
|
cmake --build .
|
|
|
|
DESTDIR="${prefix}" cmake --install .
|
2021-06-17 17:32:24 -04:00
|
|
|
|
|
|
|
# Exit
|
|
|
|
cd ../../
|
|
|
|
}
|
|
|
|
|
2022-03-06 15:53:27 -05:00
|
|
|
# Variables
|
|
|
|
MODE="$1"
|
|
|
|
ARCH="$2"
|
|
|
|
shift 2
|
2021-09-16 16:39:24 -04:00
|
|
|
|
2021-06-17 17:32:24 -04:00
|
|
|
# Build
|
2022-03-06 15:53:27 -05:00
|
|
|
if [ "${ARCH}" = "armhf" ]; then
|
|
|
|
armhf_build "${MODE}"
|
2021-09-16 16:39:24 -04:00
|
|
|
else
|
2022-03-06 15:53:27 -05:00
|
|
|
build "${MODE}" "${ARCH}"
|
2021-06-17 17:32:24 -04:00
|
|
|
fi
|