加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.sh 874 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
mkdir -p build build/bin build/lib
cd build
if [ " $1" == " " ]; then
compiler="gcc"
elif [ $1 == "--help" -o $1 == "-help" -o $1 == "--h" -o $1 == "-h" ]; then
echo "usage: $0 [compiler] [compiler path]"
echo " compiler: specify the compiler you are using, default: gcc"
echo " compiler path: specify the compiler path you are using"
echo " eg:"
echo " ./build.sh"
echo " ./build.sh arm-linux-gnueabihf-gcc"
echo " ./build.sh /usr/bin/arm-linux-gnueabihf-gcc"
echo " ./build.sh arm-linux-gnueabihf-gcc /usr/bin"
exit
else
if [ " $2" == " " ]; then
compiler=$1
else
compiler=$2/$1
fi
fi
path=$(which $compiler)
if [ " $path" == " " ]; then
echo -e "\033[31mNo $compiler compiler found in the system\033[0m"
exit
fi
cmake .. "-DCMAKE_C_COMPILER=$path"
make
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化