forked from solson/oos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
48 lines (37 loc) · 1.26 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
# vim: syntax=python
# os is needed to get the environment
import os
ooc = ARGUMENTS.get('compiler', 'ooc')
# set up the default environment
env = Environment(
OBJPREFIX='',
OBJSUFFIX='.o',
SHOBJPREFIX='',
SHOBJSUFFIX='.sho',
PROGPREFIX='',
PROGSUFFIX='.exe',
LIBPREFIX='',
LIBSUFFIX='.lib',
SHLIBPREFIX='',
SHLIBSUFFIX='.shlib',
AS='nasm',
ASFLAGS=['-felf'],
LINK='ld',
LINKFLAGS=['-melf_i386', '-nostdlib'],
OOC=ooc,
OOCFLAGS=['-c', '-v', '-gcc', '-driver=sequence', '-nomain', '-gc=off', '+-m32', '+-nostdinc', '+-ffreestanding', '+-fno-stack-protector', '-IInclude', '-sourcepath=.', '-noclean', '-nolines'],
ENV = os.environ, # pass outside env to build so ooc is in PATH and OOC_DIST exists
)
# set our custom ooc stdlib location
env.Append(ENV={'OOC_SDK' : 'Src/OocLib', 'ROCK_SDK' : 'Src/OocLib'})
# set up the ooc builder
ooc_builder = Builder(action = '$OOC $OOCFLAGS $SOURCE -outlib=$TARGET')
env.Append(BUILDERS = {'Ooc' : ooc_builder})
# default to debug mode. `scons debug=0` to build without debugging symbols
debug = ARGUMENTS.get('debug', 1)
if int(debug):
env.Append(ASFLAGS=['-g'], LINKFLAGS=['-g'], OOCFLAGS=['-g'])
# run the child SConscripts
Export('env')
oos = SConscript('Src/SConscript')
SConscript('Iso/SConscript', 'oos')