Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
###############################################################################
6177 dpurdie 2
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
227 dpurdie 3
#
4
# File:         PLATFORM/LMOS_DEVLINUX.cfg
5
#
6
# Contents:     LMOS_DEVLINUX Build support
7
#
8
#               This package is used during the processing of the build.pl file
9
#               Values provided by this package are used to extend the Platform
10
#               information as platforms are being created. This provides a
11
#               powerful set of mechanism to extend the entire JATS toolset
12
#
13
###############################################################################
14
 
15
use strict;
16
use warnings;
17
 
18
package LMOS_DEVLINUX_Build;
19
use JatsError;
20
use Storable qw(dclone);
21
 
22
#-------------------------------------------------------------------------------
23
# Function        : new_platform
24
#
25
# Description     : Called when a new platform is being created
26
#                   The function can extend the build information
27
#
28
#                   The 'LINUX' platform will be converted into a 'suitable'
29
#                   platform for the current machine.
30
#
31
# Inputs          : $pInfo          - Reference to the platform build info hash
32
#
33
# Returns         : Nothing yet
34
#
35
 
36
sub new_platform
37
{
38
    my $class = shift;              # Not really a class, but its called like a class
39
    my $pInfo  = shift;
40
 
41
    #
6133 dpurdie 42
    #   Get the list of targets that have been tagged as LMOS and DEVLINUX
43
    #
44
    my @targets;   
45
    my @lmosTargets = PlatformConfig::getTargetsByTag('LMOS');
46
    my @devLinuxTargets = PlatformConfig::getTargetsByTag('DEVLINUX');
47
 
48
    my %lmosTargetsMap = map {$_ => 1} @lmosTargets;
49
    foreach ( @devLinuxTargets )
50
    {
51
        if (exists $lmosTargetsMap{$_} )
52
        {
53
            push @targets, $_;
54
        }
55
    }
56
 
57
    #
227 dpurdie 58
    #   Ignore this platform if there is no way that it can be built on the
59
    #   current machine.
60
    #
6133 dpurdie 61
    unless ( @targets )
227 dpurdie 62
    {
63
        Verbose ("LMOS_DEVLINUX will not build on this machine type: $::GBE_MACHTYPE");
64
        $pInfo->{NOT_AVAILABLE} = 1;
65
        return;
66
    }
67
 
68
    #
69
    #   Instantiate all targets
70
    #
6133 dpurdie 71
    foreach my $target ( @targets )
227 dpurdie 72
    {
6133 dpurdie 73
        LMOS_DEVLINUX_generic(  dclone($pInfo), 'LMOS_' . $target );
227 dpurdie 74
    }
75
 
76
    #
77
    #   All done
78
    #   Mark the original entry as a TEMPLATE so that it won't be added
79
    #   We have added cloned copies of it
80
    #
81
    $pInfo->{TEMPLATE} = 1;
82
}
83
 
84
#-------------------------------------------------------------------------------
85
# Function        : LMOS_DEVLINUX_generic
86
#
87
# Description     : Take a clone of the buildinfo structure and specialise it
88
#                   for the required target
89
#
90
# Inputs          : $pInfo       - A clone of the buildinfo data
91
#                   $target      - Name of the target platform
92
#
93
# Returns         : Nothing
94
#                   The buildinfo MUST be added to the build system
95
#
96
sub LMOS_DEVLINUX_generic
97
{
98
    my ($pInfo, $target) = @_;
99
    Debug("LMOS_DEVLINUX_generic: $target");
100
 
101
    #
102
    #   Request that a simple BuildAlias be created for this platform
103
    #   Use the original name of the TARGET
104
    #
105
    $pInfo->{ALIAS} = $pInfo->{TARGET};
106
 
107
    #
108
    #   Alter the 'TARGET' name
109
    #   This is allowed (expected)
110
    #
111
    $pInfo->{TARGET} = uc($target);
112
 
113
    #
114
    #   Register this 'new' buildinfo entry with the build system
115
    #
116
    ::AddBuildPlatformEntry( $pInfo );
117
}
118
 
119
1;
120