Subversion Repositories DevTools

Rev

Rev 7322 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7322 Rev 7323
Line 197... Line 197...
197
#-------------------------------------------------------------------------------
197
#-------------------------------------------------------------------------------
198
# Function        : Define
198
# Function        : Define
199
#
199
#
200
# Description     : Flag the entry as a define, rather than a normal target
200
# Description     : Flag the entry as a define, rather than a normal target
201
#                   Many of the other commands are not supported
201
#                   Many of the other commands are not supported
-
 
202
#                   Only:
-
 
203
#                       AddComment
202
#                   Only AddComment and AddRecipe
204
#                       AddRecipe OR AddShellRecipe
-
 
205
#                       SectionIfDef and related fuction
-
 
206
#                           Will generate an empty definition for the 'else'
203
#
207
#
204
# Inputs          :
208
# Inputs          :
205
#
209
#
206
# Returns         :
210
# Returns         :
207
#
211
#
Line 425... Line 429...
425
        }
429
        }
426
    }
430
    }
427
}
431
}
428
 
432
 
429
#-------------------------------------------------------------------------------
433
#-------------------------------------------------------------------------------
-
 
434
# Function        : AddOneRecipe
-
 
435
#
-
 
436
# Description     : Add an array as a single recipe that has been formatted with implicit line breaks
-
 
437
#
-
 
438
# Inputs          : A recipe with implicit line breaks for formatting purposes.
-
 
439
#
-
 
440
# Returns         :
-
 
441
#
-
 
442
sub AddOneRecipe
-
 
443
{
-
 
444
    my $self = shift;
-
 
445
    my @data = @_;
-
 
446
    my $prefix = $self->{RECIPE_PREFIX};
-
 
447
 
-
 
448
    $data[0] = $prefix . $data[0];
-
 
449
    push @{$self->{RECIPE}}, \@data;
-
 
450
}
-
 
451
 
-
 
452
#-------------------------------------------------------------------------------
430
# Function        : AddShellRecipe
453
# Function        : AddShellRecipe
431
#
454
#
432
# Description     : Add recipe lines that will be processed within a 'shell'
455
# Description     : Add recipe lines that will be processed within a 'shell'
433
#
456
#
434
# Inputs          : One or more recipe lines
457
# Inputs          : One or more recipe lines
Line 602... Line 625...
602
        my $tstring = join ("\n", @{$self->{RECIPE}});
625
        my $tstring = join ("\n", @{$self->{RECIPE}});
603
        print $tstring;
626
        print $tstring;
604
    }
627
    }
605
    elsif ( $self->{DEFINE}  )
628
    elsif ( $self->{DEFINE}  )
606
    {
629
    {
-
 
630
        # Just print the recipe
-
 
631
        # May be warpped in an ifdef with an empty 'else'
607
 
632
 
608
        my $tstring = $self->{NAME}[0];
633
        my $tstring = $self->{NAME}[0];
-
 
634
        my $sdef =    $self->{SDEF};
-
 
635
 
-
 
636
        print "$sdef" if ($sdef);
-
 
637
 
609
        print "define $tstring";
638
        print "\ndefine $tstring";
610
        print_list ( '', '', $self->{RECIPE}, '');
639
        print_list ( '', '', $self->{RECIPE}, '');
-
 
640
        print_list ( $self->{RECIPE_WRAPPER}[0], '; \\', $self->{SHELL}, $self->{RECIPE_WRAPPER}[1] );
611
        print "\nendef";
641
        print "\nendef";
-
 
642
        if ($sdef) {
-
 
643
            print "\nelse";
-
 
644
            print "\ndefine $tstring";
-
 
645
            print "\nendef";
-
 
646
            print "\nendif";
-
 
647
        }
612
    }
648
    }
613
    else
649
    else
614
    {
650
    {
615
        #
651
        #
616
        #   Print the main target name
652
        #   Print the main target name
Line 643... Line 679...
643
            my $prefix =  $recipeEntry->{RECIPE_PREFIX};
679
            my $prefix =  $recipeEntry->{RECIPE_PREFIX};
644
            my $recipe =  $recipeEntry->{RECIPE};
680
            my $recipe =  $recipeEntry->{RECIPE};
645
            my $shell =   $recipeEntry->{SHELL};
681
            my $shell =   $recipeEntry->{SHELL};
646
            my $sdef =    $recipeEntry->{SDEF};
682
            my $sdef =    $recipeEntry->{SDEF};
647
 
683
 
648
            if ($sdef)
684
            if ($sdef) {
649
            {
-
 
650
                print "\n$sdef";
685
                print "\n$sdef";
651
            }
686
            }
652
 
687
 
653
            #
688
            #
654
            #   Print the Recipe runtime comment
689
            #   Print the Recipe runtime comment
655
            #
690
            #
656
            if ( $comment )
691
            if ( $comment ) {
657
            {
-
 
658
                print "\n\t\@echo \"$comment\"";
692
                print "\n\t\@echo \"$comment\"";
659
            }
693
            }
660
 
694
 
661
            #
695
            #
662
            #   Print the recipe
696
            #   Print the recipe
Line 668... Line 702...
668
            #   Bracket the recipes with ( .. ) and place semi colons between lines
702
            #   Bracket the recipes with ( .. ) and place semi colons between lines
669
            #   Use the current recipe prefix
703
            #   Use the current recipe prefix
670
            #
704
            #
671
            print_list ( $prefix . $wrapper->[0], ';\\', $shell, $wrapper->[1]);
705
            print_list ( $prefix . $wrapper->[0], ';\\', $shell, $wrapper->[1]);
672
 
706
 
673
            if ($sdef)
707
            if ($sdef) {
674
            {
-
 
675
                print "\nendif";
708
                print "\nendif";
676
            }
709
            }
677
        }
710
        }
678
    }
711
    }
679
 
712
 
Line 728... Line 761...
728
                my @array = @{$_};
761
                my @array = @{$_};
729
                my $indent = '';
762
                my $indent = '';
730
                my $tail = '';
763
                my $tail = '';
731
                foreach ( @array )
764
                foreach ( @array )
732
                {
765
                {
-
 
766
                    next unless (defined $_);
-
 
767
                    next unless ( length($_));
733
                    print( $tail . "\n" . $leadin . $indent . $_ );
768
                    print( $tail . "\n" . $leadin . $indent . $_ );
734
                    $indent = "\t";
769
                    $indent = "\t";
735
                    $tail = " \\";
770
                    $tail = " \\";
736
                }
771
                }
737
                print $linesep;
772
                print $linesep;