Skip to content
Snippets Groups Projects
Commit cfb6b2b8 authored by guozhanxin's avatar guozhanxin
Browse files

Improve smart-env.bat

parent dc003d21
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ git clone https://github.com/RT-Thread/userapps.git
### 配置工具链
在userapps\tools目录下运行get_toolchain.py的脚本,会下载对应的工具链并展开到userapps\tools\gun_gcc目录。后面的工具链名称可以是 arm | aarch64 | riscv64。
在userapps\tools目录下运行get_toolchain.py的脚本,会下载对应的工具链并展开到userapps\tools\gun_gcc目录。后面的工具链名称可以是 arm | riscv64。
本文以RISC-V平台为例,输入下面的命令:
......@@ -37,10 +37,10 @@ git clone https://github.com/RT-Thread/userapps.git
python get_toolchain.py riscv64
```
在userapps目录下,运行smart-env.bat配置工具链路径
在userapps目录下,运行smart-env.bat配置工具链路径,目前支持的参数可以是 arm | riscv64
```
smart-env.bat
smart-env.bat riscv64
```
可使用set命令检查RTT_EXEC_PATH是否设置成功
......
@set RTT_CC=gcc
@set RTT_EXEC_PATH=%cd%\tools\gnu_gcc\riscv64-linux-musleabi_for_i686-w64-mingw32\bin
@set RTT_CC_PREFIX=riscv64-unknown-linux-musl-
@set PATH=%RTT_EXEC_PATH%;%PATH%
@set def_arch=arm
@if not "%1"=="" (
@set def_arch=%1
)
@if %def_arch%==arm (
@set RTT_CC=gcc
@set RTT_EXEC_PATH=%cd%\tools\gnu_gcc\arm-linux-musleabi_for_i686-w64-mingw32\bin
@set RTT_CC_PREFIX=arm-linux-musleabi-
@set PATH=%RTT_EXEC_PATH%;%PATH%
@copy configs\def_config_arm .config
) else if %def_arch%==riscv64 (
@set RTT_CC=gcc
@set RTT_EXEC_PATH=%cd%\tools\gnu_gcc\riscv64-linux-musleabi_for_i686-w64-mingw32\bin
@set RTT_CC_PREFIX=riscv64-unknown-linux-musl-
@set PATH=%RTT_EXEC_PATH%;%PATH%
@copy configs\def_config_riscv64 .config
) else (
@echo "ERROR:supported_arch=arm riscv64!"
@goto EXIT
)
@echo "Arch => %def_arch%"
@echo "CC => %RTT_CC%"
@echo "PREFIX => %RTT_CC_PREFIX%"
@echo "EXEC_PATH => %RTT_EXEC_PATH%"
:EXIT
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment