执行要在bash中,不要cmd!!
如题,把安装的命令放在了一个sh里,然后生成了path脚本,使用时 . path导入环境变量并打印工具的版本信息
如果在安装前已经有了项目文件夹,会删除此文件夹(不过回收站),使用时注意!!
- #!bash
- if [ -d AiPi-Open-Kits ]; then
- echo The AiPi-Open-Kits folder already exists and will be deleted soon
- rm -rf AiPi-Open-Kits
- fi
- START_PATH=$(pwd)
- git clone https://gitee.com/Ai-Thinker-Open/AiPi-Open-Kits.git
- cd AiPi-Open-Kits
- sed -i 's/github.com/gitee.com/g' .gitmodules
- git submodule init
- git submodule update
- cd aithinker_Ai-M6X_SDK/
- git submodule init
- git submodule update
- git clone https://gitee.com/bouffalolab/toolchain_gcc_t-head_windows.git
- cd $START_PATH
- echo= > path
- echo '#!bash' >> path
- echo >> path
- echo RISCV_GCC_PATH=$START_PATH/AiPi-Open-Kits/aithinker_Ai-M6X_SDK/toolchain_gcc_t-head_windows/bin/ >> path
- echo MAKE_PATH=$START_PATH/AiPi-Open-Kits/aithinker_Ai-M6X_SDK/tools/make/ >> path
- echo NINJA_PATH=$START_PATH/AiPi-Open-Kits/aithinker_Ai-M6X_SDK/tools/ninja/ >> path
- echo >> path
- echo 'PATH=$RISCV_GCC_PATH:$MAKE_PATH:$NINJA_PATH:$PATH' >> path
- echo >> path
- echo RISCV_GCC_PATH= >> path
- echo MAKE_PATH= >> path
- echo NINJA_PATH= >> path
- echo >> path
- echo 'riscv64-unknown-elf-gcc --version' >> path
- echo 'make --version' >> path
- echo 'echo' >> path
- echo 'echo -n ninja version: ' >> path
- echo 'ninja --version' >> path
复制代码
|
|