2016-04-24 19:34:41 +08:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import rtconfig
|
|
|
|
|
2017-11-11 13:51:56 +08:00
|
|
|
if os.getenv('RTT_ROOT'):
|
|
|
|
RTT_ROOT = os.getenv('RTT_ROOT')
|
|
|
|
else:
|
2017-11-13 15:37:08 +08:00
|
|
|
RTT_ROOT = os.path.join('..', '..')
|
|
|
|
|
2016-04-24 19:34:41 +08:00
|
|
|
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
TARGET = 'rtthread-x1000.' + rtconfig.TARGET_EXT
|
|
|
|
|
|
|
|
env = Environment(tools = ['mingw'],
|
|
|
|
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
|
|
|
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
2017-11-11 13:51:56 +08:00
|
|
|
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
|
2016-04-24 19:34:41 +08:00
|
|
|
AR = rtconfig.AR, ARFLAGS = '-rc',
|
|
|
|
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
|
|
|
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
|
|
|
|
2017-11-11 13:51:56 +08:00
|
|
|
# add --start-group and --end-group for GNU GCC
|
|
|
|
env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS -Wl,--start-group $_LIBFLAGS -Wl,--end-group'
|
|
|
|
|
2016-04-24 19:34:41 +08:00
|
|
|
Export('RTT_ROOT')
|
|
|
|
Export('rtconfig')
|
|
|
|
|
|
|
|
# prepare building environment
|
2017-11-11 13:51:56 +08:00
|
|
|
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
2016-04-24 19:34:41 +08:00
|
|
|
|
2017-11-13 18:08:41 +08:00
|
|
|
if GetDepend('RT_USING_HARD_FLOAT'):
|
|
|
|
env['CCFLAGS'] = env['CCFLAGS'].replace('-msoft-float', '-mhard-float')
|
|
|
|
env['ASFLAGS'] = env['ASFLAGS'].replace('-msoft-float', '-mhard-float')
|
|
|
|
env['CXXFLAGS'] = env['CXXFLAGS'].replace('-msoft-float', '-mhard-float')
|
|
|
|
env['LINKFLAGS'] = env['LINKFLAGS'].replace('-msoft-float', '-mhard-float')
|
2017-11-13 16:00:52 +08:00
|
|
|
|
2016-04-24 19:34:41 +08:00
|
|
|
# make a building
|
|
|
|
DoBuilding(TARGET, objs)
|