1 Star 0 Fork 0

zx2591/NXOS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
nx.sh 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
garyhobson 提交于 2023-09-26 23:58 +08:00 . feat: 添加 bear 3 命令支持
#!/usr/bin/env bash
# nx.sh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ROOTDIR=$(realpath $(dirname $(readlink -f ${0})))
NUTTXDIR=${ROOTDIR}/nuttx
TOOLSDIR=${NUTTXDIR}/tools
bear_version=`bear --version 2>&1 | awk -F '[ .]' '/bear/{print $2}'`
if [ "$bear_version" == "3" ]; then
BEAR="bear --append --"
else
BEAR="bear --append "
fi
function build_board()
{
echo -e "Build command line:"
echo -e " ${TOOLSDIR}/configure.sh -e $1"
echo -e " make -C ${NUTTXDIR} ${@:2}"
echo -e " make -C ${NUTTXDIR} savedefconfig"
if ! ${TOOLSDIR}/configure.sh $1; then
make -C ${NUTTXDIR} distclean -j
rm $ROOTDIR/compile_commands.json
if ! ${TOOLSDIR}/configure.sh $1; then
echo "Error: ############# config ${1} fail ##############"
exit 1
fi
fi
if ! ${BEAR} make -C ${NUTTXDIR} ${@:2} -j; then
echo "Error: ############# build ${1} fail ##############"
exit 2
fi
if [ "${2}" == "distclean" ]; then
rm -rf $ROOTDIR/compile_commands.json
return;
fi
make -C ${NUTTXDIR} savedefconfig
if [ ! -d $1 ]; then
cp ${NUTTXDIR}/defconfig ${ROOTDIR}/nuttx/boards/*/*/${1/[:|\/]//configs/}
else
cp ${NUTTXDIR}/defconfig $1
fi
}
if [ $# == 0 ]; then
echo "Usage: $0 <board-name>:<config-name> [make options]"
echo " $0 <config-path> [make options]"
exit 1
fi
board_config=$1
shift
if [ -d ${ROOTDIR}/${board_config} ]; then
build_board ${ROOTDIR}/${board_config} $*
else
build_board ${board_config} $*
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zx2591/NXOS.git
git@gitee.com:zx2591/NXOS.git
zx2591
NXOS
NXOS
master

搜索帮助