Edit online

重要命令

SCons

SConstruct (SCons) 是跨平台的构建系统,因此在 Windows 和 Linux 上的用法相同。关于 SConstruct 的详细介绍,可查看 SConstruct

SCons 常用的命令有:
  1. 罗列项目: scons –list-def

    罗列 SDK 中发布的项目名称。
    scons --list-def
    scons: Reading SConscript files ...
    Built-in configs:
    0. d21x_demo100-nand_baremetal_bootloader_defconfig - Build for d21x_demo100-nand_baremetal_bootloader
    1. d21x_demo100-nand_baremetal_helloworld_defconfig - Build for d21x_demo100-nand_baremetal_helloworld
    2. d21x_demo100-nand_rt-thread_helloworld_defconfig - Build for d21x_demo100-nand_rt-thread_helloworld
    3. d21x_demo100-nor_baremetal_bootloader_defconfig  - Build for d21x_demo100-nor_baremetal_bootloader
    4. d21x_demo100-nor_rt-thread_helloworld_defconfig  - Build for d21x_demo100-nor_rt-thread_helloworld
    5. d21x_demo88-nand_baremetal_bootloader_defconfig  - Build for d21x_demo88-nand_baremetal_bootloader
    6. d21x_demo88-nand_rt-thread_helloworld_defconfig  - Build for d21x_demo88-nand_rt-thread_helloworld
    7. d21x_demo88-nor_baremetal_bootloader_defconfig   - Build for d21x_demo88-nor_baremetal_bootloader
    8. d21x_demo88-nor_rt-thread_helloworld_defconfig   - Build for d21x_demo88-nor_rt-thread_helloworld
    9. d21x_per2-nand_baremetal_bootloader_defconfig    - Build for d21x_per2-nand_baremetal_bootloader
    10. d21x_per2-nand_baremetal_helloworld_defconfig   - Build for d21x_per2-nand_baremetal_helloworld
    11. d21x_per2-nand_rt-thread_helloworld_defconfig   - Build for d21x_per2-nand_rt-thread_helloworld
    12. d21x_per2-nor_baremetal_bootloader_defconfig    - Build for d21x_per2-nor_baremetal_bootloader
    13. d21x_per2-nor_rt-thread_helloworld_defconfig    - Build for d21x_per2-nor_rt-thread_helloworld
  2. 使用项目:scons –apply-def

    设置使用某一个项目, 可以用项目名称,也可以用项目的索引。
    scons --apply-def=2
    scons: Reading SConscript files ...
    Load config from target\configs\d21x_demo100-nand_rt-thread_helloworld_defconfig
    
    scons --apply-def=d21x_demo100-nand_rt-thread_helloworld_defconfig
    scons: Reading SConscript files ...
    Load config from target\configs\d21x_demo100-nand_rt-thread_helloworld_defconfig
  3. 配置项目:scons –menuconfig

    Luban-Lite 使用 menuconfig 界面进行项目的配置工作。
    scons --menuconfig

  4. 构建项目:scons

    进行项目构建,默认是简洁模式,不会输出编译选项等信息, 调试时可以使用 scons –verbose 打印编译器选项等辅助信息。
    scons
    scons: Reading SConscript files ...
    >>> Extract toolchain Xuantie-900-gcc-elf-newlib-mingw ...
  5. 清理项目:scons –clean

    清除上一次编译的临时文件。执行该命令后,下一次编译将能保证所有源文件都会被重新编译。
    scons --clean
    scons -c

OneStep

OneStep 是 ArtInChip 为了简化 SDK 的使用而开发的一系列易用性命令。
  • 在 Windows 系统中,OneStep 自动集成到 win_cmd.bat 和 win_env.bat 批处理脚本中。

  • 在 Linux 系统中需要加入到当前路径中:sourcetools/onestep.sh

OneStep 命令列表如下:
Luban-Lite SDK OneStep commands:
  hmm|h                     : Get this help.
  lunch          [keyword]  : Start with selected defconfig.e.g. lunch mmc
  menuconfig|me             : Config SDK with menuconfig
  m                         : Build all and generate final image
  mc                        : Clean & Build all and generate final image
  mb                        : Build bootloader & app and generate final image
  c                         : Clean all
  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.
  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