-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSConstruct
200 lines (168 loc) · 7.47 KB
/
SConstruct
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------- #
# Copyright (C) 2011 by Christoph Thelen #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
# ----------------------------------------------------------------------- #
import os.path
# ---------------------------------------------------------------------------
#
# Set up the Muhkuh Build System.
#
SConscript('mbs/SConscript')
Import('atEnv')
# Create a build environment for the ARM9 based netX chips.
env_arm9 = atEnv.DEFAULT.CreateEnvironment(['gcc-arm-none-eabi-4.7', 'asciidoc'])
env_arm9.CreateCompilerEnv('NETX500', ['arch=armv5te'])
env_arm9.CreateCompilerEnv('NETX56', ['arch=armv5te'])
env_arm9.CreateCompilerEnv('NETX50', ['arch=armv5te'])
env_arm9.CreateCompilerEnv('NETX10', ['arch=armv5te'])
env_arm9.CreateCompilerEnv('NETX500', ['arch=armv5te', 'thumb'], name='NETX500_THUMB')
env_arm9.CreateCompilerEnv('NETX56', ['arch=armv5te', 'thumb'], name='NETX56_THUMB')
env_arm9.CreateCompilerEnv('NETX50', ['arch=armv5te', 'thumb'], name='NETX50_THUMB')
env_arm9.CreateCompilerEnv('NETX10', ['arch=armv5te', 'thumb'], name='NETX10_THUMB')
# Create a build environment for the Cortex-R7 and Cortex-A9 based netX chips.
env_cortexR7 = atEnv.DEFAULT.CreateEnvironment(['gcc-arm-none-eabi-4.9', 'asciidoc'])
env_cortexR7.CreateCompilerEnv('NETX4000', ['arch=armv7', 'thumb'], ['arch=armv7-r', 'thumb'])
# Create a build environment for the Cortex-M4 based netX chips.
env_cortexM4 = atEnv.DEFAULT.CreateEnvironment(['gcc-arm-none-eabi-4.9', 'asciidoc'])
env_cortexM4.CreateCompilerEnv('NETX90_MPW', ['arch=armv7', 'thumb'], ['arch=armv7e-m', 'thumb'])
env_cortexM4.CreateCompilerEnv('NETX90', ['arch=armv7', 'thumb'], ['arch=armv7e-m', 'thumb'])
# Create a build environment for the RISCV based netIOL.
env_riscv = atEnv.DEFAULT.CreateEnvironment(['gcc-riscv-none-embed-7.2', 'asciidoc'])
env_riscv.CreateCompilerEnv('NETIOL', ['arch=rv32im', 'abi=ilp32'], ['arch=rv32imc', 'abi=ilp32'])
# Build the platform libraries.
SConscript('platform/SConscript')
#----------------------------------------------------------------------------
#
# Build the machine interface library.
#
SConscript('plugins/romloader/machine_interface/netx/SConscript')
SConscript('plugins/romloader/machine_interface/start_mi/SConscript')
#----------------------------------------------------------------------------
#
# Build the test code.
#
SConscript('plugins/romloader/_test/testcode/SConscript')
#----------------------------------------------------------------------------
#
# Build the plugin update code.
#
SConscript('plugins/romloader/uart/netx/SConscript')
SConscript('plugins/romloader/usb/netx/SConscript')
#----------------------------------------------------------------------------
#
# Build the DPM monitor code.
#
#SConscript('plugins/romloader/dpm/netx/SConscript')
#----------------------------------------------------------------------------
#
# Build the DCC output code.
#
SConscript('plugins/romloader/jtag/netx/SConscript')
#----------------------------------------------------------------------------
#
# Build an archive with all firmware parts.
#
Import(
'USBMON_NETX500',
'USBMON_NETX56',
'USBMON_NETX10',
'UARTMON_NETX500',
'UARTMON_NETX500_SYM',
'UARTMON_NETX56',
'UARTMON_NETX56_SYM',
'UARTMON_NETX50',
'UARTMON_NETX50_SYM',
'UARTMON_NETX50_BOOTSTRAP',
'UARTMON_NETX50_BOOTSTRAP_SYM',
'UARTMON_NETX10',
'UARTMON_NETX10_SYM',
'UARTMON_BOOTSTRAP_NETX10',
'UARTMON_BOOTSTRAP_NETX10_SYM',
'UARTMON_NETX4000',
'UARTMON_NETX4000_SYM',
'DCC_NETX500',
'DCC_NETX10_50_56',
'DCC_NETX4000',
'DCC_NETX90',
'HBOOT_START_MI_NETX90',
'HBOOT_START_MI_NETX90_CLEAR_WORKAREA'
)
atFirmware = [
USBMON_NETX500,
USBMON_NETX56,
USBMON_NETX10,
UARTMON_NETX500,
UARTMON_NETX500_SYM,
UARTMON_NETX56,
UARTMON_NETX56_SYM,
UARTMON_NETX50,
UARTMON_NETX50_SYM,
UARTMON_NETX50_BOOTSTRAP,
UARTMON_NETX50_BOOTSTRAP_SYM,
UARTMON_NETX10,
UARTMON_NETX10_SYM,
UARTMON_BOOTSTRAP_NETX10,
UARTMON_BOOTSTRAP_NETX10_SYM,
UARTMON_NETX4000,
UARTMON_NETX4000_SYM,
DCC_NETX500,
DCC_NETX10_50_56,
DCC_NETX4000,
DCC_NETX90,
HBOOT_START_MI_NETX90,
HBOOT_START_MI_NETX90_CLEAR_WORKAREA
]
atEnv.DEFAULT.Tar('targets/firmware.tar.gz', atFirmware, TARFLAGS = '-c -z')
#----------------------------------------------------------------------------
#
# Package test_romloader.lua and the montest binaries as a jonchki component.
#
Import('bin_netx500', 'bin_netx50', 'bin_netx10', 'bin_netx56', 'bin_netx4000', 'bin_netx90_mpw', 'bin_netx90', 'bin_netiol')
tArcList = atEnv.DEFAULT.ArchiveList('zip')
tArcList.AddFiles('./',
'plugins/romloader/_test/test_romloader.lua',
'plugins/romloader/_test/test_romloader_lua54.lua')
tArcList.AddFiles('lua/',
'plugins/romloader/_test/bit.lua')
tArcList.AddFiles('./', 'jonchki/org.muhkuh.lua.romloader/install.lua')
tArcList.AddFiles('netx/',
bin_netx500,
bin_netx50,
bin_netx10,
bin_netx56,
bin_netx4000,
bin_netx90_mpw,
bin_netx90,
bin_netiol
)
strGroup = 'org.muhkuh.lua'
strModule = 'romloader'
aGroup = strGroup.split('.')
# = ['org', 'muhkuh', 'lua']
strModulePath = 'targets/jonchki/repository/%s/%s/%s' % ('/'.join(aGroup), strModule, PROJECT_VERSION)
# = 'targets/jonchki/repository/org/muhkuh/lua/romloader/2.5.1'
strArtifact = 'romloader-montest'
strBasePath = os.path.join(strModulePath, '%s-%s' % (strArtifact, PROJECT_VERSION))
# = 'targets/jonchki/repository/org/muhkuh/lua/romloader/2.5.1/romloader-montest-2.5.1'
tArtifact = atEnv.DEFAULT.Archive('%s.zip' % strBasePath, None, ARCHIVE_CONTENTS = tArcList)
tArtifactHash = atEnv.DEFAULT.Hash('%s.hash' % tArtifact[0].get_path(), tArtifact[0].get_path(), HASH_ALGORITHM='md5,sha1,sha224,sha256,sha384,sha512', HASH_TEMPLATE='${ID_UC}:${HASH}\n')
tConfiguration = atEnv.DEFAULT.Version('%s.xml' % strBasePath, 'jonchki/%s.%s/%s.xml' % (strGroup, strModule, strArtifact))
# 'targets/jonchki/repository/org/muhkuh/lua/romloader/2.5.1/romloader-montest-2.5.1.xml',
# 'jonchki/org.muhkuh.lua.romloader/romloader-montest.xml'
tConfigurationHash = atEnv.DEFAULT.Hash('%s.hash' % tConfiguration[0].get_path(), tConfiguration[0].get_path(), HASH_ALGORITHM='md5,sha1,sha224,sha256,sha384,sha512', HASH_TEMPLATE='${ID_UC}:${HASH}\n')