Subversion Repositories DevTools

Rev

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

Rev 381 Rev 387
Line 5267... Line 5267...
5267
        #   Do not use $(GBE_TYPE) in the target name
5267
        #   Do not use $(GBE_TYPE) in the target name
5268
        #   The existing package mechanism does not handle different
5268
        #   The existing package mechanism does not handle different
5269
        #   production and debug file naming mechanism, whereas the project
5269
        #   production and debug file naming mechanism, whereas the project
5270
        #   must. Convert $(GBE_TYPE) into P or D to ensure uniquness
5270
        #   must. Convert $(GBE_TYPE) into P or D to ensure uniquness
5271
        #
5271
        #
-
 
5272
        $item = QuoteForMake($item);
-
 
5273
        $target = QuoteForMake($target);
5272
        $target =~ s~\$\(GBE_TYPE\)~$type~ if ($type);
5274
        $target =~ s~\$\(GBE_TYPE\)~$type~ if ($type);
5273
 
5275
 
5274
        #
5276
        #
5275
        #   Create a PACKAGE entry suitable for processing by the normal packaging
5277
        #   Create a PACKAGE entry suitable for processing by the normal packaging
5276
        #   routines. This is complicated because the Projects do not adhere to
5278
        #   routines. This is complicated because the Projects do not adhere to
Line 6194... Line 6196...
6194
        if ( m~^DPACKAGE$~ && $DPackageDirective ) {
6196
        if ( m~^DPACKAGE$~ && $DPackageDirective ) {
6195
            $name = 'DPACKAGE.' . $::GBE_MACHTYPE;
6197
            $name = 'DPACKAGE.' . $::GBE_MACHTYPE;
6196
        }
6198
        }
6197
 
6199
 
6198
        #
6200
        #
6199
        #   Special cases: Provide make-style $ escape processing.
-
 
6200
        #       Allow files with a $ in the name
6201
        #   Allow for named files that must be quoted
6201
        #       Allow files with a space in the name
-
 
6202
        #   Only for file names that don't look like $(GBE_...) as these
-
 
6203
        #   may be generated internally
6202
        $name = QuoteForMake( $name );
6204
        #
-
 
6205
        unless ( $name =~ m~\$\(GBE_.+\)~ )
-
 
6206
        {
-
 
6207
            $name =~ s~\$~\$\$~g;
-
 
6208
            $name =~ s~ ~\\ ~g;
-
 
6209
            $name =~ s~,~\$(comma)~g;
-
 
6210
        }
-
 
6211
 
6203
 
6212
        if ( ! /^--(.*)/ )
6204
        if ( ! /^--(.*)/ )
