Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RT-THREAD scons命令汇总 #570

Open
supperthomas opened this issue Jan 2, 2025 · 13 comments
Open

RT-THREAD scons命令汇总 #570

supperthomas opened this issue Jan 2, 2025 · 13 comments

Comments

@supperthomas
Copy link
Owner

supperthomas commented Jan 2, 2025

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

@supperthomas
Copy link
Owner Author

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
Copy link
Owner Author

scons --verbose

@supperthomas
Copy link
Owner Author

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

@supperthomas
Copy link
Owner Author

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
Copy link
Owner Author

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

@supperthomas
Copy link
Owner Author

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

@supperthomas
Copy link
Owner Author

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

@supperthomas
Copy link
Owner Author

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

@supperthomas
Copy link
Owner Author

supperthomas commented Jan 2, 2025

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
Copy link
Owner Author

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

@supperthomas
Copy link
Owner Author

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

@supperthomas
Copy link
Owner Author

supperthomas commented Jan 2, 2025

scons --cdb
生成
compile_commands.json 文件

@supperthomas
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant