@@ -15,35 +15,42 @@ except:
1515 print (RTT_ROOT )
1616 exit (- 1 )
1717
18- TARGET = 'rt-thread.' + rtconfig .TARGET_EXT
19-
18+ TARGET = 'rtthread.' + rtconfig .TARGET_EXT
2019DefaultEnvironment (tools = [])
21- env = Environment (tools = ['mingw' ],
22- AS = rtconfig .AS , ASFLAGS = rtconfig .AFLAGS ,
23- CC = rtconfig .CC , CFLAGS = rtconfig .CFLAGS ,
24- AR = rtconfig .AR , ARFLAGS = '-rc' ,
25- CXX = rtconfig .CXX , CXXFLAGS = rtconfig .CXXFLAGS ,
26- LINK = rtconfig .LINK , LINKFLAGS = rtconfig .LFLAGS )
20+ if rtconfig .PLATFORM == 'armcc' :
21+ env = Environment (tools = ['mingw' ],
22+ AS = rtconfig .AS , ASFLAGS = rtconfig .AFLAGS ,
23+ CC = rtconfig .CC , CFLAGS = rtconfig .CFLAGS ,
24+ CXX = rtconfig .CXX , CXXFLAGS = rtconfig .CXXFLAGS ,
25+ AR = rtconfig .AR , ARFLAGS = '-rc' ,
26+ LINK = rtconfig .LINK , LINKFLAGS = rtconfig .LFLAGS ,
27+ # overwrite cflags, because cflags has '--C99'
28+ CXXCOM = '$CXX -o $TARGET --cpp -c $CXXFLAGS $_CCCOMCOM $SOURCES' )
29+ else :
30+ env = Environment (tools = ['mingw' ],
31+ AS = rtconfig .AS , ASFLAGS = rtconfig .AFLAGS ,
32+ CC = rtconfig .CC , CFLAGS = rtconfig .CFLAGS ,
33+ CXX = rtconfig .CXX , CXXFLAGS = rtconfig .CXXFLAGS ,
34+ AR = rtconfig .AR , ARFLAGS = '-rc' ,
35+ LINK = rtconfig .LINK , LINKFLAGS = rtconfig .LFLAGS ,
36+ CXXCOM = '$CXX -o $TARGET -c $CXXFLAGS $_CCCOMCOM $SOURCES' )
37+
2738env .PrependENVPath ('PATH' , rtconfig .EXEC_PATH )
2839
2940if rtconfig .PLATFORM == 'iar' :
3041 env .Replace (CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES' ])
3142 env .Replace (ARFLAGS = ['' ])
32- env .Replace (LINKCOM = env ["LINKCOM" ] + ' --map rt-thread .map' )
43+ env .Replace (LINKCOM = env ["LINKCOM" ] + ' --map rtthread .map' )
3344
3445Export ('RTT_ROOT' )
3546Export ('rtconfig' )
3647
3748SDK_ROOT = os .path .abspath ('./' )
38-
3949if os .path .exists (SDK_ROOT + '/libraries' ):
4050 libraries_path_prefix = SDK_ROOT + '/libraries'
4151else :
4252 libraries_path_prefix = os .path .dirname (SDK_ROOT ) + '/libraries'
4353
44- from utils import _make_path_relative
45- libraries_path_prefix = _make_path_relative (os .path .abspath ('./' ), libraries_path_prefix )
46-
4754SDK_LIB = libraries_path_prefix
4855Export ('SDK_LIB' )
4956
@@ -53,19 +60,14 @@ objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
5360imxrt_library = 'MIMXRT1060'
5461rtconfig .BSP_LIBRARY_TYPE = imxrt_library
5562
56- bsp_vdir = 'build'
57-
5863# include libraries
59- objs .extend (SConscript (os .path .join (libraries_path_prefix , imxrt_library , 'SConscript' ),
60- variant_dir = bsp_vdir + '/libraries/' + imxrt_library , duplicate = 0 ))
64+ objs .extend (SConscript (os .path .join (libraries_path_prefix , imxrt_library , 'SConscript' )))
6165
6266# include drivers
63- objs .extend (SConscript (os .path .join (libraries_path_prefix , 'drivers' , 'SConscript' ),
64- variant_dir = bsp_vdir + '/libraries/drivers' , duplicate = 0 ))
67+ objs .extend (SConscript (os .path .join (libraries_path_prefix , 'drivers' , 'SConscript' )))
6568
66- bsp_port_script = os .path .join (os .getcwd (), 'board' , 'ports' , 'SConscript' )
67- if os .path .isfile (bsp_port_script ):
68- objs .extend (SConscript (bsp_port_script , variant_dir = bsp_vdir + '/board/ports' , duplicate = 0 ))
69+ # include peripherals
70+ objs .extend (SConscript (os .path .join (libraries_path_prefix , 'peripherals' , 'SConscript' )))
6971
7072# make a building
7173DoBuilding (TARGET , objs )
0 commit comments