Subversion Repositories DevTools

Rev

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

Rev 7300 Rev 7322
Line 82... Line 82...
82
    $self->{NAME}           = [];
82
    $self->{NAME}           = [];
83
    $self->{RECIPE}         = [];
83
    $self->{RECIPE}         = [];
84
    $self->{SHELL}          = [];
84
    $self->{SHELL}          = [];
85
    $self->{PRINTED}        = 0;
85
    $self->{PRINTED}        = 0;
86
    $self->{COMMENT}        = [];
86
    $self->{COMMENT}        = [];
87
    $self->{DEFN}           = {};
87
    $self->{DEFN}           = [];
88
    $self->{PHONY}          = 0;
88
    $self->{PHONY}          = 0;
89
    $self->{DEFINE}         = 0;
89
    $self->{DEFINE}         = 0;
90
    $self->{RAW}            = 0;
90
    $self->{RAW}            = 0;
91
    $self->{FH}             = $handle;
91
    $self->{FH}             = $handle;
92
    $self->{FH_inmemory}    = 0;
92
    $self->{FH_inmemory}    = 0;
Line 251... Line 251...
251
#                       Allow files with a $ in the name
251
#                       Allow files with a $ in the name
252
#                       Allow files with a space in the name
252
#                       Allow files with a space in the name
253
#                       Allow files with a comma in the name
253
#                       Allow files with a comma in the name
254
#                       Allow files with a colon in the name
254
#                       Allow files with a colon in the name
255
#                       Allow for paths that have make-varible prefixes
255
#                       Allow for paths that have make-varible prefixes
256
#                           $(GBE_...) or ${GBE_...} or $(OBJDIR)
256
#                           $(GBE_...) or ${GBE_...} or $(OBJDIR) or $(BUILDVERNUM)
257
#                           as these may be generated internally
257
#                           as these may be generated internally
258
#
258
#
259
#                       Must also allow $(GBE_TYPE) in the remainder
259
#                       Must also allow $(GBE_TYPE) in the remainder
260
#
260
#
261
# Inputs          : uarg                - Arg to quote
261
# Inputs          : uarg                - Arg to quote
Line 274... Line 274...
274
    #
274
    #
275
    $uarg =~ m~^((\$\(.*?\)/)*)(.*)~;
275
    $uarg =~ m~^((\$\(.*?\)/)*)(.*)~;
276
    my $prefix = defined $1 ? $1 : '';
276
    my $prefix = defined $1 ? $1 : '';
277
    my $arg    = defined $3 ? $3 : '';
277
    my $arg    = defined $3 ? $3 : '';
278
 
278
 
279
    $arg =~ s~\$(?!\(GBE_[A-Z]+\)|{GBE_[A-Z]+}|\(OBJDIR\))~\$\$~g;       # $, not followed by (GBE_ or ${GBE_ or (OBJDIR)- is not $(GBE_ AND not $(OBJDIR)
279
    $arg =~ s~\$(?!\(GBE_[A-Z]+\)|{GBE_[A-Z]+}|\(OBJDIR\)|\(BUILDVERNUM\))~\$\$~g;       # $, not followed by (GBE_ or ${GBE_ or (OBJDIR)- is not $(GBE_ AND not $(OBJDIR)
280
    $arg =~ s~ ~\\ ~g;
280
    $arg =~ s~ ~\\ ~g;
281
    $arg =~ s~,~\$(comma)~g;
281
    $arg =~ s~,~\$(comma)~g;
282
    $arg =~ s~%~\\%~g;
282
    $arg =~ s~%~\\%~g;
283
    $arg =~ s~:~\\:~g if ($::ScmHost eq 'Unix');
283
    $arg =~ s~:~\\:~g if ($::ScmHost eq 'Unix');
284
    return $prefix . $arg;
284
    return $prefix . $arg;
Line 321... Line 321...
321
 
321
 
322
#-------------------------------------------------------------------------------
322
#-------------------------------------------------------------------------------
323
# Function        : AddDefn
323
# Function        : AddDefn
324
#
324
#
325
# Description     : Add a definition to the entry
325
# Description     : Add a definition to the entry
-
 
326
#                   Preserve the order
326
#
327
#
327
# Inputs          : A hash of definitions to add
328
# Inputs          : A hash of definitions to add
328
#                   The Hash gets lost in the subcall. Its simply a list
329
#                   The Hash gets lost in the subcall. Its simply a list
329
#                   of NAME, VALUE pairs
330
#                   of NAME, VALUE pairs
330
#
331
#
Line 335... Line 336...
335
    my $self = shift;