6213
        {
6205
        {
6214
            $basename = StripDir( $name );
6206
            $basename = StripDir( $name );
6215
            if ( !($srcfile = $SRCS{ $basename }) ) {
6207
            if ( !($srcfile = $SRCS{ $basename }) ) {
Line 6311... Line 6303...
6311
    foreach ( @elements )
6303
    foreach ( @elements )
6312
    {
6304
    {
6313
        my %package_entry;
6305
        my %package_entry;
6314
        if ( ! /^--(.*)/ )
6306
        if ( ! /^--(.*)/ )
6315
        {
6307
        {
6316
            $name = $_;
6308
            $name = QuoteForMake($_);
6317
            $basename = StripDir( $name );
6309
            $basename = StripDir( $name );
6318
            if ( !($srcfile = $SRCS{ $basename }) ) {
6310
            if ( !($srcfile = $SRCS{ $basename }) ) {
6319
                $srcfile = $name;
6311
                $srcfile = $name;
6320
            }
6312
            }
6321
 
6313
 
Line 6457... Line 6449...
6457
            {
6449
            {
6458
                #
6450
                #
6459
                #   Allow the user to package a sourced file as a library
6451
                #   Allow the user to package a sourced file as a library
6460
                #   But must be the un-massaged name of the file.
6452
                #   But must be the un-massaged name of the file.
6461
                #
6453
                #
6462
                $package_entry{'dst'} = "$dir/$org_lib";
6454
                $package_entry{'dst'} = QuoteForMake("$dir/$org_lib");
6463
                $package_entry{'src'} = $libfile;
6455
                $package_entry{'src'} = QuoteForMake($libfile);
6464
            }
6456
            }
6465
            elsif ( $LIBS->Get($lib) )
6457
            elsif ( $LIBS->Get($lib) )
6466
            {
6458
            {
6467
                #
6459
                #
6468
                #   Package up a library known to the makefile
6460
                #   Package up a library known to the makefile
Line 6615... Line 6607...
6615
            #
6607
            #
6616
            #   A "file" that is specified with a "Src" directive may be
6608
            #   A "file" that is specified with a "Src" directive may be
6617
            #   installed as though it were a program
6609
            #   installed as though it were a program
6618
            #
6610
            #
6619
            my $progfile;
6611
            my $progfile;
-
 
6612
            if ( $progfile = $SRCS{$prog} )
-
 
6613
            {
6620
            $progfile = "\$(BINDIR)/$prog$ext"
6614
                $progfile = QuoteForMake($progfile);
-
 
6615
                $prog = QuoteForMake($prog);
-
 
6616
            }
-
 
6617
            else
-
 
6618
            {
6621
                unless ( $progfile = $SRCS{$prog} );
6619
                $progfile = "\$(BINDIR)/$prog$ext";
-
 
6620
            }
6622
 
6621
 
6623
            Debug( "PackageProg( $dir/$prog$ext, " .
6622
            Debug( "PackageProg( $dir/$prog$ext, " .
6624
                 "src: $progfile, dest: $dir, dist: $dist, type: $type )" );
6623
                 "src: $progfile, dest: $dir, dist: $dist, type: $type )" );
6625
 
6624
 
6626
            my $target = "$dir/$prog$ext";
6625
            my $target = "$dir/$prog$ext";
Line 9913... Line 9912...
9913
 
9912
 
9914
    return 0;
9913
    return 0;
9915
}
9914
}
9916
 
9915
 
9917
#-------------------------------------------------------------------------------
9916
#-------------------------------------------------------------------------------
-
 
9917
# Function        : QuoteForMake
-
 
9918
#
-
 
9919
# Description     : Escape/Quote a pathname for make
-
 
9920
#                       Allow files with a $ in the name
-
 
9921
#                       Allow files with a space in the name
-
 
9922
#                       Allow files with a comma in the name
-
 
9923
#                       Allow for paths that have make-varible prefixes
-
 
9924
#                           $(GBE_...)/
-
 
9925
#                           as these may be generated internally
-
 
9926
#
-
 
9927
# Inputs          : uarg                - Arg to quote
-
 
9928
#
-
 
9929
# Returns         : Quoted arg
-
 
9930
#
-
 
9931
 
-
 
9932
sub QuoteForMake()
-
 
9933
{
-
 
9934
    my ($uarg) = @_;
-
 
9935
 
-
 
9936
    #
-
 
9937
    #   Split into two
-
 
9938
    #       $(xxx)/             - Makefile variables
-
 
9939
    #       Remainder           - Stuff to quote
-
 
9940
    #
-
 
9941
    $uarg =~ m~^((\$\(.*?\)/)*)(.*)~;
-
 
9942
    my $prefix = defined $1 ? $1 : '';
-
 
9943
    my $arg    = defined $3 ? $3 : '';
-
 
9944
 
-
 
9945
    $arg =~ s~\$~\$\$~g;
-
 
9946
    $arg =~ s~ ~\\ ~g;
-
 
9947
    $arg =~ s~,~\$(comma)~g;
-
 
9948
 
-
 
9949
print "==== $uarg\n";
-
 
9950
print "------ $prefix -- $arg\n";
-
 
9951
    return $prefix . $arg;
-
 
9952
}
-
 
9953
 
-
 
9954
 
-
 
9955
#-------------------------------------------------------------------------------
9918
# Function        : Maketag
9956
# Function        : Maketag
9919
#
9957
#
9920
# Description     : Create Makefile tags to speed up recursive makes
9958
# Description     : Create Makefile tags to speed up recursive makes
9921
#
9959
#
9922
# Inputs          : tag_name
9960
# Inputs          : tag_name