ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/ToolMapper.pm
Revision: 1.1.2.1
Committed: Fri May 26 09:20:32 2000 UTC (24 years, 11 months ago) by williamc
Content type: text/plain
Branch: V0_9branch
CVS Tags: BuildSystemProto1, V0_18_0, V0_18_0model, V0_17_1, V0_18_0alpha, V0_17_0, V0_16_4, V0_16_3, V0_16_2, V0_16_1, V0_16_0, V0_15_1, V0_15_0, V0_15_0beta, V0_14_0, V0_12_12_4, V0_12_12_3, V0_12_12_2, V0_12_12_1, V0_12_12_0, PlayGround_0, V0_12_12, V0_12_11, V0_12_9b, V0_12_10, V0_12_9
Branch point for: V0_17branch, V0_16branch, V0_15branch, HPWbranch
Changes since 1.1: +99 -0 lines
Log Message:
first funtion mapping to support build tag

File Contents

# User Rev Content
1 williamc 1.1.2.1 #
2     # ToolMapper.pm
3     #
4     # Originally Written by Christopher Williams
5     #
6     # Description
7     # -----------
8     # A toolmap container
9     #
10     # Interface
11     # ---------
12     # new() : A new ToolMapper object
13     # addclass(ToolMap) : add a new class
14     # types(class) : Return the types for a given Class
15     # exists(class) : Return 1,0 if class exist or not
16     # defaulttypes(Class) : return list of types to make the default
17     # rulesfile(class) : return the name of a makefile to include to describe
18     # suitable make rules
19    
20     package BuildSystem::ToolMapper;
21     use BuildSystem::ToolMap;
22     require 5.004;
23    
24     sub new {
25     my $class=shift;
26     $self={};
27     bless $self, $class;
28     $self->_init();
29     return $self;
30     }
31    
32     sub addclass {
33     my $self=shift;
34     my $map=shift;
35    
36     $self->{classes}{$map->name()}=$map;
37     }
38    
39     sub types {
40     my $self=shift;
41     my $class=shift;
42    
43     my @rv=();
44     if ( $self->exists($class) ) {
45     @rv=$self->{classes}{$class}->types;
46     }
47     return @rv;
48     }
49    
50     sub exists {
51     my $self=shift;
52     my $class=shift;
53    
54     return ( exists $self->{classes}{$class} );
55     }
56    
57     sub defaulttypes {
58     my $self=shift;
59     my $class=shift;
60    
61     my @rv=();
62     if ( $self->exists($class) ) {
63     @rv=$self->{classes}{$class}->defaulttypes;
64     }
65     return @rv;
66     }
67    
68     sub rulesfile {
69     my $self=shift;
70     my $class=shift;
71     my @rv=();
72     if ( $self->exists($class) ) {
73     @rv=$self->{classes}{$class}->rulesfile;
74     }
75     return @rv;
76     }
77    
78     # -- Support routines
79     sub _init {
80     my $self=shift;
81    
82     # --- init library Toolmap
83     my $lib=BuildSystem::ToolMap->new();
84     $lib->name("lib");
85     $lib->types(qw(shared debug_shared archive debug_archive
86     insure_archive insure_shared));
87     $lib->defaulttypes("debug_archive");
88     $lib->rulesfile("\$(TOOL_HOME)/BuildSystem/library.mk");
89    
90     # --- init binary Toolmap
91     my $bin=BuildSystem::ToolMap->new();
92     $bin->name("bin");
93     $bin->types(qw(debug debug_local opt insure));
94     $bin->defaulttypes("debug_archive");
95     $bin->rulesfile("\$(TOOL_HOME)/BuildSystem/binary.mk");
96    
97     $self->addclass($lib);
98     $self->addclass($bin);
99     }