Wells_RTthread/app_wells_0407/workspace1/wells/cubemx/SConscript

36 lines
878 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os
#引入os模块
from building import *
#导入building的所有模块
cwd = GetCurrentDir()
#获取获取当前路径并保存至变量cwd
src = Glob('*.c')
#获取当前目录下的所有 C 文件并保存至src变量
# add cubemx drivers
#由于RT-Thread工程中存在部分相同函数文件所以对src重新赋值
#文件中的stm32g4xx_it.c 、 system_stm32g4xx.c不加入构建
#其余文件按相同格式填写到下述括号内
src = Split('''
Src/stm32l0xx_hal_msp.c
Src/main.c
Src/gpio.c
Src/usart.c
Src/stm32l0xx_it.c
Src/rtc.c
Src/adc.c
Src/dma.c
Src/iwdg.c
Src/spi.c
''')
#创建路径列表并保存至path中
path = [cwd]
path += [cwd + '/Inc']
#这是 RT-Thread 基于 SCons 扩展的一个方法(函数)。
group = DefineGroup('cubemx', src, depend = [''], CPPPATH = path)
Return('group')
#这部分代码文章最后有解释