1 |
williamc |
1.2 |
#
|
2 |
|
|
# ToolMap.pm
|
3 |
|
|
#
|
4 |
|
|
# Originally Written by Christopher Williams
|
5 |
|
|
#
|
6 |
|
|
# Description
|
7 |
|
|
# -----------
|
8 |
|
|
# Object to describe build transformations
|
9 |
|
|
#
|
10 |
|
|
# Interface
|
11 |
|
|
# ---------
|
12 |
|
|
# new() : A new ToolMapper object
|
13 |
|
|
# name() : the name of the toolmap
|
14 |
|
|
# types() : Return the types
|
15 |
|
|
# cleardefaults() : clear the default set
|
16 |
williamc |
1.3 |
# defaulttypes(@types) : return/set list of types to make the default
|
17 |
williamc |
1.2 |
# rulesfile() : return list of names of makefiles to include to describe
|
18 |
|
|
# suitable make rules
|
19 |
|
|
|
20 |
|
|
package BuildSystem::ToolMap;
|
21 |
|
|
require 5.004;
|
22 |
|
|
|
23 |
|
|
sub new {
|
24 |
|
|
my $class=shift;
|
25 |
|
|
$self={};
|
26 |
|
|
bless $self, $class;
|
27 |
|
|
return $self;
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
sub name {
|
31 |
|
|
my $self=shift;
|
32 |
|
|
if ( @_ ) {
|
33 |
|
|
$self->{name}=shift;
|
34 |
|
|
}
|
35 |
|
|
return $self->{name};
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
sub types {
|
39 |
|
|
my $self=shift;
|
40 |
|
|
if ( @_ ) {
|
41 |
|
|
push @{$self->{types}}, @_;
|
42 |
|
|
}
|
43 |
williamc |
1.3 |
return @{$self->{types}};
|
44 |
williamc |
1.2 |
}
|
45 |
|
|
|
46 |
|
|
sub defaulttypes {
|
47 |
|
|
my $self=shift;
|
48 |
|
|
if ( @_ ) {
|
49 |
williamc |
1.3 |
undef $self->{defaulttypes};
|
50 |
williamc |
1.2 |
push @{$self->{defaulttypes}}, @_;
|
51 |
|
|
}
|
52 |
williamc |
1.3 |
return @{$self->{defaulttypes}};
|
53 |
williamc |
1.2 |
}
|
54 |
|
|
|
55 |
|
|
sub rulesfile {
|
56 |
|
|
my $self=shift;
|
57 |
|
|
if ( @_ ) {
|
58 |
|
|
push @{$self->{rulesfile}}, @_;
|
59 |
|
|
}
|
60 |
williamc |
1.3 |
return @{$self->{rulesfile}};
|
61 |
williamc |
1.2 |
}
|
62 |
|
|
|
63 |
|
|
sub cleardefaults {
|
64 |
|
|
my $self;
|
65 |
|
|
$self->{defaulttypes}=();
|
66 |
|
|
}
|
67 |
|
|
|
68 |
|
|
# -- Support routines
|
69 |
|
|
sub init {
|
70 |
|
|
}
|