SCons
SCons 是跨平台的构建系统,因此在 Windows 和 Linux 上的用法相同,常用的命令有
项目罗列
命令 scons --list-def
罗列 SDK 中发布的项目名称
scons --list-def
scons: Reading SConscript files ...
Built-in configs:
0. d12x_demo68-nand_baremetal_bootloader
1. d12x_demo68-nand_rt-thread_helloworld
2. d12x_demo68-nor_baremetal_bootloader
3. d12x_demo68-nor_rt-thread_helloworld
4. d12x_hmi-nor_baremetal_bootloader
5. d12x_hmi-nor_rt-thread_helloworld
6. d13x_demo88-nand_baremetal_bootloader
7. d13x_demo88-nand_rt-thread_helloworld
8. d13x_demo88-nor_baremetal_bootloader
9. d13x_demo88-nor_rt-thread_helloworld
10. d13x_kunlunpi88-nor_baremetal_bootloader
11. d13x_kunlunpi88-nor_rt-thread_helloworld
12. d21x_demo128-nand_baremetal_bootloader
13. d21x_demo128-nand_rt-thread_helloworld
14. g73x_demo100-nor_baremetal_bootloader
15. g73x_demo100-nor_rt-thread_helloworld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
使用项目
命令 scons --apply-def
设置使用某一个项目, 可以用项目名称,也可以用项目的索引
> scons --apply-def=3
scons: Reading SConscript files ...
Load config from target\configs\d12x_demo68-nor_rt-thread_helloworld_defconfig
scons --apply-def=d12x_demo68-nor_rt-thread_helloworld_defconfig
scons: Reading SConscript files ...
Load config from target\configs\d12x_demo68-nor_rt-thread_helloworld_defconfig
1
2
3
4
5
6
7
2
3
4
5
6
7
配置项目
命令 scons --menuconfig Luban-Lite
使用 menuconfig 界面进行项目的配置工作
scons --menuconfig
1
构建项目
命令 scons
进行构建,默认是简洁模式,不会输出编译选项等信息,调试时可以使用 scons --verbose
打印编译器选项等辅助信息
scons
scons: Reading SConscript files ...
>>> Extract toolchain Xuantie-900-gcc-elf-newlib-mingw ...
1
2
3
2
3
清理项目
命令 scons --clean
清除上一次编译的临时文件。执行该命令后,下一次编译将能保证所有源文件都会被重新编译
scons --clean
scons -c
1
2
2
OneStep
OneStep 是 ArtInChip 为了简化 SDK 的使用而开发的一系列易用性命令
Windows
在 Windows 系统中,OneStep 自动集成到 win_cmd.bat 和 win_env.bat 批处理脚本中
Linux
在 Linux 系统中需要加入到当前路径中
source tools/onestep.sh
1
命令列表
$ h
Luban-Lite SDK OneStep commands:
hmm|h : Get this help.
lunch [keyword] : Start with selected defconfig.e.g. lunch mmc
menuconfig|me : Config application with menuconfig
bm : Config bootloader with menuconfig
km : Config application with menuconfig
m|mb : Build bootloader & application and generate final image
ma : Build application only
mu|ms : Build bootloader only
c : Clean bootloader and application
mc : Clean & Rebuild all and generate final image
croot|cr : cd to SDK root directory.
cout|co : cd to build output directory.
cbuild|cb : cd to build root directory.
ctarget|ct : cd to target board directory.
godir|gd [keyword] : Go/jump to selected directory.
list : List all SDK defconfig.
list_module : List all enabled modules.
i : Get current project's information.
buildall : Build all the *defconfig in target/configs
rebuildall : Clean and build all the *defconfig in target/configs
addboard|ab : Add new board *defconfig in target/configs
aicupg : Burn image file to target board
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
常用 OneStep 命令
查看所有配置
$ list
scons: Reading SConscript files ...
Built-in configs:
0. d12x_demo68-nand_baremetal_bootloader
1. d12x_demo68-nand_rt-thread_helloworld
2. d12x_demo68-nor_baremetal_bootloader
3. d12x_demo68-nor_rt-thread_helloworld
4. d12x_hmi-nor_baremetal_bootloader
5. d12x_hmi-nor_rt-thread_helloworld
6. d13x_demo88-nand_baremetal_bootloader
7. d13x_demo88-nand_rt-thread_helloworld
8. d13x_demo88-nor_baremetal_bootloader
9. d13x_demo88-nor_rt-thread_helloworld
10. d13x_kunlunpi88-nor_baremetal_bootloader
11. d13x_kunlunpi88-nor_rt-thread_helloworld
12. d21x_demo128-nand_baremetal_bootloader
13. d21x_demo128-nand_rt-thread_helloworld
14. g73x_demo100-nor_baremetal_bootloader
15. g73x_demo100-nor_rt-thread_helloworld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
加载配置
$ lunch 3
scons: Reading SConscript files ...
Load config from target\configs\d12x_demo68-nor_rt-thread_helloworld_defconfig
1
2
3
2
3
查看当前配置
$ i
scons: Reading SConscript files ...
Target app: application/rt-thread/helloworld
Target chip: d12x
Target arch: riscv32
Target board: target/d12x/demo68-nor
Target kernel: kernel/rt-thread
Defconfig file: target/configs/d12x_demo68-nor_rt-thread_helloworld_defconfig
Root directory: xxxxxxxxxxxxxx
Out directory: output/d12x_demo68-nor_rt-thread_helloworld
Toolchain: toolchain/bin\riscv64-unknown-elf-
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
修改 RT-Thread 配置
$ me
1
修改 BootLoader 配置
$ bm
1
编译固件
$ m
1
清除编译
$ c
1