[update] change ccflags to cflags
This commit is contained in:
parent
3448a8b6d5
commit
27511885f3
|
@ -18,12 +18,14 @@ DEPENDS = [""]
|
||||||
# SOURCES: Need to compile c and c++ source, auto search when SOURCES is empty
|
# SOURCES: Need to compile c and c++ source, auto search when SOURCES is empty
|
||||||
#
|
#
|
||||||
# LOCAL_CPPPATH: Local file path (.h/.c/.cpp)
|
# LOCAL_CPPPATH: Local file path (.h/.c/.cpp)
|
||||||
# LOCAL_CCFLAGS: Local compilation parameter
|
# LOCAL_CFLAGS: Local c compilation parameter
|
||||||
|
# LOCAL_CCFLAGS: Local c/c++ compilation parameter
|
||||||
|
# LOCAL_CXXFLAGS: Local c++ compilation parameter
|
||||||
# LOCAL_ASFLAGS: Local assembly parameters
|
# LOCAL_ASFLAGS: Local assembly parameters
|
||||||
#
|
#
|
||||||
# CPPPATH: Global file path (.h/.c/.cpp), auto search when LOCAL_CPPPATH/CPPPATH
|
# CPPPATH: Global file path (.h/.c/.cpp), auto search when LOCAL_CPPPATH/CPPPATH
|
||||||
# is empty # no pass!!!
|
# is empty # no pass!!!
|
||||||
# CCFLAGS: Global compilation parameter
|
# CFLAGS : Global compilation parameter
|
||||||
# ASFLAGS: Global assembly parameters
|
# ASFLAGS: Global assembly parameters
|
||||||
#
|
#
|
||||||
# CPPDEFINES: Global macro definition
|
# CPPDEFINES: Global macro definition
|
||||||
|
@ -37,12 +39,16 @@ DEPENDS = [""]
|
||||||
CWD = GetCurrentDir()
|
CWD = GetCurrentDir()
|
||||||
SOURCES = Glob("./source/*.c")
|
SOURCES = Glob("./source/*.c")
|
||||||
|
|
||||||
LOCAL_CPPPATH = []
|
LOCAL_CPPPATH = []
|
||||||
LOCAL_CCFLAGS = ""
|
LOCAL_CFLAGS = ""
|
||||||
|
LOCAL_CCFLAGS = ""
|
||||||
|
LOCAL_CXXFLAGS = ""
|
||||||
LOCAL_ASFLAGS = ""
|
LOCAL_ASFLAGS = ""
|
||||||
|
|
||||||
CPPPATH = [GetCurrentDir(), os.path.join(GetCurrentDir(), 'include')]
|
CPPPATH = [GetCurrentDir(), os.path.join(GetCurrentDir(), 'include')]
|
||||||
CCFLAGS = ""
|
CFLAGS = ""
|
||||||
|
CCFLAGS = ""
|
||||||
|
CXXFLAGS = ""
|
||||||
ASFLAGS = ""
|
ASFLAGS = ""
|
||||||
|
|
||||||
CPPDEFINES = []
|
CPPDEFINES = []
|
||||||
|
@ -61,10 +67,14 @@ CPPPATH_IGNORE = []
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
objs = DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
|
objs = DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
|
||||||
CPPPATH = CPPPATH,
|
CPPPATH = CPPPATH,
|
||||||
|
CFLAGS = CFLAGS,
|
||||||
CCFLAGS = CCFLAGS,
|
CCFLAGS = CCFLAGS,
|
||||||
|
CXXFLAGS = CXXFLAGS,
|
||||||
ASFLAGS = ASFLAGS,
|
ASFLAGS = ASFLAGS,
|
||||||
LOCAL_CPPPATH = LOCAL_CPPPATH,
|
LOCAL_CPPPATH = LOCAL_CPPPATH,
|
||||||
|
LOCAL_CFLAGS = LOCAL_CFLAGS,
|
||||||
LOCAL_CCFLAGS = LOCAL_CCFLAGS,
|
LOCAL_CCFLAGS = LOCAL_CCFLAGS,
|
||||||
|
LOCAL_CXXFLAGS = LOCAL_CXXFLAGS,
|
||||||
LOCAL_ASFLAGS = LOCAL_ASFLAGS,
|
LOCAL_ASFLAGS = LOCAL_ASFLAGS,
|
||||||
CPPDEFINES = CPPDEFINES,
|
CPPDEFINES = CPPDEFINES,
|
||||||
LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
|
LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
|
||||||
|
|
|
@ -19,12 +19,14 @@ DEPENDS = [""]
|
||||||
# SOURCES: Need to compile c and c++ source, auto search when SOURCES is empty
|
# SOURCES: Need to compile c and c++ source, auto search when SOURCES is empty
|
||||||
#
|
#
|
||||||
# LOCAL_CPPPATH: Local file path (.h/.c/.cpp)
|
# LOCAL_CPPPATH: Local file path (.h/.c/.cpp)
|
||||||
# LOCAL_CCFLAGS: Local compilation parameter
|
# LOCAL_CFLAGS: Local c compilation parameter
|
||||||
|
# LOCAL_CCFLAGS: Local c/c++ compilation parameter
|
||||||
|
# LOCAL_CXXFLAGS: Local c++ compilation parameter
|
||||||
# LOCAL_ASFLAGS: Local assembly parameters
|
# LOCAL_ASFLAGS: Local assembly parameters
|
||||||
#
|
#
|
||||||
# CPPPATH: Global file path (.h/.c/.cpp), auto search when LOCAL_CPPPATH/CPPPATH
|
# CPPPATH: Global file path (.h/.c/.cpp), auto search when LOCAL_CPPPATH/CPPPATH
|
||||||
# is empty # no pass!!!
|
# is empty # no pass!!!
|
||||||
# CCFLAGS: Global compilation parameter
|
# CFLAGS : Global compilation parameter
|
||||||
# ASFLAGS: Global assembly parameters
|
# ASFLAGS: Global assembly parameters
|
||||||
#
|
#
|
||||||
# CPPDEFINES: Global macro definition
|
# CPPDEFINES: Global macro definition
|
||||||
|
@ -35,22 +37,26 @@ DEPENDS = [""]
|
||||||
#
|
#
|
||||||
# LINKFLAGS: Link options
|
# LINKFLAGS: Link options
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
|
CWD = GetCurrentDir()
|
||||||
SOURCES = Glob("./source/*.c")
|
SOURCES = Glob("./source/*.c")
|
||||||
SOURCES += Glob("./source/*.S")
|
|
||||||
|
|
||||||
LOCAL_CPPPATH = []
|
LOCAL_CPPPATH = []
|
||||||
LOCAL_CCFLAGS = ""
|
LOCAL_CFLAGS = ""
|
||||||
|
LOCAL_CCFLAGS = ""
|
||||||
|
LOCAL_CXXFLAGS = ""
|
||||||
LOCAL_ASFLAGS = ""
|
LOCAL_ASFLAGS = ""
|
||||||
|
|
||||||
CPPPATH = [GetCurrentDir(), os.path.join(GetCurrentDir(), 'include')]
|
CPPPATH = [GetCurrentDir(), os.path.join(GetCurrentDir(), 'include')]
|
||||||
CCFLAGS = ""
|
CFLAGS = ""
|
||||||
|
CCFLAGS = ""
|
||||||
|
CXXFLAGS = ""
|
||||||
ASFLAGS = ""
|
ASFLAGS = ""
|
||||||
|
|
||||||
CPPDEFINES = []
|
CPPDEFINES = []
|
||||||
LOCAL_CPPDEFINES = []
|
LOCAL_CPPDEFINES = []
|
||||||
|
|
||||||
LIBS = []
|
LIBS = []
|
||||||
LIBPATH = []
|
LIBPATH = []
|
||||||
|
|
||||||
LINKFLAGS = ""
|
LINKFLAGS = ""
|
||||||
|
|
||||||
|
@ -62,10 +68,14 @@ CPPPATH_IGNORE = []
|
||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
objs = DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
|
objs = DefineGroup(name = PKGNAME, src = SOURCES, depend = DEPENDS,
|
||||||
CPPPATH = CPPPATH,
|
CPPPATH = CPPPATH,
|
||||||
|
CFLAGS = CFLAGS,
|
||||||
CCFLAGS = CCFLAGS,
|
CCFLAGS = CCFLAGS,
|
||||||
|
CXXFLAGS = CXXFLAGS,
|
||||||
ASFLAGS = ASFLAGS,
|
ASFLAGS = ASFLAGS,
|
||||||
LOCAL_CPPPATH = LOCAL_CPPPATH,
|
LOCAL_CPPPATH = LOCAL_CPPPATH,
|
||||||
|
LOCAL_CFLAGS = LOCAL_CFLAGS,
|
||||||
LOCAL_CCFLAGS = LOCAL_CCFLAGS,
|
LOCAL_CCFLAGS = LOCAL_CCFLAGS,
|
||||||
|
LOCAL_CXXFLAGS = LOCAL_CXXFLAGS,
|
||||||
LOCAL_ASFLAGS = LOCAL_ASFLAGS,
|
LOCAL_ASFLAGS = LOCAL_ASFLAGS,
|
||||||
CPPDEFINES = CPPDEFINES,
|
CPPDEFINES = CPPDEFINES,
|
||||||
LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
|
LOCAL_CPPDEFINES = LOCAL_CPPDEFINES,
|
||||||
|
|
|
@ -6,8 +6,8 @@ cwd = os.path.join(str(Dir('#')), 'applications')
|
||||||
src = Glob('*.c')
|
src = Glob('*.c')
|
||||||
CPPPATH = [cwd, str(Dir('#'))]
|
CPPPATH = [cwd, str(Dir('#'))]
|
||||||
|
|
||||||
CCFLAGS = ' -c -mistack -ffunction-sections'
|
CFLAGS = ' -c -mistack -ffunction-sections'
|
||||||
|
|
||||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CCFLAGS=CCFLAGS)
|
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CFLAGS=CFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -145,14 +145,14 @@ TARGET = 'rtthread.' + rtconfig.TARGET_EXT
|
||||||
DefaultEnvironment(tools=[])
|
DefaultEnvironment(tools=[])
|
||||||
env = Environment(tools = ['mingw'],
|
env = Environment(tools = ['mingw'],
|
||||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||||
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
|
||||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||||
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
||||||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||||
|
|
||||||
if rtconfig.PLATFORM == 'iar':
|
if rtconfig.PLATFORM == 'iar':
|
||||||
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
||||||
env.Replace(ARFLAGS = [''])
|
env.Replace(ARFLAGS = [''])
|
||||||
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map')
|
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rtthread.map')
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,15 @@ src = []
|
||||||
|
|
||||||
src += Glob('*.c')
|
src += Glob('*.c')
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
LOCAL_CCFLAGS = ''
|
LOCAL_CFLAGS = ''
|
||||||
|
|
||||||
if rtconfig.PLATFORM == 'gcc':
|
if rtconfig.PLATFORM == 'gcc':
|
||||||
LOCAL_CCFLAGS += ' -std=c99'
|
LOCAL_CFLAGS += ' -std=c99'
|
||||||
elif rtconfig.PLATFORM == 'armcc':
|
elif rtconfig.PLATFORM == 'armcc':
|
||||||
LOCAL_CCFLAGS += ' --c99'
|
LOCAL_CFLAGS += ' --c99'
|
||||||
elif rtconfig.PLATFORM == 'armclang':
|
elif rtconfig.PLATFORM == 'armclang':
|
||||||
LOCAL_CCFLAGS += ' -std=c99'
|
LOCAL_CFLAGS += ' -std=c99'
|
||||||
|
|
||||||
group = DefineGroup('FAL', src, depend = ['PKG_USING_FAL'], CPPPATH = CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
group = DefineGroup('FAL', src, depend = ['PKG_USING_FAL'], CPPPATH = CPPPATH, LOCAL_CFLAGS = LOCAL_CFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -8,15 +8,15 @@ src = []
|
||||||
|
|
||||||
src += Glob('*.c')
|
src += Glob('*.c')
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
LOCAL_CCFLAGS = ''
|
LOCAL_CFLAGS = ''
|
||||||
|
|
||||||
if rtconfig.PLATFORM == 'gcc':
|
if rtconfig.PLATFORM == 'gcc':
|
||||||
LOCAL_CCFLAGS += ' -std=c99'
|
LOCAL_CFLAGS += ' -std=c99'
|
||||||
elif rtconfig.PLATFORM == 'armcc':
|
elif rtconfig.PLATFORM == 'armcc':
|
||||||
LOCAL_CCFLAGS += ' --c99'
|
LOCAL_CFLAGS += ' --c99'
|
||||||
elif rtconfig.PLATFORM == 'armclang':
|
elif rtconfig.PLATFORM == 'armclang':
|
||||||
LOCAL_CCFLAGS += ' -std=c99'
|
LOCAL_CFLAGS += ' -std=c99'
|
||||||
|
|
||||||
group = DefineGroup('rw007', src, depend = ['BSP_USING_RW007'], CPPPATH = CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
group = DefineGroup('rw007', src, depend = ['BSP_USING_RW007'], CPPPATH = CPPPATH, LOCAL_CFLAGS = LOCAL_CFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -20,14 +20,14 @@ TARGET = 'rt-thread.' + rtconfig.TARGET_EXT
|
||||||
DefaultEnvironment(tools=[])
|
DefaultEnvironment(tools=[])
|
||||||
env = Environment(tools = ['mingw'],
|
env = Environment(tools = ['mingw'],
|
||||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||||
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
|
||||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||||
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
||||||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||||
|
|
||||||
if rtconfig.PLATFORM == 'iar':
|
if rtconfig.PLATFORM == 'iar':
|
||||||
env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
env.Replace(CCCOM = ['$CC $CFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
|
||||||
env.Replace(ARFLAGS = [''])
|
env.Replace(ARFLAGS = [''])
|
||||||
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
|
env.Replace(LINKCOM = env["LINKCOM"] + ' --map rt-thread.map')
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,16 @@ src = []
|
||||||
|
|
||||||
src += Glob('*.c')
|
src += Glob('*.c')
|
||||||
CPPPATH = [cwd]
|
CPPPATH = [cwd]
|
||||||
LOCAL_CCFLAGS = ''
|
LOCAL_CFLAGS = ''
|
||||||
|
|
||||||
if rtconfig.CROSS_TOOL == 'gcc':
|
if rtconfig.CROSS_TOOL == 'gcc':
|
||||||
LOCAL_CCFLAGS += ' -std=c99'
|
LOCAL_CFLAGS += ' -std=c99'
|
||||||
elif rtconfig.CROSS_TOOL == 'keil':
|
elif rtconfig.CROSS_TOOL == 'keil':
|
||||||
if rtconfig.PLATFORM == 'armcc':
|
if rtconfig.PLATFORM == 'armcc':
|
||||||
LOCAL_CCFLAGS += ' --c99'
|
LOCAL_CFLAGS += ' --c99'
|
||||||
elif rtconfig.PLATFORM == 'armclang':
|
elif rtconfig.PLATFORM == 'armclang':
|
||||||
LOCAL_CCFLAGS += ' -std=c99'
|
LOCAL_CFLAGS += ' -std=c99'
|
||||||
|
|
||||||
group = DefineGroup('FAL', src, depend = ['PKG_USING_FAL'], CPPPATH = CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
group = DefineGroup('FAL', src, depend = ['PKG_USING_FAL'], CPPPATH = CPPPATH, LOCAL_CFLAGS = LOCAL_CFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -6,8 +6,8 @@ cwd = GetCurrentDir()
|
||||||
src = Glob('*.c')
|
src = Glob('*.c')
|
||||||
CPPPATH = GetCurrentDir()
|
CPPPATH = GetCurrentDir()
|
||||||
|
|
||||||
CCFLAGS = ' -c -ffunction-sections'
|
CFLAGS = ' -c -ffunction-sections'
|
||||||
|
|
||||||
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CCFLAGS=CCFLAGS)
|
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, CFLAGS=CFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -6,7 +6,7 @@ from building import *
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
src = Glob('driverlib/*.c')
|
src = Glob('driverlib/*.c')
|
||||||
SrcRemove(src, 'onewire.c')
|
SrcRemove(src, 'onewire.c')
|
||||||
CCFLAGS = ''
|
CFLAGS = ''
|
||||||
|
|
||||||
# add for startup script
|
# add for startup script
|
||||||
if rtconfig.CROSS_TOOL == 'gcc':
|
if rtconfig.CROSS_TOOL == 'gcc':
|
||||||
|
@ -15,12 +15,12 @@ elif rtconfig.CROSS_TOOL == 'keil':
|
||||||
src += ['startup/startup_rvmdk.S']
|
src += ['startup/startup_rvmdk.S']
|
||||||
elif rtconfig.CROSS_TOOL == 'iar':
|
elif rtconfig.CROSS_TOOL == 'iar':
|
||||||
src += ['startup/startup_ewarm.c']
|
src += ['startup/startup_ewarm.c']
|
||||||
CCFLAGS += ' --diag_suppress=pe177'
|
CFLAGS += ' --diag_suppress=pe177'
|
||||||
|
|
||||||
CPPPATH = [cwd, cwd + '/inc', cwd + '/driverlib']
|
CPPPATH = [cwd, cwd + '/inc', cwd + '/driverlib']
|
||||||
|
|
||||||
|
|
||||||
CPPDEFINES = [rtconfig.PART_TYPE]
|
CPPDEFINES = [rtconfig.PART_TYPE]
|
||||||
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, CCFLAGS = CCFLAGS)
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, CFLAGS = CFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -4,7 +4,7 @@ import rtconfig
|
||||||
cwd = GetCurrentDir()
|
cwd = GetCurrentDir()
|
||||||
src = ['spi_core.c', 'spi_dev.c']
|
src = ['spi_core.c', 'spi_dev.c']
|
||||||
CPPPATH = [cwd, cwd + '/../include']
|
CPPPATH = [cwd, cwd + '/../include']
|
||||||
LOCAL_CCFLAGS = ''
|
LOCAL_CFLAGS = ''
|
||||||
|
|
||||||
if GetDepend('RT_USING_QSPI'):
|
if GetDepend('RT_USING_QSPI'):
|
||||||
src += ['qspi_core.c']
|
src += ['qspi_core.c']
|
||||||
|
@ -26,15 +26,15 @@ if GetDepend('RT_USING_SFUD'):
|
||||||
if GetDepend('RT_SFUD_USING_SFDP'):
|
if GetDepend('RT_SFUD_USING_SFDP'):
|
||||||
src_device += ['sfud/src/sfud_sfdp.c']
|
src_device += ['sfud/src/sfud_sfdp.c']
|
||||||
if rtconfig.CROSS_TOOL == 'gcc':
|
if rtconfig.CROSS_TOOL == 'gcc':
|
||||||
LOCAL_CCFLAGS += ' -std=c99'
|
LOCAL_CFLAGS += ' -std=c99'
|
||||||
elif rtconfig.CROSS_TOOL == 'keil':
|
elif rtconfig.CROSS_TOOL == 'keil':
|
||||||
if rtconfig.PLATFORM == 'armcc':
|
if rtconfig.PLATFORM == 'armcc':
|
||||||
LOCAL_CCFLAGS += ' --c99'
|
LOCAL_CFLAGS += ' --c99'
|
||||||
elif rtconfig.PLATFORM == 'armclang':
|
elif rtconfig.PLATFORM == 'armclang':
|
||||||
LOCAL_CCFLAGS += ' -std=c99'
|
LOCAL_CFLAGS += ' -std=c99'
|
||||||
|
|
||||||
src += src_device
|
src += src_device
|
||||||
|
|
||||||
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SPI'], CPPPATH = CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
|
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SPI'], CPPPATH = CPPPATH, LOCAL_CFLAGS = LOCAL_CFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -557,11 +557,21 @@ def AddDepend(option):
|
||||||
|
|
||||||
def MergeGroup(src_group, group):
|
def MergeGroup(src_group, group):
|
||||||
src_group['src'] = src_group['src'] + group['src']
|
src_group['src'] = src_group['src'] + group['src']
|
||||||
|
if 'CFLAGS' in group:
|
||||||
|
if 'CFLAGS' in src_group:
|
||||||
|
src_group['CFLAGS'] = src_group['CFLAGS'] + group['CFLAGS']
|
||||||
|
else:
|
||||||
|
src_group['CFLAGS'] = group['CFLAGS']
|
||||||
if 'CCFLAGS' in group:
|
if 'CCFLAGS' in group:
|
||||||
if 'CCFLAGS' in src_group:
|
if 'CCFLAGS' in src_group:
|
||||||
src_group['CCFLAGS'] = src_group['CCFLAGS'] + group['CCFLAGS']
|
src_group['CCFLAGS'] = src_group['CCFLAGS'] + group['CCFLAGS']
|
||||||
else:
|
else:
|
||||||
src_group['CCFLAGS'] = group['CCFLAGS']
|
src_group['CCFLAGS'] = group['CCFLAGS']
|
||||||
|
if 'CXXFLAGS' in group:
|
||||||
|
if 'CXXFLAGS' in src_group:
|
||||||
|
src_group['CXXFLAGS'] = src_group['CXXFLAGS'] + group['CXXFLAGS']
|
||||||
|
else:
|
||||||
|
src_group['CXXFLAGS'] = group['CXXFLAGS']
|
||||||
if 'CPPPATH' in group:
|
if 'CPPPATH' in group:
|
||||||
if 'CPPPATH' in src_group:
|
if 'CPPPATH' in src_group:
|
||||||
src_group['CPPPATH'] = src_group['CPPPATH'] + group['CPPPATH']
|
src_group['CPPPATH'] = src_group['CPPPATH'] + group['CPPPATH']
|
||||||
|
@ -579,11 +589,21 @@ def MergeGroup(src_group, group):
|
||||||
src_group['ASFLAGS'] = group['ASFLAGS']
|
src_group['ASFLAGS'] = group['ASFLAGS']
|
||||||
|
|
||||||
# for local CCFLAGS/CPPPATH/CPPDEFINES
|
# for local CCFLAGS/CPPPATH/CPPDEFINES
|
||||||
|
if 'LOCAL_CFLAGS' in group:
|
||||||
|
if 'LOCAL_CFLAGS' in src_group:
|
||||||
|
src_group['LOCAL_CFLAGS'] = src_group['LOCAL_CFLAGS'] + group['LOCAL_CFLAGS']
|
||||||
|
else:
|
||||||
|
src_group['LOCAL_CFLAGS'] = group['LOCAL_CFLAGS']
|
||||||
if 'LOCAL_CCFLAGS' in group:
|
if 'LOCAL_CCFLAGS' in group:
|
||||||
if 'LOCAL_CCFLAGS' in src_group:
|
if 'LOCAL_CCFLAGS' in src_group:
|
||||||
src_group['LOCAL_CCFLAGS'] = src_group['LOCAL_CCFLAGS'] + group['LOCAL_CCFLAGS']
|
src_group['LOCAL_CCFLAGS'] = src_group['LOCAL_CCFLAGS'] + group['LOCAL_CCFLAGS']
|
||||||
else:
|
else:
|
||||||
src_group['LOCAL_CCFLAGS'] = group['LOCAL_CCFLAGS']
|
src_group['LOCAL_CCFLAGS'] = group['LOCAL_CCFLAGS']
|
||||||
|
if 'LOCAL_CXXFLAGS' in group:
|
||||||
|
if 'LOCAL_CXXFLAGS' in src_group:
|
||||||
|
src_group['LOCAL_CXXFLAGS'] = src_group['LOCAL_CXXFLAGS'] + group['LOCAL_CXXFLAGS']
|
||||||
|
else:
|
||||||
|
src_group['LOCAL_CXXFLAGS'] = group['LOCAL_CXXFLAGS']
|
||||||
if 'LOCAL_CPPPATH' in group:
|
if 'LOCAL_CPPPATH' in group:
|
||||||
if 'LOCAL_CPPPATH' in src_group:
|
if 'LOCAL_CPPPATH' in src_group:
|
||||||
src_group['LOCAL_CPPPATH'] = src_group['LOCAL_CPPPATH'] + group['LOCAL_CPPPATH']
|
src_group['LOCAL_CPPPATH'] = src_group['LOCAL_CPPPATH'] + group['LOCAL_CPPPATH']
|
||||||
|
@ -650,10 +670,18 @@ def DefineGroup(name, src, depend, **parameters):
|
||||||
else:
|
else:
|
||||||
group['src'] = src
|
group['src'] = src
|
||||||
|
|
||||||
|
if 'CFLAGS' in group:
|
||||||
|
target = group['CFLAGS']
|
||||||
|
if len(target) > 0:
|
||||||
|
Env.AppendUnique(CFLAGS = target)
|
||||||
if 'CCFLAGS' in group:
|
if 'CCFLAGS' in group:
|
||||||
target = group['CCFLAGS']
|
target = group['CCFLAGS']
|
||||||
if len(target) > 0:
|
if len(target) > 0:
|
||||||
Env.AppendUnique(CCFLAGS = target)
|
Env.AppendUnique(CCFLAGS = target)
|
||||||
|
if 'CXXFLAGS' in group:
|
||||||
|
target = group['CXXFLAGS']
|
||||||
|
if len(target) > 0:
|
||||||
|
Env.AppendUnique(CXXFLAGS = target)
|
||||||
if 'CPPPATH' in group:
|
if 'CPPPATH' in group:
|
||||||
target = group['CPPPATH']
|
target = group['CPPPATH']
|
||||||
if _PretreatListParameters(target) == True:
|
if _PretreatListParameters(target) == True:
|
||||||
|
@ -682,11 +710,18 @@ def DefineGroup(name, src, depend, **parameters):
|
||||||
|
|
||||||
import rtconfig
|
import rtconfig
|
||||||
if rtconfig.PLATFORM == 'gcc':
|
if rtconfig.PLATFORM == 'gcc':
|
||||||
|
if 'CFLAGS' in group:
|
||||||
|
group['CFLAGS'] = utils.GCCC99Patch(group['CFLAGS'])
|
||||||
if 'CCFLAGS' in group:
|
if 'CCFLAGS' in group:
|
||||||
group['CCFLAGS'] = utils.GCCC99Patch(group['CCFLAGS'])
|
group['CCFLAGS'] = utils.GCCC99Patch(group['CCFLAGS'])
|
||||||
|
if 'CXXFLAGS' in group:
|
||||||
|
group['CXXFLAGS'] = utils.GCCC99Patch(group['CXXFLAGS'])
|
||||||
if 'LOCAL_CCFLAGS' in group:
|
if 'LOCAL_CCFLAGS' in group:
|
||||||
group['LOCAL_CCFLAGS'] = utils.GCCC99Patch(group['LOCAL_CCFLAGS'])
|
group['LOCAL_CCFLAGS'] = utils.GCCC99Patch(group['LOCAL_CCFLAGS'])
|
||||||
|
if 'LOCAL_CXXFLAGS' in group:
|
||||||
|
group['LOCAL_CXXFLAGS'] = utils.GCCC99Patch(group['LOCAL_CXXFLAGS'])
|
||||||
|
if 'LOCAL_CFLAGS' in group:
|
||||||
|
group['LOCAL_CFLAGS'] = utils.GCCC99Patch(group['LOCAL_CFLAGS'])
|
||||||
# check whether to clean up library
|
# check whether to clean up library
|
||||||
if GetOption('cleanlib') and os.path.exists(os.path.join(group['path'], GroupLibFullName(name, Env))):
|
if GetOption('cleanlib') and os.path.exists(os.path.join(group['path'], GroupLibFullName(name, Env))):
|
||||||
if group['src'] != []:
|
if group['src'] != []:
|
||||||
|
@ -785,14 +820,16 @@ def DoBuilding(target, objects):
|
||||||
|
|
||||||
# handle local group
|
# handle local group
|
||||||
def local_group(group, objects):
|
def local_group(group, objects):
|
||||||
if 'LOCAL_CCFLAGS' in group or 'LOCAL_CPPPATH' in group or 'LOCAL_CPPDEFINES' in group or 'LOCAL_ASFLAGS' in group:
|
if 'LOCAL_CFLAGS' in group or 'LOCAL_CXXFLAGS' in group or 'LOCAL_CCFLAGS' in group or 'LOCAL_CPPPATH' in group or 'LOCAL_CPPDEFINES' in group or 'LOCAL_ASFLAGS' in group:
|
||||||
|
CFLAGS = Env.get('CFLAGS', '') + group.get('LOCAL_CFLAGS', '')
|
||||||
CCFLAGS = Env.get('CCFLAGS', '') + group.get('LOCAL_CCFLAGS', '')
|
CCFLAGS = Env.get('CCFLAGS', '') + group.get('LOCAL_CCFLAGS', '')
|
||||||
|
CXXFLAGS = Env.get('CXXFLAGS', '') + group.get('LOCAL_CXXFLAGS', '')
|
||||||
CPPPATH = Env.get('CPPPATH', ['']) + group.get('LOCAL_CPPPATH', [''])
|
CPPPATH = Env.get('CPPPATH', ['']) + group.get('LOCAL_CPPPATH', [''])
|
||||||
CPPDEFINES = Env.get('CPPDEFINES', ['']) + group.get('LOCAL_CPPDEFINES', [''])
|
CPPDEFINES = Env.get('CPPDEFINES', ['']) + group.get('LOCAL_CPPDEFINES', [''])
|
||||||
ASFLAGS = Env.get('ASFLAGS', '') + group.get('LOCAL_ASFLAGS', '')
|
ASFLAGS = Env.get('ASFLAGS', '') + group.get('LOCAL_ASFLAGS', '')
|
||||||
|
|
||||||
for source in group['src']:
|
for source in group['src']:
|
||||||
objects.append(Env.Object(source, CCFLAGS = CCFLAGS, ASFLAGS = ASFLAGS,
|
objects.append(Env.Object(source, CFLAGS = CFLAGS, CCFLAGS = CCFLAGS, CXXFLAGS = CXXFLAGS, ASFLAGS = ASFLAGS,
|
||||||
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES))
|
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES))
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@ -822,7 +859,7 @@ def DoBuilding(target, objects):
|
||||||
else:
|
else:
|
||||||
# remove source files with local flags setting
|
# remove source files with local flags setting
|
||||||
for group in Projects:
|
for group in Projects:
|
||||||
if 'LOCAL_CCFLAGS' in group or 'LOCAL_CPPPATH' in group or 'LOCAL_CPPDEFINES' in group:
|
if 'LOCAL_CFLAGS' in group or 'LOCAL_CXXFLAGS' in group or 'LOCAL_CCFLAGS' in group or 'LOCAL_CPPPATH' in group or 'LOCAL_CPPDEFINES' in group:
|
||||||
for source in group['src']:
|
for source in group['src']:
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
if source.abspath == obj.abspath or (len(obj.sources) > 0 and source.abspath == obj.sources[0].abspath):
|
if source.abspath == obj.abspath or (len(obj.sources) > 0 and source.abspath == obj.sources[0].abspath):
|
||||||
|
|
|
@ -194,8 +194,8 @@ def TargetCodelite(script, program):
|
||||||
#print building.Env.get('LIBPATH', [])
|
#print building.Env.get('LIBPATH', [])
|
||||||
#print building.Env.get('LIBS', [])
|
#print building.Env.get('LIBS', [])
|
||||||
|
|
||||||
CLSetCFlags(root, building.Env.get('CCFLAGS', []))
|
CLSetCFlags(root, building.Env.get('CFLAGS', []))
|
||||||
CLSetCxxFlags(root, building.Env.get('CCFLAGS', []))
|
CLSetCxxFlags(root, building.Env.get('CFLAGS', []))
|
||||||
|
|
||||||
asflags = building.Env.get('ASFLAGS', [])
|
asflags = building.Env.get('ASFLAGS', [])
|
||||||
asflags = asflags.replace('-ffunction-sections', '')
|
asflags = asflags.replace('-ffunction-sections', '')
|
||||||
|
|
|
@ -88,7 +88,7 @@ def IARProject(target, script):
|
||||||
CPPPATH = []
|
CPPPATH = []
|
||||||
CPPDEFINES = []
|
CPPDEFINES = []
|
||||||
LINKFLAGS = ''
|
LINKFLAGS = ''
|
||||||
CCFLAGS = ''
|
CFLAGS = ''
|
||||||
Libs = []
|
Libs = []
|
||||||
lib_prefix = ['lib', '']
|
lib_prefix = ['lib', '']
|
||||||
lib_suffix = ['.a', '.o', '']
|
lib_suffix = ['.a', '.o', '']
|
||||||
|
|
|
@ -192,7 +192,7 @@ def MDK45Project(tree, target, script):
|
||||||
CPPPATH = []
|
CPPPATH = []
|
||||||
CPPDEFINES = []
|
CPPDEFINES = []
|
||||||
LINKFLAGS = ''
|
LINKFLAGS = ''
|
||||||
CCFLAGS = ''
|
CFLAGS = ''
|
||||||
ProjectFiles = []
|
ProjectFiles = []
|
||||||
|
|
||||||
# add group
|
# add group
|
||||||
|
@ -204,14 +204,14 @@ def MDK45Project(tree, target, script):
|
||||||
group_tree = MDK4AddGroup(ProjectFiles, groups, group['name'], group['src'], project_path)
|
group_tree = MDK4AddGroup(ProjectFiles, groups, group['name'], group['src'], project_path)
|
||||||
|
|
||||||
# for local CPPPATH/CPPDEFINES
|
# for local CPPPATH/CPPDEFINES
|
||||||
if (group_tree != None) and ('LOCAL_CPPPATH' in group or 'LOCAL_CCFLAGS' in group or 'LOCAL_CPPDEFINES' in group):
|
if (group_tree != None) and ('LOCAL_CPPPATH' in group or 'LOCAL_CFLAGS' in group or 'LOCAL_CPPDEFINES' in group):
|
||||||
GroupOption = SubElement(group_tree, 'GroupOption')
|
GroupOption = SubElement(group_tree, 'GroupOption')
|
||||||
GroupArmAds = SubElement(GroupOption, 'GroupArmAds')
|
GroupArmAds = SubElement(GroupOption, 'GroupArmAds')
|
||||||
Cads = SubElement(GroupArmAds, 'Cads')
|
Cads = SubElement(GroupArmAds, 'Cads')
|
||||||
VariousControls = SubElement(Cads, 'VariousControls')
|
VariousControls = SubElement(Cads, 'VariousControls')
|
||||||
MiscControls = SubElement(VariousControls, 'MiscControls')
|
MiscControls = SubElement(VariousControls, 'MiscControls')
|
||||||
if 'LOCAL_CCFLAGS' in group:
|
if 'LOCAL_CFLAGS' in group:
|
||||||
MiscControls.text = group['LOCAL_CCFLAGS']
|
MiscControls.text = group['LOCAL_CFLAGS']
|
||||||
else:
|
else:
|
||||||
MiscControls.text = ' '
|
MiscControls.text = ' '
|
||||||
Define = SubElement(VariousControls, 'Define')
|
Define = SubElement(VariousControls, 'Define')
|
||||||
|
@ -329,7 +329,7 @@ def MDKProject(target, script):
|
||||||
CPPPATH = []
|
CPPPATH = []
|
||||||
CPPDEFINES = []
|
CPPDEFINES = []
|
||||||
LINKFLAGS = ''
|
LINKFLAGS = ''
|
||||||
CCFLAGS = ''
|
CFLAGS = ''
|
||||||
|
|
||||||
# number of groups
|
# number of groups
|
||||||
group_index = 1
|
group_index = 1
|
||||||
|
|
10
tools/ses.py
10
tools/ses.py
|
@ -49,7 +49,7 @@ def SESProject(env) :
|
||||||
CPPPATH = []
|
CPPPATH = []
|
||||||
CPPDEFINES = []
|
CPPDEFINES = []
|
||||||
LINKFLAGS = ''
|
LINKFLAGS = ''
|
||||||
CCFLAGS = ''
|
CFLAGS = ''
|
||||||
|
|
||||||
project_node = tree.find('project')
|
project_node = tree.find('project')
|
||||||
|
|
||||||
|
@ -59,11 +59,11 @@ def SESProject(env) :
|
||||||
group_tree = SDKAddGroup(project_node, group['name'], group['src'], project_path)
|
group_tree = SDKAddGroup(project_node, group['name'], group['src'], project_path)
|
||||||
|
|
||||||
# get each group's cc flags
|
# get each group's cc flags
|
||||||
if 'CCFLAGS' in group and group['CCFLAGS']:
|
if 'CFLAGS' in group and group['CFLAGS']:
|
||||||
if CCFLAGS:
|
if CFLAGS:
|
||||||
CCFLAGS += ' ' + group['CCFLAGS']
|
CFLAGS += ' ' + group['CFLAGS']
|
||||||
else:
|
else:
|
||||||
CCFLAGS += group['CCFLAGS']
|
CFLAGS += group['CFLAGS']
|
||||||
|
|
||||||
# get each group's link flags
|
# get each group's link flags
|
||||||
if 'LINKFLAGS' in group and group['LINKFLAGS']:
|
if 'LINKFLAGS' in group and group['LINKFLAGS']:
|
||||||
|
|
Loading…
Reference in New Issue