Subversion Repositories DevTools

Rev

Rev 227 | Rev 289 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 227 Rev 261
Line -... Line 1...
-
 
1
########################################################################
1
# -*- mode: perl; indent-width: 4; show-tabs: yes; -*-
2
# Copyright (C) 2008 ERG Limited, All rights reserved
2
#
3
#
3
# Module name   : COMMON
4
# Module name   : ToolsetPrinter.pm
4
# Module type   : Makefile system
5
# Module type   : Perl Module
5
#
-
 
6
# Description:
6
# Compiler(s)   : Perl
7
#    Common toolset utils
7
# Environment(s): jats
8
#
8
#
9
# Version   Who     Date        Description
9
# Description   : Common toolset utils
10
#           APY     06/05/04    Created
-
 
11
#                   02/09/04    packaged functionality into ToolsetPrinter()
10
#                 Toolset I/O stream for creating makefile rules and recipes
12
#
-
 
13
# $Source: /cvsroot/etm/devl/CFG/TOOLSET/COMMON,v $
-
 
14
# $Revision: 1.4 $ $Date: 2004/09/06 07:37:44 $ $State: Exp $
-
 
15
# $Author: ayoung $ $Locker:  $
-
 
16
#............................................................................#
-
 
17
 
-
 
18
use strict;
11
# Usage:
19
use warnings;
-
 
20
 
-
 
21
###############################################################################
-
 
22
#   Toolset I/O stream
-
 
23
#
12
#
24
#       New         Create a new stream
13
#       New         Create a new stream
25
#
14
#
26
#       Prt         Print a raw line
15
#       Prt         Print a raw line
27
#
16
#
Line 37... Line 26...
37
#
26
#
38
#       SetTerm     Set the command line "terminator", default "\\n\n".
27
#       SetTerm     Set the command line "terminator", default "\\n\n".
39
#
28
#
40
#       Label       Print generalised label
29
#       Label       Print generalised label
41
#
30
#
-
 
31
#       StartDef    Create a Definition
-
 
32
#       Def         Accumulate
-
 
33
#       EndDef      Print it out
-
 
34
#
42
#       ObjList     Generate a object list, using the specified recipe.
35
#       ObjList     Generate a object list, using the specified recipe.
43
#
36
#
44
#       LibList     Generate a library list, using the specified recipe.
37
#       LibList     Generate a library list, using the specified recipe.
45
#
38
#
46
#       DepRules    Generate library dependency rules
39
#       DepRules    Generate library dependency rules
47
#
40
#
48
###############################################################################
41
###############################################################################
49
 
42
 
-
 
43
use strict;
-
 
44
use warnings;
-
 
45
 
-
 
46
 
50
package ToolsetPrinter;
47
package ToolsetPrinter;
51
 
48
 
52
sub New
49
sub New
53
{
50
{
54
    my ($tag, $cmdterm) = @_;
51
    my ($tag, $cmdterm) = @_;
Line 144... Line 141...
144
    {
141
    {
145
        &$genrecipe( $self, $target, $_, @uargs );
142
        &$genrecipe( $self, $target, $_, @uargs );
146
    }
143
    }
147
}
144
}
148
 
145
 
-
 
146
sub StartDef
-
 
147
{
-
 
148
    my ($self) = shift;
-
 
149
    my ($tag) = @_;
-
 
150
 
-
 
151
    $tag = "" if ( !defined($tag) );
-
 
152
    $self->{DEF} = $tag;
-
 
153
    $self->{DEFS} = [];
-
 
154
}
-
 
155
 
-
 
156
sub Def
-
 
157
{
-
 
158
    my ($self) = shift;
-
 
159
    push @{$self->{DEFS}}, "@_";
-
 
160
}
-
 
161
 
-
 
162
sub EndDef
-
 
163
{
-
 
164
    my ($self) = shift;
-
 
165
    ::MakeDefEntry ( $self->{DEF}, '=' , $self->{DEFS} );
-
 
166
    delete $self->{DEFS};
-
 
167
}
-
 
168
 
149
 
169
 
