summaryrefslogtreecommitdiff
path: root/bsp/simulator/testdll/SConstruct
blob: 690df89ce81f1aefc2acb6af5400fd91c278238e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import os
import sys
import SCons.cpp
import rtconfig

if os.getenv('RTT_ROOT'):
    RTT_ROOT = os.getenv('RTT_ROOT')
else:
    RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')

if os.getenv('RTT_RTGUI'):
    RTT_RTGUI = os.getenv('RTT_RTGUI')
else:
    # set the rtgui root directory by hand
    # empty string means use the RTGUI in svn
    RTT_RTGUI = os.path.normpath(r'F:\Project\git\rt-gui\components\rtgui')
    # RTT_RTGUI =''

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

Export('RTT_ROOT')

# add target option
AddOption('--app',
  dest='app',
  nargs=1, type='string',
  action='store',
  metavar='DIR',
  help='installation prefix')

# add target option
AddOption('--type',
  dest='type',
  nargs=1, type='string',
  action='store',
  metavar='DIR',
  help='installation prefix')

app = GetOption('app')
env = Environment(TARGET_ARCH='x86')
CPPPATH = [
	RTT_ROOT + '/include',
	RTT_ROOT + '/bsp/' + rtconfig.BSP,
	RTT_ROOT + '/components/finsh',
	RTT_ROOT + '/components/libdl',
	RTT_ROOT + '/components/external/ftk/ftk/src/os/rt-thread',
	RTT_ROOT + '/components/external/ftk/ftk/src/demos',	
	RTT_ROOT + '/components/external/ftk/ftk/apps/common',
	RTT_ROOT + '/components/external/ftk/ftk/src',
	RTT_ROOT + '/components/dfs', 
	RTT_ROOT + '/components/dfs/include',
	RTT_ROOT + '/components/libc/newlib',
	RTT_ROOT + '/components/external/cairo/cairo-1.10.2/src', 
	RTT_ROOT + '/components/external/cairo/'
]
if RTT_RTGUI:
	RTGUI_ROOT = RTT_RTGUI
else:
	RTGUI_ROOT = RTT_ROOT + '/components/rtgui'
RTGUI_PATH = [
	RTGUI_ROOT + '/include',
	RTGUI_ROOT + '/common',
	RTGUI_ROOT + '/server',
	RTGUI_ROOT + '/widgets',
]
CPPPATH += RTGUI_PATH

env.Append(CCFLAGS=rtconfig.CFLAGS)
env.Append(LINKFLAGS=rtconfig.LFLAGS)
env.Append(CPPPATH=CPPPATH)
env.Append(LIBS='rtthread', LIBPATH='../')
env.Append(CPPDEFINES=['RTT_IN_MODULE'])
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

PrepareModuleBuilding(env, RTT_ROOT)

#dir = app + '/build/' + rtconfig.BSP
dir = app + '/build/'
objs = SConscript(app + '/Sconscript', variant_dir=dir, duplicate=0)
TARGET = dir + '/' + app + '.' + rtconfig.TARGET_EXT

# build program 
#env.Program(TARGET, objs)
env.SharedLibrary(TARGET, objs)