[ec24a37] | 1 | # |
---|
| 2 | # RTEMS Linker build script. |
---|
| 3 | # |
---|
| 4 | import sys |
---|
| 5 | |
---|
| 6 | version_major = 1 |
---|
| 7 | version_minor = 0 |
---|
| 8 | version_revision = 0 |
---|
| 9 | |
---|
| 10 | def options(opt): |
---|
| 11 | opt.load("g++") |
---|
| 12 | opt.load("gcc") |
---|
| 13 | |
---|
| 14 | def configure(conf): |
---|
[993aa67] | 15 | conf.load("g++") |
---|
| 16 | conf.load("gcc") |
---|
[ec24a37] | 17 | |
---|
[ead8da1] | 18 | conf.env.C_OPTS = conf.options.c_opts.split(',') |
---|
[ec24a37] | 19 | conf.env.RTEMS_VERSION = conf.options.rtems_version |
---|
[87e0e76] | 20 | conf.write_config_header('config.h') |
---|
[ec24a37] | 21 | |
---|
| 22 | def build(bld): |
---|
[be8e188] | 23 | # |
---|
| 24 | # Build the doxygen documentation. |
---|
| 25 | # |
---|
| 26 | if bld.cmd == 'doxy': |
---|
| 27 | bld(features = 'doxygen', |
---|
[e78e2b0] | 28 | doxyfile = 'rtl-host.conf') |
---|
[be8e188] | 29 | return |
---|
| 30 | |
---|
[ec24a37] | 31 | # |
---|
[87e0e76] | 32 | # The local configuration. |
---|
[ec24a37] | 33 | # |
---|
[87e0e76] | 34 | conf = {} |
---|
[ec24a37] | 35 | |
---|
| 36 | # |
---|
| 37 | # Build flags. |
---|
| 38 | # |
---|
[87e0e76] | 39 | rtemstoolkit = '../rtemstoolkit' |
---|
| 40 | conf['includes'] = [rtemstoolkit, |
---|
| 41 | rtemstoolkit + '/elftoolchain/libelf', |
---|
| 42 | rtemstoolkit + '/elftoolchain/common', |
---|
| 43 | rtemstoolkit + '/libiberty'] |
---|
| 44 | conf['warningflags'] = ['-Wall', '-Wextra', '-pedantic'] |
---|
| 45 | conf['optflags'] = bld.env.C_OPTS |
---|
| 46 | conf['cflags'] = ['-pipe', '-g'] + conf['optflags'] |
---|
| 47 | conf['cxxflags'] = ['-pipe', '-g'] + conf['optflags'] |
---|
| 48 | conf['linkflags'] = ['-g'] |
---|
[ea29902] | 49 | |
---|
| 50 | # |
---|
| 51 | # The list of modules. |
---|
| 52 | # |
---|
[435d879] | 53 | modules = ['rld', 'elf', 'iberty'] |
---|
[ea29902] | 54 | |
---|
[ec24a37] | 55 | # |
---|
| 56 | # Build the linker. |
---|
| 57 | # |
---|
| 58 | bld.program(target = 'rtems-ld', |
---|
[31bf375] | 59 | source = ['rtems-ld.cpp'], |
---|
[53ed116] | 60 | defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION], |
---|
[87e0e76] | 61 | includes = ['.'] + conf['includes'], |
---|
| 62 | cflags = conf['cflags'] + conf['warningflags'], |
---|
| 63 | cxxflags = conf['cxxflags'] + conf['warningflags'], |
---|
| 64 | linkflags = conf['linkflags'], |
---|
[53ed116] | 65 | use = modules) |
---|
| 66 | |
---|
| 67 | # |
---|
| 68 | # Build the ra linker. |
---|
| 69 | # |
---|
| 70 | bld.program(target = 'rtems-ra', |
---|
[31bf375] | 71 | source = ['rtems-ra.cpp'], |
---|
[ea29902] | 72 | defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION], |
---|
[87e0e76] | 73 | includes = ['.'] + conf['includes'], |
---|
| 74 | cflags = conf['cflags'] + conf['warningflags'], |
---|
| 75 | cxxflags = conf['cxxflags'] + conf['warningflags'], |
---|
| 76 | linkflags = conf['linkflags'], |
---|
[ea29902] | 77 | use = modules) |
---|
| 78 | |
---|
| 79 | # |
---|
| 80 | # Build the trace linker. |
---|
| 81 | # |
---|
| 82 | bld.program(target = 'rtems-tld', |
---|
| 83 | source = ['rtems-tld.cpp'], |
---|
[977c3de] | 84 | defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION], |
---|
[87e0e76] | 85 | includes = ['.'] + conf['includes'], |
---|
| 86 | cflags = conf['cflags'] + conf['warningflags'], |
---|
| 87 | cxxflags = conf['cxxflags'] + conf['warningflags'], |
---|
| 88 | linkflags = conf['linkflags'], |
---|
[977c3de] | 89 | use = modules) |
---|
[6506aa1] | 90 | bld.install_files('${PREFIX}/share/rtems/trace-linker', |
---|
[5025439] | 91 | ['rtems.ini', |
---|
| 92 | 'rtems-api.ini', |
---|
| 93 | 'rtems-score.ini', |
---|
| 94 | 'rtems-score-object.ini', |
---|
| 95 | 'rtems-score-thread.ini', |
---|
| 96 | 'rtems-score-heap.ini', |
---|
| 97 | 'rtems-score-coremutex.ini', |
---|
| 98 | 'rtld-base.ini', |
---|
| 99 | 'rtld-print.ini']) |
---|
[977c3de] | 100 | |
---|
| 101 | # |
---|
| 102 | # Build the symbols. |
---|
| 103 | # |
---|
| 104 | bld.program(target = 'rtems-syms', |
---|
[ea29902] | 105 | source = ['rtems-syms.cpp'], |
---|
[ec24a37] | 106 | defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION], |
---|
[87e0e76] | 107 | includes = ['.'] + conf['includes'], |
---|
| 108 | cflags = conf['cflags'] + conf['warningflags'], |
---|
| 109 | cxxflags = conf['cxxflags'] + conf['warningflags'], |
---|
| 110 | linkflags = conf['linkflags'], |
---|
[8bb0d53] | 111 | use = modules) |
---|
| 112 | |
---|
| 113 | # |
---|
| 114 | # Build the RAP utility. |
---|
| 115 | # |
---|
| 116 | bld.program(target = 'rtems-rap', |
---|
[ea29902] | 117 | source = ['rtems-rapper.cpp'], |
---|
[8bb0d53] | 118 | defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION], |
---|
[87e0e76] | 119 | includes = ['.'] + conf['includes'], |
---|
| 120 | cflags = conf['cflags'] + conf['warningflags'], |
---|
| 121 | cxxflags = conf['cxxflags'] + conf['warningflags'], |
---|
| 122 | linkflags = conf['linkflags'], |
---|
[ec24a37] | 123 | use = modules) |
---|
| 124 | |
---|
[1ec9633] | 125 | def tags(ctx): |
---|
| 126 | ctx.exec_command('etags $(find . -name \*.[sSch])', shell = True) |
---|