1 |
+ |
# |
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 |
+ |
# defaulttypes() : return list of types to make the default |
17 |
+ |
# 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 |
+ |
return $self->{types}; |
44 |
+ |
} |
45 |
+ |
|
46 |
+ |
sub defaulttypes { |
47 |
+ |
my $self=shift; |
48 |
+ |
if ( @_ ) { |
49 |
+ |
push @{$self->{defaulttypes}}, @_; |
50 |
+ |
} |
51 |
+ |
return $self->{defaulttypes}; |
52 |
+ |
} |
53 |
+ |
|
54 |
+ |
sub rulesfile { |
55 |
+ |
my $self=shift; |
56 |
+ |
if ( @_ ) { |
57 |
+ |
push @{$self->{rulesfile}}, @_; |
58 |
+ |
} |
59 |
+ |
return $self->{rulesfile}; |
60 |
+ |
} |
61 |
+ |
|
62 |
+ |
sub cleardefaults { |
63 |
+ |
my $self; |
64 |
+ |
$self->{defaulttypes}=(); |
65 |
+ |
} |
66 |
+ |
|
67 |
+ |
# -- Support routines |
68 |
+ |
sub init { |
69 |
+ |
} |