Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6133 dpurdie 1
###############################################################################
2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
3
#
4
# File:         PLATFORM/GENERICS.cfg
5
#
6
# Contents:     GENERICS 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 GENERICS_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 'GENERICS' 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
    #
42
    #   Get the list of targets that have been tagged as GENERICS
43
    #   
44
    my @targets = PlatformConfig::getTargetsByTag('GENERIC');
45
 
46
    #
47
    #   Ignore this platform if there is no way that it can be built on the
48
    #   current machine.
49
    #
50
    unless ( @targets )
51
    {
52
        Verbose ("GENERICS will not build on this machine type: $::GBE_MACHTYPE");
53
        $pInfo->{NOT_AVAILABLE} = 1;
54
        return;
55
    }
56
 
57
    #
58
    #   Instantiate all targets
59
    #
60
    foreach my $target ( @targets )
61
    {
62
        GENERICS_generic(  dclone($pInfo), $target );
63
    }
64
 
65
    #
66
    #   All done
67
    #   Mark the original entry as a TEMPLATE so that it won't be added
68
    #   We have added cloned copies of it
69
    #
70
    $pInfo->{TEMPLATE} = 1;
71
}
72
 
73
#-------------------------------------------------------------------------------
74
# Function        : GENERICS_generic
75
#
76
# Description     : Take a clone of the buildinfo structure and specialise it
77
#                   for the required target
78
#
79
# Inputs          : $pInfo       - A clone of the buildinfo data
80
#                   $target      - Name of the target platform
81
#
82
# Returns         : Nothing
83
#                   The buildinfo MUST be added to the build system
84
#
85
sub GENERICS_generic
86
{
87
    my ($pInfo, $target) = @_;
88
 
89
    #
90
    #   Request that a simple BuildAlias be created for this platform
91
    #   Use the original name of the TARGET
92
    #
93
    $pInfo->{ALIAS} = $pInfo->{TARGET};
94
 
95
    #
96
    #   Alter the 'TARGET' name
97
    #   This is allowed (expected)
98
    #
99
    $pInfo->{TARGET} = uc($target);
100
 
101
    #
102
    #   Register this 'new' buildinfo entry with the build system
103
    #
104
    ::AddBuildPlatformEntry( $pInfo );
105
}
106
 
107
1;
108