-
Notifications
You must be signed in to change notification settings - Fork 10
/
wscript
64 lines (55 loc) · 1.88 KB
/
wscript
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
#!/usr/bin/env python
# Copyright 2013 Chris Johns ([email protected])
# Copyright 2013 Chirayu Desai ([email protected])
#
# This file's license is 2-clause BSD as in this distribution's LICENSE.2 file.
#
# Waf build script for Rtems Kernel Image
#
# To configure, build and run do:
#
# $ waf configure --rtems=/Users/chris/Development/rtems/build/4.11 \
# --rtems-tools=/Users/chris/Development/rtems/4.11 \
# --rtems-bsps=sparc/sis
# $ waf
#
# Currently supported bsps are sparc/sis and arm/raspberrypi
#
from os import listdir
import sys
try:
import rtems_waf.rtems as rtems
except:
print 'error: no rtems_waf git submodule; see README.waf'
sys.exit(1)
def init(ctx):
rtems.init(ctx)
def options(opt):
rtems.options(opt)
def configure(conf):
rtems.configure(conf)
def build(bld):
rtems.build(bld)
objcopycmd = ' '.join(bld.get_env()['OBJCOPY'])
ldcmd = ' '.join(bld.get_env()['LD'])
bld.env.CFLAGS += ['-O0','-g']
bld(rule='tar -C ' + bld.path.find_dir('rootfs').abspath() + \
' -cf tarfile ' + ' '.join([str(item) for item in \
listdir(bld.path.find_dir('rootfs').abspath())]) + ' ;' + \
ldcmd + ' -r --noinhibit-exec -o tarfile.o -b binary tarfile ',
target='tarfile.o',
name='tarfile.o')
bld(features = 'c cprogram',
target = 'rki.elf',
source = ['init.c', 'rtems_net.c', 'rtems_net_svc.c', \
'local_shell_cmds.c', 'filesys.c', 'ramdisk.c', \
'nvramdisk.c', 'task_cmd.c', 'hello_cmd.c', \
'dhrystone_cmd.c', 'whetstone_cmd.c', 'benchmarks.c', \
'tarfile.o'],
includes = 'include',
lib = 'm',
name = 'rki.elf')
bld(rule=objcopycmd + ' -O binary --strip-all rki.elf ${TGT}',
source = 'rki.elf',
target='rki.bin',
name='rki.bin')