SConstruct 783 字节
Newer Older
M
Ming, Bai 已提交
1 2 3 4 5 6 7
import os
import sys
import rtconfig

if os.getenv('RTT_ROOT'):
    RTT_ROOT = os.getenv('RTT_ROOT')
else:
B
BernardXiong 已提交
8
    RTT_ROOT = os.path.join(Dir('#').get_abspath(), '..', '..', '..')
M
Ming, Bai 已提交
9 10 11 12

sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
from building import *

N
nongxiaoming 已提交
13
TARGET = 'rtthread-lpc40xx.' + rtconfig.TARGET_EXT
M
Ming, Bai 已提交
14

E
Ernest 已提交
15
DefaultEnvironment(tools=[])
M
Ming, Bai 已提交
16
env = Environment(tools = ['mingw'],
N
nongxiaoming 已提交
17
    AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
G
guo 已提交
18
    CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
N
nongxiaoming 已提交
19 20
    AR = rtconfig.AR, ARFLAGS = '-rc',
    LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
M
Ming, Bai 已提交
21 22 23 24 25 26 27 28
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

Export('RTT_ROOT')
Export('rtconfig')

# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

N
nongxiaoming 已提交
29
# do building 
wuyangyong's avatar
wuyangyong 已提交
30
DoBuilding(TARGET, objs)