summaryrefslogtreecommitdiffstats
path: root/filesystem/fat_ramdisk/wscript
blob: 185652aaf7d15b8aba744cca9f14601e77fa11be (plain) (blame)
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
# Copyright 2013 Gedare Bloom (gedare@rtems.org)
#
# This file's license is 2-clause BSD as in this distribution's LICENSE.2 file.
#

# Waf build script for RTEMS fat_ramdisk

import rtems_waf.rtems as rtems
import rtems_waf.rootfs as rootfs

version = "1.0.0"

def build(bld):
    rtems.build(bld)

    arch_bsp = bld.get_env()['RTEMS_ARCH_BSP']
    arch = bld.get_env()['RTEMS_ARCH']
    bsp = bld.get_env()['RTEMS_BSP']

    #
    # The include paths and defines.
    #
    bld.includes = ['.']
    bld.defines = ['PACKAGE_VERSION="' + version + '"']

    #
    # Package the root file system as a C file.
    #
    if rtems.check_env(bld, 'RTEMS_BIN2C', 'RTEMS_TLD'):
        rootfs.build_from_src_root(bld,
                                   name = 'fs-root',
                                   root = 'rootfs')

        bld.path.find_or_declare('fs-root-tar.h')

        bld(features = 'c cprogram',
            target = 'fat_ramdisk.exe',
            includes = bld.includes,
            defines = bld.defines,
            source = ['init.c', 'fs-root-tar.c'])

        bld(features = 'c rtrace',
            target = 'fat_ramdisk.texe',
            includes = bld.includes,
            defines = bld.defines,
            source = ['init.c', 'fs-root-tar.c'],
            rtrace_cfg = '../../filesystem/fat_ramdisk/fat_ramdisk.ini')