Browse Source

[stm32][bsp] The sconscript script in the application folder increases the recursion searching capability

Meco Man 3 years ago
parent
commit
fa4b7ec8fd

+ 8 - 3
bsp/stm32/stm32f103-blue-pill/applications/SConscript

@@ -1,11 +1,16 @@
-Import('RTT_ROOT')
-Import('rtconfig')
 from building import *
 from building import *
+import os
 
 
 cwd = GetCurrentDir()
 cwd = GetCurrentDir()
 src = Glob('*.c')
 src = Glob('*.c')
-CPPPATH = [cwd, ]
+CPPPATH = [cwd]
 
 
 group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
 group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
 
 
+list = os.listdir(cwd)
+for d in list:
+    path = os.path.join(cwd, d)
+    if os.path.isfile(os.path.join(path, 'SConscript')):
+        group = group + SConscript(os.path.join(d, 'SConscript'))
+
 Return('group')
 Return('group')

+ 3 - 6
bsp/stm32/stm32f407-atk-explorer/applications/SConscript

@@ -1,12 +1,9 @@
-import rtconfig
-import os
 from building import *
 from building import *
+import os
 
 
 cwd     = GetCurrentDir()
 cwd     = GetCurrentDir()
-CPPPATH = [cwd, str(Dir('#'))]
-src     = Split("""
-main.c
-""")
+CPPPATH = [cwd]
+src = Glob('*.c')
 
 
 group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
 group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
 
 

+ 9 - 2
bsp/stm32/stm32l475-atk-pandora/applications/SConscript

@@ -1,6 +1,7 @@
 from building import *
 from building import *
+import os
 
 
-cwd     = GetCurrentDir()
+cwd = GetCurrentDir()
 
 
 src = Split('''
 src = Split('''
 main.c
 main.c
@@ -12,8 +13,14 @@ if GetDepend(['BSP_USING_SPI_LCD']):
 if GetDepend(['PKG_USING_NRF24L01']):
 if GetDepend(['PKG_USING_NRF24L01']):
     src += ['nrf24l01_init.c']
     src += ['nrf24l01_init.c']
 
 
-CPPPATH = [str(Dir('#')), cwd]
+CPPPATH = [cwd]
 
 
 group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
 group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
 
 
+list = os.listdir(cwd)
+for d in list:
+    path = os.path.join(cwd, d)
+    if os.path.isfile(os.path.join(path, 'SConscript')):
+        group = group + SConscript(os.path.join(d, 'SConscript'))
+
 Return('group')
 Return('group')