150
#private
170
#private
151
sub CondParse
171
sub CondParse
152
{
172
{
153
    my ($target, $cond) = @_;
173
    my ($target, $cond) = @_;
Line 278... Line 298...
278
sub SHLDDEPEND
298
sub SHLDDEPEND
279
{
299
{
280
    my ($self) = shift;
300
    my ($self) = shift;
281
    my ($target, $base, $name, $dir) = @_;
301
    my ($target, $base, $name, $dir) = @_;
282
 
302
 
-
 
303
    $self->Label( "Include Shared Library Dependency Rules", $target );
283
    $dir = "LIBDIR" unless ( defined $dir );
304
    $dir = "LIBDIR" unless ( defined $dir );
284
 
305
 
285
    $self->Prt( "
306
    $self->Prt( "
286
\$($dir)/${target}.dep:\tSHBASE=${base}
307
\$($dir)/${target}.dep:\tSHBASE=${base}
287
\$($dir)/${target}.dep:\tSHNAME=${name}
308
\$($dir)/${target}.dep:\tSHNAME=${name}
288
\$($dir)/${target}.dep:\t\$(GBE_$dir)
309
\$($dir)/${target}.dep:\t\$(GBE_$dir)
289
\$($dir)/${target}.dep:\t\$(GBE_PLATFORM).mk
310
\$($dir)/${target}.dep:\t\$(SCM_MAKEFILE)
290
	\$(SHLDDEPEND)
311
	\$(SHLDDEPEND)
291
 
312
 
292
ifneq \"\$(findstring \$(IFLAG),23)\" \"\"
313
ifneq \"\$(findstring \$(IFLAG),23)\" \"\"
293
-include\t\$($dir)/${target}.dep
314
-include\t\$($dir)/${target}.dep
294
endif
315
endif
Line 300... Line 321...
300
sub LDDEPEND
321
sub LDDEPEND
301
{
322
{
302
    my ($self) = shift;
323
    my ($self) = shift;
303
    my ($target, $dir) = @_;
324
    my ($target, $dir) = @_;
304
 
325
 
-
 
326
    $self->Label( "Include Library Dependency Rules", $target );
305
    $dir = "BINDIR" unless ( defined $dir );
327
    $dir = "BINDIR" unless ( defined $dir );
306
 
328
 
307
    $self->Prt( "
329
    $self->Prt( "
308
\$($dir)/${target}.dep:\t\$(GBE_$dir)
330
\$($dir)/${target}.dep:\t\$(GBE_$dir)
309
\$($dir)/${target}.dep:\t\$(GBE_PLATFORM).mk
331
\$($dir)/${target}.dep:\t\$(SCM_MAKEFILE)
310
	\$(LDDEPEND)
332
	\$(LDDEPEND)
311
 
333
 
312
ifeq \"\$(IFLAG)\" \"3\"
334
ifeq \"\$(IFLAG)\" \"3\"
313
-include\t\$($dir)/${target}.dep
335
-include\t\$($dir)/${target}.dep
314
endif
336
endif
Line 323... Line 345...
323
    my ($target, $libs, $librecipe, @uargs) = @_;
345
    my ($target, $libs, $librecipe, @uargs) = @_;
324
 
346
 
325
    unless ( $self->{DepRulesHeaderDone}{$target} )
347
    unless ( $self->{DepRulesHeaderDone}{$target} )
326
    {
348
    {
327
        $self->{DepRulesHeaderDone}{$target} = 1;
349
        $self->{DepRulesHeaderDone}{$target} = 1;
328
                                                # label
-
 
329
        $self->Prt( "#.. Dependencies ($target)\n\n" );
-
 
330
 
350
 
-
 
351
        $self->Label( "Dependencies", $target );    # label
331
                                                # library depends
352
                                                    # library depends
332
        $self->Tag( "\\# DO NOT REMOVE - dependencies\\\\n\\\\n" );
353
        $self->Tag( "\\# DO NOT REMOVE - dependencies\\\\n" );
-
 
354
        $self->Tag( "\\#\\\\n" );
333
    }
355
    }
-
 
356
 
334
    $self->LibList( $target, $libs, $librecipe, @uargs );
357
    $self->LibList( $target, $libs, $librecipe, @uargs );
335
}
358
}
336
 
359
 
337
1;
360
1;
338
 
361