1import os 2from building import * 3from gcc import * 4Import('rtconfig') 5 6group = [] 7 8musllibc_version = GetMuslVersion(rtconfig) 9 10if musllibc_version: 11 print('Musl version: ' + musllibc_version) 12 13 cwd = GetCurrentDir() 14 src = Glob('*.c') 15 16 CPPPATH = [cwd] 17 CPPDEFINES = ['RT_USING_MUSLLIBC', 'RT_USING_LIBC'] 18 LIBS = ['c', 'gcc'] 19 LINKFLAGS = ' --specs=kernel.specs' 20 AddDepend(['RT_USING_MUSLLIBC', 'RT_USING_LIBC']) 21 22 group = group + DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS, CPPDEFINES = CPPDEFINES, LIBS = LIBS) 23 24 list = os.listdir(cwd) 25 for d in list: 26 path = os.path.join(cwd, d) 27 if os.path.isfile(os.path.join(path, 'SConscript')): 28 group = group + SConscript(os.path.join(d, 'SConscript')) 29 30Return('group') 31