[tools][building] Add ASFLAGS in DefineGroup.
This commit is contained in:
parent
7a1f8ee1c4
commit
099062de78
|
@ -4,6 +4,7 @@ from building import *
|
||||||
|
|
||||||
comm = rtconfig.ARCH + '/common'
|
comm = rtconfig.ARCH + '/common'
|
||||||
path = rtconfig.ARCH + '/' + rtconfig.CPU
|
path = rtconfig.ARCH + '/' + rtconfig.CPU
|
||||||
|
AFLAGS = ''
|
||||||
|
|
||||||
# The set of source files associated with this SConscript file.
|
# The set of source files associated with this SConscript file.
|
||||||
if rtconfig.PLATFORM == 'armcc':
|
if rtconfig.PLATFORM == 'armcc':
|
||||||
|
@ -21,7 +22,10 @@ if rtconfig.PLATFORM == 'cl':
|
||||||
if rtconfig.PLATFORM == 'mingw':
|
if rtconfig.PLATFORM == 'mingw':
|
||||||
src = Glob(path + '/*.c')
|
src = Glob(path + '/*.c')
|
||||||
|
|
||||||
|
if rtconfig.PLATFORM == 'armcc' and rtconfig.ARCH == 'arm' and rtconfig.CPU == 'arm926':
|
||||||
|
ASFLAGS = ' --cpreproc'
|
||||||
|
|
||||||
CPPPATH = [RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU, RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/common']
|
CPPPATH = [RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU, RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/common']
|
||||||
group = DefineGroup(rtconfig.CPU.upper(), src, depend = [''], CPPPATH = CPPPATH)
|
group = DefineGroup(rtconfig.CPU.upper(), src, depend = [''], CPPPATH = CPPPATH, ASFLAGS = ASFLAGS)
|
||||||
|
|
||||||
Return('group')
|
Return('group')
|
||||||
|
|
|
@ -487,6 +487,11 @@ def MergeGroup(src_group, group):
|
||||||
src_group['CPPDEFINES'] = src_group['CPPDEFINES'] + group['CPPDEFINES']
|
src_group['CPPDEFINES'] = src_group['CPPDEFINES'] + group['CPPDEFINES']
|
||||||
else:
|
else:
|
||||||
src_group['CPPDEFINES'] = group['CPPDEFINES']
|
src_group['CPPDEFINES'] = group['CPPDEFINES']
|
||||||
|
if group.has_key('ASFLAGS'):
|
||||||
|
if src_group.has_key('ASFLAGS'):
|
||||||
|
src_group['ASFLAGS'] = src_group['ASFLAGS'] + group['ASFLAGS']
|
||||||
|
else:
|
||||||
|
src_group['ASFLAGS'] = group['ASFLAGS']
|
||||||
|
|
||||||
# for local CCFLAGS/CPPPATH/CPPDEFINES
|
# for local CCFLAGS/CPPPATH/CPPDEFINES
|
||||||
if group.has_key('LOCAL_CCFLAGS'):
|
if group.has_key('LOCAL_CCFLAGS'):
|
||||||
|
@ -520,6 +525,11 @@ def MergeGroup(src_group, group):
|
||||||
src_group['LIBPATH'] = src_group['LIBPATH'] + group['LIBPATH']
|
src_group['LIBPATH'] = src_group['LIBPATH'] + group['LIBPATH']
|
||||||
else:
|
else:
|
||||||
src_group['LIBPATH'] = group['LIBPATH']
|
src_group['LIBPATH'] = group['LIBPATH']
|
||||||
|
if group.has_key('LOCAL_ASFLAGS'):
|
||||||
|
if src_group.has_key('LOCAL_ASFLAGS'):
|
||||||
|
src_group['LOCAL_ASFLAGS'] = src_group['LOCAL_ASFLAGS'] + group['LOCAL_ASFLAGS']
|
||||||
|
else:
|
||||||
|
src_group['LOCAL_ASFLAGS'] = group['LOCAL_ASFLAGS']
|
||||||
|
|
||||||
def DefineGroup(name, src, depend, **parameters):
|
def DefineGroup(name, src, depend, **parameters):
|
||||||
global Env
|
global Env
|
||||||
|
@ -550,6 +560,8 @@ def DefineGroup(name, src, depend, **parameters):
|
||||||
Env.AppendUnique(CPPDEFINES = group['CPPDEFINES'])
|
Env.AppendUnique(CPPDEFINES = group['CPPDEFINES'])
|
||||||
if group.has_key('LINKFLAGS'):
|
if group.has_key('LINKFLAGS'):
|
||||||
Env.AppendUnique(LINKFLAGS = group['LINKFLAGS'])
|
Env.AppendUnique(LINKFLAGS = group['LINKFLAGS'])
|
||||||
|
if group.has_key('ASFLAGS'):
|
||||||
|
Env.AppendUnique(ASFLAGS = group['ASFLAGS'])
|
||||||
|
|
||||||
# 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))):
|
||||||
|
@ -645,13 +657,14 @@ def DoBuilding(target, objects):
|
||||||
|
|
||||||
# handle local group
|
# handle local group
|
||||||
def local_group(group, objects):
|
def local_group(group, objects):
|
||||||
if group.has_key('LOCAL_CCFLAGS') or group.has_key('LOCAL_CPPPATH') or group.has_key('LOCAL_CPPDEFINES'):
|
if group.has_key('LOCAL_CCFLAGS') or group.has_key('LOCAL_CPPPATH') or group.has_key('LOCAL_CPPDEFINES') or group.has_key('LOCAL_ASFLAGS'):
|
||||||
CCFLAGS = Env.get('CCFLAGS', '') + group.get('LOCAL_CCFLAGS', '')
|
CCFLAGS = Env.get('CCFLAGS', '') + group.get('LOCAL_CCFLAGS', '')
|
||||||
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', '')
|
||||||
|
|
||||||
for source in group['src']:
|
for source in group['src']:
|
||||||
objects.append(Env.Object(source, CCFLAGS = CCFLAGS,
|
objects.append(Env.Object(source, CCFLAGS = CCFLAGS, ASFLAGS = ASFLAGS,
|
||||||
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES))
|
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES))
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue