xref: /nrf52832-nimble/SConstruct (revision 15d4a29a79715afc28dd96c5545e4422984dccf8)
1import os
2import sys
3import rtconfig
4
5if os.getenv('RTT_ROOT'):
6    RTT_ROOT = os.getenv('RTT_ROOT')
7else:
8    RTT_ROOT = os.path.normpath(os.getcwd() + '/rt-thread')
9
10sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
11from building import *
12
13TARGET = 'rtthread_nrf52832.' + rtconfig.TARGET_EXT
14
15env = Environment(tools = ['mingw'],
16	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
17	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
18	AR = rtconfig.AR, ARFLAGS = '-rc',
19	LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
20env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
21
22if rtconfig.PLATFORM == 'iar':
23	env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
24	env.Replace(ARFLAGS = [''])
25	env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map'])
26
27Export('RTT_ROOT')
28Export('rtconfig')
29
30# prepare building environment
31objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
32
33# make a building
34DoBuilding(TARGET, objs)
35