336
    my $self = shift;
336
    while ( @_ )
337
    while ( @_ )
337
    {
338
    {
338
        my $defn = shift;
339
        my $defn = shift;
339
        my $value = shift || '';
340
        my $value = shift || '';
340
        $self->{DEFN}{$defn} = $value;
341
        push @{$self->{DEFN}}, join( $;, $defn, $value) ;
341
    }
342
    }
342
}
343
}
343
 
344
 
344
#-------------------------------------------------------------------------------
345
#-------------------------------------------------------------------------------
345
# Function        : RecipePrefix
346
# Function        : RecipePrefix
Line 491... Line 492...
491
#
492
#
492
 
493
 
493
sub SectionIfDef
494
sub SectionIfDef
494
{
495
{
495
    my $self = shift;
496
    my $self = shift;
496
    $self->{SDEF} = $_[0];
497
    $self->{SDEF} = 'ifdef ' . $_[0];
497
}
498
}
498
 
499
 
499
#-------------------------------------------------------------------------------
500
#-------------------------------------------------------------------------------
-
 
501
# Function        : SectionIfEq
-
 
502
#
-
 
503
# Description     : Place the current section within a ifeq ... endif block
-
 
504
#
-
 
505
# Inputs          : arg1
-
 
506
#                   arg2
-
 
507
#
-
 
508
# Returns         : Nothing
-
 
509
#
-
 
510
 
-
 
511
sub SectionIfEq
-
 
512
{
-
 
513
    my $self = shift;
-
 
514
    $self->{SDEF} = 'ifeq "' . $_[0] . '" "' . $_[1] . '"';
-
 
515
}
-
 
516
 
-
 
517
#-------------------------------------------------------------------------------
-
 
518
# Function        : SectionIfNeq
-
 
519
#
-
 
520
# Description     : Place the current section within a ifeq ... endif block
-
 
521
#
-
 
522
# Inputs          : arg1
-
 
523
#                   arg2
-
 
524
#
-
 
525
# Returns         : Nothing
-
 
526
#
-
 
527
sub SectionIfNeq
-
 
528
{
-
 
529
    my $self = shift;
-
 
530
    $self->{SDEF} = 'ifneq "' . $_[0] . '" "' . $_[1] . '"';
-
 
531
}
-
 
532
 
-
 
533
 
-
 
534
#-------------------------------------------------------------------------------
500
# Function        : Print
535
# Function        : Print
501
#
536
#
502
# Description     : Print the entry
537
# Description     : Print the entry
503
#
538
#
504
# Inputs          : None
539
# Inputs          : None
Line 548... Line 583...
548
    if ( $self->{DEFN}  )
583
    if ( $self->{DEFN}  )
549
    {
584
    {
550
        my $tstring = join $;, @{$self->{NAME}};
585
        my $tstring = join $;, @{$self->{NAME}};
551
        my $join = length ($tstring) < $llength ? ' ' : " \\\n    ";
586
        my $join = length ($tstring) < $llength ? ' ' : " \\\n    ";
552
        $tstring =~ s~$;~$join~g;
587
        $tstring =~ s~$;~$join~g;
-
 
588
 
553
        foreach  ( keys %{$self->{DEFN}}  )
589
        foreach ( @{$self->{DEFN}} ){
554
        {
-
 
555
            my $value = $self->{DEFN} {$_};
590
            my ($defn,$value) = split($;, $_);
556
            print( "$tstring: $_ := $value\n" );
591
            print( "$tstring: $defn := $value\n" );
557
        }
592
        }
558
    }
593
    }
559
 
594
 
560
    if ( $self->{RAW}  )
595
    if ( $self->{RAW}  )
561
    {
596
    {
Line 610... Line 645...
610
            my $shell =   $recipeEntry->{SHELL};
645
            my $shell =   $recipeEntry->{SHELL};
611
            my $sdef =    $recipeEntry->{SDEF};
646
            my $sdef =    $recipeEntry->{SDEF};
612
 
647
 
613
            if ($sdef)
648
            if ($sdef)
614
            {
649
            {
615
                print "\nifdef $sdef";
650
                print "\n$sdef";
616
            }
651
            }
617
 
652
 
618
            #
653
            #
619
            #   Print the Recipe runtime comment
654
            #   Print the Recipe runtime comment
620
            #
655
            #