-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
57 lines (48 loc) · 1.11 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
import os
from SCons.Script import DefaultEnvironment
from os.path import expanduser
home = expanduser("~")
build_cpu = 'mcs51'
board_f_cpu = '11059200L'
size_iram = '256'
size_heap = '64'
size_xram = '0'
size_code = '4096'
board_model = 'STC15W204S'
path = f'{home}/.platformio/packages/toolchain-sdcc/bin'
os.environ["PATH"] += os.pathsep + path
env = DefaultEnvironment(ENV = os.environ)
env.Append(
ASFLAGS=["-l", "-s"],
CFLAGS=["--std-sdcc11"],
CCFLAGS=[
"--opt-code-size", # optimize for size
"--peep-return", # peephole optimization for return instructions
"-m%s" % build_cpu,
"--Werror",
],
CPPDEFINES=["F_CPU=" + board_f_cpu, "HEAP_SIZE=" + size_heap],
LINKFLAGS=[
"-m%s" % build_cpu,
"--iram-size",
size_iram,
"--xram-size",
size_xram,
"--code-size",
size_code,
"--out-fmt-ihx",
],
)
pioenv = board_model
env['PIOENV'] = pioenv
SConscript (
'stages/SConscript',
exports = 'env'
)
# Build tests
SConscript (
'SConscriptTests_gcc',
)
SConscript (
'SConscriptTests_clang',
)