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
|
2022-06-25 17:30:08 -04:00
|
|
|
if [ ! -f "build/${MODE}-${ARCH}/arm/build.ninja" ] || [ ! -f "build/${MODE}-${ARCH}/native/build.ninja" ]; then
|
2023-12-26 02:31:22 -05:00
|
|
|
# Run CMake
|
2022-03-06 15:53:27 -05:00
|
|
|
./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-07-29 22:13:03 -04:00
|
|
|
if [ -z "${DESTDIR+x}" ]; then
|
|
|
|
export DESTDIR="$(cd ../../; pwd)/out/${MODE}-${ARCH}"
|
|
|
|
rm -rf "${DESTDIR}"
|
|
|
|
mkdir -p "${DESTDIR}"
|
|
|
|
fi
|
2021-06-24 12:40:34 -04:00
|
|
|
|
|
|
|
# Build ARM Components
|
|
|
|
cd arm
|
2022-03-06 20:13:41 -05:00
|
|
|
cmake --build .
|
2022-07-29 22:13:03 -04:00
|
|
|
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 .
|
2022-07-29 22:13:03 -04:00
|
|
|
cmake --install .
|
2021-06-24 12:40:34 -04:00
|
|
|
cd ../
|
|
|
|
|
|
|
|
# Exit
|
|
|
|
cd ../../
|
|
|
|
}
|
|
|
|
|
2022-03-06 15:53:27 -05:00
|
|
|
# Variables
|
2023-11-24 18:37:08 -05:00
|
|
|
MODE="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
|
|
|
|
ARCH="$(echo "$2" | tr '[:upper:]' '[:lower:]')"
|
2022-03-06 15:53:27 -05:00
|
|
|
shift 2
|
2021-09-16 16:39:24 -04:00
|
|
|
|
2021-06-17 17:32:24 -04:00
|
|
|
# Build
|
2022-07-02 18:14:23 -04:00
|
|
|
build "${MODE}" "${ARCH}"
|