bluetoothlover_doc icon indicating copy to clipboard operation
bluetoothlover_doc copied to clipboard

RT-THREAD scons命令汇总

Open supperthomas opened this issue 1 year ago • 14 comments

参考链接 https://www.rt-thread.org/document/site/#/development-tools/build-config-system/SCons

supperthomas avatar Jan 02 '25 11:01 supperthomas

scons --target=cmake Scons --target=makefile Avaible targets: mdk, mdk4, mdk5, iar, vs, vs2012, vsc, cb, ua, cdk, makefile, eclipse, ses, cmake, cmake-armclang, xmake, codelite, esp-idf, zig

supperthomas avatar Jan 02 '25 11:01 supperthomas

scons --verbose

supperthomas avatar Jan 02 '25 11:01 supperthomas

使用指令 scons --buildlib=xxx,其中 xxx 为 Group 的名字。

supperthomas avatar Jan 02 '25 11:01 supperthomas

Local Options:
  --dist                      make distribution
  --dist-ide, --dist-rtstudio
                              make distribution for RT-Thread Studio IDE
  --project-path=PROJECT-PATH
                              set project output path
  --project-name=PROJECT-NAME
                              set project name
  --cscope                    Build Cscope cross reference database. Requires cscope installed.
  --clang-analyzer            Perform static analyze with Clang-analyzer. Requires Clang installed.It is recommended to use with scan-build like this:`scan-build scons --clang-analyzer`If things goes well, scan-build will instruct you to
                                invoke scan-view.
  --buildlib=BUILDLIB         building library of a component
  --cleanlib                  clean up the library by --buildlib
  --target=TARGET             set target project: mdk/mdk4/mdk5/iar/vs/vsc/ua/cdk/ses/makefile/eclipse/codelite/cmake
  --cmsispack=CMSISPACK       set pack: <cmsispack path>
  --strict                    Compiling project with strict mode and ALL warning will be errors
  --verbose                   print verbose information during build
  --cc-prefix=EXEC-PREFIX, --exec-prefix=EXEC-PREFIX
                              set RTT_CC_PREFIX temperately
  --cc-path=EXEC-PATH, --exec-path=EXEC-PATH
                              set RTT_EXEC_PATH temperately
  --stackanalysis             thread stack static analysis
  --genconfig                 Generate .config from rtconfig.h
  --useconfig=USECONFIG       make rtconfig.h from config file.
  --global-macros=GLOBAL-MACROS
                              attach global macros in the project. e.g. scons --global-config=RT_USING_XX,RT_USING_YY or scons --global-config="RT_USING_XX, RT_USING_YY"
  --reset-project-config      reset the project configurations to default
  --guiconfig, --pyconfig     Python GUI menuconfig for RT-Thread BSP
  --defconfig, --pyconfig-silent
                              Don`t show Python GUI menuconfig window
  --menuconfig                make menuconfig for RT-Thread BSP
  --cdb                       make compile_commands.json

supperthomas avatar Jan 02 '25 11:01 supperthomas

scons --genconfig 根据rtconfig.h生成.config

supperthomas avatar Jan 02 '25 11:01 supperthomas

scons --pyconfig UI显示 保存最小配置 image

supperthomas avatar Jan 02 '25 11:01 supperthomas

scons --useconfig=fat.config 根据.config生成rtconfig.h

supperthomas avatar Jan 02 '25 11:01 supperthomas

scons --global-macros=RT_USING_PIN 编译的时候加宏

supperthomas avatar Jan 02 '25 12:01 supperthomas

scons --stackanalysis 线程分析

TODO: -fstack-usage -fdump-rtl-dfinish

rtconfig.py

CFLAGS = DEVICE + ' -Dgcc -fstack-usage -fdump-rtl-dfinish'

https://gitee.com/rtthread/rt-thread/pulls/29

supperthomas avatar Jan 02 '25 12:01 supperthomas

scons --reset-project-config 编译默认scons 配置

supperthomas avatar Jan 02 '25 12:01 supperthomas

scons --defconfig == scons --pyconfig-silent 编译不显示UI

supperthomas avatar Jan 02 '25 12:01 supperthomas

scons --cdb 生成 compile_commands.json 文件

supperthomas avatar Jan 02 '25 12:01 supperthomas

name: ToolsCI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  pull_request:
    branches:
      - master
    paths-ignore:
      - documentation/**
      - '**/README.md'
      - '**/README_zh.md'
      - '**/*.c'
      - '**/*.h'
      - '**/*.cpp'

permissions:
  contents: read # to fetch code (actions/checkout)

jobs:
  test:
    runs-on: windows-latest

    name: Tools
    strategy:
      fail-fast: false
    env:
      TEST_BSP_ROOT: bsp/stm32/stm32f407-atk-explorer
    steps:
    - uses: actions/checkout@v4

    - name: Install Tools
      shell: powershell
      run: |
          wget https://raw.githubusercontent.com/RT-Thread/env/master/install_windows.ps1 -O install_windows.ps1
          set-executionpolicy remotesigned
          .\install_windows.ps1
          scons --version

supperthomas avatar Jan 09 '25 12:01 supperthomas

https://blog.csdn.net/wenbo13579/article/details/126881034?spm=1001.2014.3001.5502

supperthomas avatar Feb 17 '25 03:02 supperthomas