1 Star 0 Fork 0

StarsGreen / userland

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
buildme 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
Christer Solskogen 提交于 2019-11-07 12:08 . Replace 'arch' with uname
#!/bin/bash
BUILDTYPE=Release
ARCH=$(uname -m)
ARM64=OFF
CMAKE_TOOLCHAIN_FILE=../../../makefiles/cmake/toolchains/arm-linux-gnueabihf.cmake
if [ "$1" = "--debug" ]; then
BUILDTYPE=Debug
shift
fi
if [ "$1" = "--aarch64" ]; then
ARM64=ON
CMAKE_TOOLCHAIN_FILE=../../../makefiles/cmake/toolchains/aarch64-linux-gnu.cmake
shift
fi
BUILDSUBDIR=`echo $BUILDTYPE | tr '[A-Z]' '[a-z]'`;
if [ $ARCH = "armv6l" ] || [ $ARCH = "armv7l" ] || [ $ARCH = "aarch64" ]; then
# Native compile on the Raspberry Pi
mkdir -p build/raspberry/$BUILDSUBDIR
pushd build/raspberry/$BUILDSUBDIR
cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE -DARM64=$ARM64 ../../..
if [ $ARCH = "armv6l" ]; then
make
else
make -j4
fi
if [ "$1" != "" ]; then
sudo make install DESTDIR=$1
else
sudo make install
fi
elif [ "$1" = "--native" ]; then
# Build natively on the host
mkdir -p build/native/$BUILDSUBDIR
pushd build/native/$BUILDSUBDIR
cmake -DCMAKE_BUILD_TYPE=$BUILDTYPE ../../..
shift
make -j `nproc` $*
else
# Cross compile on a more capable machine
mkdir -p build/arm-linux/$BUILDSUBDIR
pushd build/arm-linux/$BUILDSUBDIR
cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE -DCMAKE_BUILD_TYPE=$BUILDTYPE -DARM64=$ARM64 ../../..
make -j `nproc`
if [ "$1" != "" ]; then
sudo make install DESTDIR=$1
fi
fi
popd
1
https://gitee.com/StarsGreenPersonal/userland.git
git@gitee.com:StarsGreenPersonal/userland.git
StarsGreenPersonal
userland
userland
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891