Subversion Repositories DevTools

Rev

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

Rev 6353 Rev 6387
Line 234... Line 234...
234
our $SHLIBS                 = ();
234
our $SHLIBS                 = ();
235
our @SHLIB_TARGETS          = ();
235
our @SHLIB_TARGETS          = ();
236
our %SHLIB_PKG              = ();
236
our %SHLIB_PKG              = ();
237
our %SHLIB_INS              = ();
237
our %SHLIB_INS              = ();
238
our %INSTALL_SHLIBS         = ();
238
our %INSTALL_SHLIBS         = ();
-
 
239
our @INSTALL_DIRS           = ();
239
 
240
 
240
our $TESTPROGS              = ();
241
our $TESTPROGS              = ();
241
our @TESTPROGS              = ();
242
our @TESTPROGS              = ();
242
 
243
 
243
our $PROGS                  = ();           # Simplify tracking of progs
244
our $PROGS                  = ();           # Simplify tracking of progs
Line 253... Line 254...
253
our %PACKAGE_LIBS           = ();
254
our %PACKAGE_LIBS           = ();
254
our %PACKAGE_CLSS           = ();
255
our %PACKAGE_CLSS           = ();
255
our %PACKAGE_SHLIBS         = ();
256
our %PACKAGE_SHLIBS         = ();
256
our %PACKAGE_PROGS          = ();
257
our %PACKAGE_PROGS          = ();
257
our %PACKAGE_FILES          = ();
258
our %PACKAGE_FILES          = ();
258
 
-
 
259
our @PACKAGE_VARS           = ( '%PACKAGE_CLSS',  '%PACKAGE_FILES', '%PACKAGE_HDRS',
259
our @PACKAGE_DIRS           = ();
260
                                '%PACKAGE_LIBS',  '%PACKAGE_PROGS', '%PACKAGE_SHLIBS' );
-
 
261
our @INSTALL_VARS           = ( '%INSTALL_CLSS',  '%INSTALL_HDRS',  '%INSTALL_LIBS',
-
 
262
                                '%INSTALL_PROGS', '%INSTALL_SHLIBS');
-
 
263
 
260
 
264
our @LINTLIBS               = ();
261
our @LINTLIBS               = ();
265
our @LINTSHLIBS             = ();
262
our @LINTSHLIBS             = ();
266
 
263
 
267
our @TESTS_TO_RUN           = ();                           # Info from 'RunTest' directives
264
our @TESTS_TO_RUN           = ();                           # Info from 'RunTest' directives
Line 717... Line 714...
717
 
714
 
718
    #
715
    #
719
    #   Include local toolset extensions
716
    #   Include local toolset extensions
720
    #   These are rooted in the build directory and are not to be confused with
717
    #   These are rooted in the build directory and are not to be confused with
721
    #   extensions that may be packaged
718
    #   extensions that may be packaged
-
 
719
    #   Simplify life - add the directory to the BUILDTOOLSPATH
722
    #
720
    #
723
    my $local_base_dir = "$ScmRoot/gbe/DIRECTIVES";
721
    my $local_base_dir = "$ScmRoot/gbe/DIRECTIVES";
724
    if ( -d $local_base_dir )
722
    if ( -d $local_base_dir )
725
    {
723
    {
-
 
724
        unshift @::BUILDTOOLSPATH, AbsPath($local_base_dir); 
726
        foreach my $file  ( glob ("$local_base_dir/*.pm") )
725
        foreach my $file  ( glob ("$local_base_dir/*.pm") )
727
        {
726
        {
728
            push( @ScmDepends, "$file" );
727
            push( @ScmDepends, "$file" );
729
            require $file;
728
            require $file;
730
        }
729
        }
Line 2932... Line 2931...
2932
        
2931
        
2933
        if ( $arg =~ /^--NoVarTag$/ )
2932
        if ( $arg =~ /^--NoVarTag$/ )
2934
        {
2933
        {
2935
            #
2934
            #
2936
            #   Modify the operation of --Var to supress the tags
2935
            #   Modify the operation of --Var to supress the tags
2937
            #   Should be usd early as will only affect following --Var usage
2936
            #   Should be used early as will only affect following --Var usage
2938
            #
2937
            #
2939
            push @var_opts, "--notag";
2938
            push @var_opts, "--notag";
2940
            next;
2939
            next;
2941
        }
2940
        }
2942
 
2941
 
Line 3096... Line 3095...
3096
            my $ufn = $3 || $4 || $5;           # User filename + options
3095
            my $ufn = $3 || $4 || $5;           # User filename + options
3097
            my $mb = $-[0];                     # Match begin offset
3096
            my $mb = $-[0];                     # Match begin offset
3098
            my $me = $+[0];                     # Match end
3097
            my $me = $+[0];                     # Match end
3099
            my $flags = '';                     # Optional flags ( --dir or --file )
3098
            my $flags = '';                     # Optional flags ( --dir or --file )
3100
            my $raw_arg = $ufn;                 # Raw arguments
3099
            my $raw_arg = $ufn;                 # Raw arguments
3101
            my $all = substr( $arg, $mb, $me ); # All of match. Avoid use of $&
3100
            my $all = substr( $arg, $mb, $me - $mb ); # All of match. Avoid use of $&
3102
            my $is_path = 1;
3101
            my $is_path = 1;
3103
            
3102
            
3104
 
3103
 
3105
            Error ("GenerateFiles. Empty element not allowed: $all")
3104
            Error ("GenerateFiles. Empty element not allowed: $all")
3106
                unless ( defined($ufn) );
3105
                unless ( defined($ufn) );
Line 3302... Line 3301...
3302
    $gen_data{'text'}       = $text || $gen_files[0];
3301
    $gen_data{'text'}       = $text || $gen_files[0];
3303
    $gen_data{'preq_sus'}   = 1 if ( $preq_unknown );
3302
    $gen_data{'preq_sus'}   = 1 if ( $preq_unknown );
3304
    $gen_data{'predelete'}  = 1 if ( $predelete );
3303
    $gen_data{'predelete'}  = 1 if ( $predelete );
3305
 
3304
 
3306
    push(@GENERATE_FILES, \%gen_data);
3305
    push(@GENERATE_FILES, \%gen_data);
3307
 
-
 
-
 
3306
#DebugDumpData("GenerateFiles", \%gen_data);
3308
    Debug2( "GenerateFiles: cmd: $tool @tool_args" );
3307
    Debug2( "GenerateFiles: cmd: $tool @tool_args" );
3309
}
3308
}
3310
 
3309
 
3311
#-------------------------------------------------------------------------------
3310
#-------------------------------------------------------------------------------
3312
# Function        : MakePerlModule
3311
# Function        : MakePerlModule
Line 4092... Line 4091...
4092
#                       --h, --headers
4091
#                       --h, --headers
4093
#                       --asm
4092
#                       --asm
4094
#                       --FromPackage       - Search packages for the file
4093
#                       --FromPackage       - Search packages for the file
4095
#                       --List=xxx          - Append file to a named list
4094
#                       --List=xxx          - Append file to a named list
4096
#                       --Depends=xxx       - Manually name a dependency
4095
#                       --Depends=xxx       - Manually name a dependency
-
 
4096
#                       --IgnoreDuplicates  - Ignore duplicates (mostly internal use)
4097
#
4097
#
4098
#                   Options are processed before file elements
4098
#                   Options are processed before file elements
4099
#                   Thus options apply to all files in the list
4099
#                   Thus options apply to all files in the list
4100
#
4100
#
4101
# Returns         : Nothing
4101
# Returns         : Nothing
4102
#
4102
#
4103
sub Src
4103
sub Src
4104
{
4104
{
4105
    my( $platforms, @elements ) = @_;
4105
    my( $platforms, @elements ) = @_;
4106
    my( $type, @args, $source, $basename, $from_package, @lists );
4106
    my( $type, @args, $source, $basename, $from_package, @lists, $ignoreDups );
4107
    my( @depends, @srcs );
4107
    my( @depends, @srcs );
4108
 
4108
 
4109
    $platforms = '' unless ( $platforms );
4109
    $platforms = '' unless ( $platforms );
4110
    Debug2( "Src($platforms, @elements)" );
4110
    Debug2( "Src($platforms, @elements)" );
4111
 
4111
 
Line 4151... Line 4151...
4151
        elsif ( /^--asm$/ )
4151
        elsif ( /^--asm$/ )
4152
        {
4152
        {
4153
            Debug( "Src: --asm" );
4153
            Debug( "Src: --asm" );
4154
            $type = ".asm";
4154
            $type = ".asm";
4155
        }
4155
        }
-
 
4156
        elsif ( /^--IgnoreDup/ )
-
 
4157
        {
-
 
4158
            $ignoreDups = 1;
-
 
4159
        }
4156
        elsif ( /^--FromPackage$/ )
4160
        elsif ( /^--FromPackage$/ )
4157
        {
4161
        {
4158
            $from_package = 1;
4162
            $from_package = 1;
4159
        }
4163
        }
4160
        elsif ( /^--List=(.*)/ )
4164
        elsif ( /^--List=(.*)/ )
Line 4192... Line 4196...
4192
            $source = MakeSrcResolveExtended( $from_package, $_ );
4196
            $source = MakeSrcResolveExtended( $from_package, $_ );
4193
            $basename = StripDir( $source );
4197
            $basename = StripDir( $source );
4194
            Debug( "Src: $_ -> $source=$basename (@args),(@depends)" );
4198
            Debug( "Src: $_ -> $source=$basename (@args),(@depends)" );
4195
 
4199
 
4196
            if ( $SRCS{ $basename } ) {
4200
            if ( $SRCS{ $basename } ) {
4197
                Warning( "Duplicate src ignored '$source'");
4201
                Warning( "Duplicate src ignored '$source'") unless $ignoreDups;
4198
                next;
4202
                next;
4199
            }
4203
            }
4200
            $SRCS{ $basename } = $source;
4204
            $SRCS{ $basename } = $source;
4201
 
4205
 
4202
            HashJoin( \%SRC_ARGS, $;, $basename, @args )
4206
            HashJoin( \%SRC_ARGS, $;, $basename, @args )
Line 4224... Line 4228...
4224
            __AddSourceFile( 1, $source, "", $type );
4228
            __AddSourceFile( 1, $source, "", $type );
4225
        }
4229
        }
4226
    }
4230
    }
4227
}
4231
}
4228
 
4232
 
-
 
4233
#-------------------------------------------------------------------------------
-
 
4234
# Function        : AddToSrc 
-
 
4235
#
-
 
4236
# Description     : Internal function
-
 
4237
#                   Used by plugins and tools
-
 
4238
#                   
-
 
4239
#                   Will test if specified file is known to JATS, before
-
 
4240
#                   adding to the the list of known (Src) files 
-
 
4241
#
-
 
4242
# Inputs          : $platform
-
 
4243
#                   $file           - Only one file
-
 
4244
#                   @srcOpts        - Same as Src
-
 
4245
#
-
 
4246
# Returns         : True if any file can be found
-
 
4247
#                   Returns full path to the file    
-
 
4248
#
-
 
4249
sub AddToSrc
-
 
4250
{
-
 
4251
    my( $platforms, $file, @args ) = @_;
-
 
4252
    Debug2( "AddToSrc($platforms, $file, @args)" );
-
 
4253
 
-
 
4254
    #
-
 
4255
    #   Process files
-
 
4256
    #
-
 
4257
    my $basename = StripDir( $file );
-
 
4258
    unless (exists $SRCS{$file} || exists  $SRCS{$basename} ) {
-
 
4259
        Src ('*', $file, @args);
-
 
4260
    }
-
 
4261
 
-
 
4262
    return $SRCS{$basename};
-
 
4263
}
-
 
4264
 
4229
 
4265
 
4230
###############################################################################
4266
###############################################################################
4231
#  sub LibNameSplit
4267
#  sub LibNameSplit
4232
#      Just a little help to deal with major/minor stuff for shared libs -
4268
#      Just a little help to deal with major/minor stuff for shared libs -
4233
#      given the name of the library as the argument, split out major and minor
4269
#      given the name of the library as the argument, split out major and minor
Line 5024... Line 5060...
5024
            my $ufn = $3 || $4 || $5;           # User filename + options
5060
            my $ufn = $3 || $4 || $5;           # User filename + options
5025
            my $mb = $-[0];                     # Match begin offset
5061
            my $mb = $-[0];                     # Match begin offset
5026
            my $me = $+[0];                     # Match end
5062
            my $me = $+[0];                     # Match end
5027
            my $flags = '';                     # Optional flags ( --dir or --file )
5063
            my $flags = '';                     # Optional flags ( --dir or --file )
5028
            my $raw_arg = $ufn;                 # Raw arguments
5064
            my $raw_arg = $ufn;                 # Raw arguments
5029
            my $all = substr( $arg, $mb, $me ); # All of match. Avoid use of $&
5065
            my $all = substr( $arg, $mb, $me - $mb ); # All of match. Avoid use of $&
5030
            my $is_abs;
5066
            my $is_abs;
5031
            my $is_path = 1;
5067
            my $is_path = 1;
5032
 
5068
 
5033
            Error ("RunTest. Empty element not allowed: $all")
5069
            Error ("RunTest. Empty element not allowed: $all")
5034
                unless ( defined($ufn) );
5070
                unless ( defined($ufn) );
Line 5080... Line 5116...
5080
            elsif ( $cmd =~ /^Local/ )
5116
            elsif ( $cmd =~ /^Local/ )
5081
            {
5117
            {
5082
                $fn = '$(LOCALDIR)/' . $ufn ;
5118
                $fn = '$(LOCALDIR)/' . $ufn ;
5083
                UniquePush (\@preq_files, $fn);
5119
                UniquePush (\@preq_files, $fn);
5084
            }
5120
            }
-
 
5121
            elsif ( $cmd =~ /^Dir/ )
-
 
5122
            {
-
 
5123
                # Item is a directory.
-
 
5124
                # Must be massaged so that it will be correct within the context
-
 
5125
                # Modified path is simply added to the command line
-
 
5126
                # 
-
 
5127
                $fn = $ufn;
-
 
5128
                unless (-d $fn) {
-
 
5129
                    if (-f $fn) {
-
 
5130
                        Warning ("Not a directory. Its a file: $arg") ;
-
 
5131
                    } else {
-
 
5132
                        Warning ("Directory not found: $arg");
-
 
5133
                    }
-
 
5134
                }
-
 
5135
            }
5085
            else
5136
            else
5086
            {
5137
            {
5087
                Warning ("RunTest: Unknown replacement command: $cmd");
5138
                Warning ("RunTest: Unknown replacement command: $cmd");
5088
                $fn = $ufn;
5139
                $fn = $ufn;
5089
            }
5140
            }
Line 5962... Line 6013...
5962
        }
6013
        }
5963
 
6014
 
5964
        if ($flags & $T_PKG) {
6015
        if ($flags & $T_PKG) {
5965
            $dir = __PkgDir( $udir );
6016
            $dir = __PkgDir( $udir );
5966
        } else {
6017
        } else {
5967
            $dir = "\$(LOCALDIR)/$udir";
6018
            $dir = $base . "/" . $udir;
5968
        }
6019
        }
5969
    }
6020
    }
5970
 
6021
 
5971
    return ($consumed) if ($dir eq "");
6022
    return ($consumed) if ($dir eq "");
5972
    $dir =~ s~//~/~g;
6023
    $dir =~ s~//~/~g;
Line 6472... Line 6523...
6472
            if ( ! exists $PACKAGE_SETS{ $_ }{'TAG'} );
6523
            if ( ! exists $PACKAGE_SETS{ $_ }{'TAG'} );
6473
    }
6524
    }
6474
}
6525
}
6475
 
6526
 
6476
#-------------------------------------------------------------------------------
6527
#-------------------------------------------------------------------------------
-
 
6528
# Function        : PackageDir 
-
 
6529
#                   InstallDir
-
 
6530
#
-
 
6531
# Description     : Directive to package an entire directory tree
-
 
6532
#                   Will package the contents of the directory without regard as to there content
-
 
6533
#                   
-
 
6534
#                   Differs from PackageFile (... --DirTree ) in that the process is dynamic
-
 
6535
#                   It will support the packaging of files that are generated
-
 
6536
#                   
-
 
6537
#                   NOT intended to support the JATS BIN and LIB structure
-
 
6538
#                   It knows nothing of these types of files
-
 
6539
#
-
 
6540
# Inputs          : platforms   - Active platform list
-
 
6541
#                   Options:    - Many from PackageFile
-
 
6542
#                       --DirTree=xxx   Source Tree [Mandatory]
-
 
6543
#                       --Subdir=yyy    Target [ Mandatory]
-
 
6544
#
-
 
6545
sub PackageDir { 
-
 
6546
    return if ( !$ScmPackage );                 # Packaging enabled ?
-
 
6547
    _PackageInstallDir('PackageDir', 'PBase', \@PACKAGE_DIRS, @_);
-
 
6548
    }
-
 
6549
 
-
 
6550
sub InstallDir { 
-
 
6551
    Warning ("InstallDir: Needs local directory specified in build.pl") unless ( $::ScmLocal );
-
 
6552
    _PackageInstallDir('InstallDir', 'IBase', \@INSTALL_DIRS, @_);
-
 
6553
    }
-
 
6554
 
-
 
6555
sub _PackageInstallDir
-
 
6556
{
-
 
6557
    my( $cmdName, $tbase, $dirRef, $platforms, @elements ) = @_;
-
 
6558
    my( $base, $dir, $path, $type );
-
 
6559
    my %data;
-
 
6560
 
-
 
6561
    Debug2( "$cmdName($platforms, @elements)" );
-
 
6562
 
-
 
6563
    return if ( ! ActivePlatform($platforms) );
-
 
6564
 
-
 
6565
#.. Arguments
-
 
6566
#
-
 
6567
    $base = $PackageInfo{'File'}{$tbase};           # Base of target
-
 
6568
    $dir = $base . $PackageInfo{'File'}{'Dir'};     # Installation path (default)
-
 
6569
 
-
 
6570
    foreach ( @elements )
-
 
6571
    {
-
 
6572
        my $rv = __TargetDir($T_MACH|$T_GBE|$T_FILE, $base, $_, \$dir, \$type);
-
 
6573
        next if ( $rv == 1 );
-
 
6574
        return if ( $rv == 2 );
-
 
6575
 
-
 
6576
        if (/^--Executable$/) {                  # Mark the file as executable
-
 
6577
            $data{exefile} = "X";
-
 
6578
 
-
 
6579
        } elsif (/^--PreserveSymlink/i) {        # Preserve symlink to local file
-
 
6580
            delete $data{noPreserveSymlink};
-
 
6581
 
-
 
6582
        } elsif (/^--NoPreserveSymlink/i) {      # Preserve symlink to local file
-
 
6583
            $data{noPreserveSymlink} = 1;
-
 
6584
 
-
 
6585
        } elsif ( /^--DirTree=(.*)/ ) {
-
 
6586
            Error("DirTree. Multiple directories not allowed.") if ( $data{dirTree} );
-
 
6587
            $data{dirTree} =  $1;
-
 
6588
 
-
 
6589
        } elsif ( /^--FilterOut=(.*)/ ) {
-
 
6590
            push @{$data{exclude}}, $1;
-
 
6591
 
-
 
6592
        } elsif ( /^--FilterIn=(.*)/ ) {
-
 
6593
            push @{$data{include}}, $1;
-
 
6594
 
-
 
6595
        } elsif ( /^--FilterOutRe=(.*)/ ) {
-
 
6596
            push @{$data{excludeRe}}, $1;
-
 
6597
 
-
 
6598
        } elsif ( /^--FilterInRe=(.*)/ ) {
-
 
6599
            push @{$data{includeRe}}, $1;
-
 
6600
 
-
 
6601
        } elsif ( /^--StripDir/ ) {
-
 
6602
            $data{strip_base} = 1;
-
 
6603
 
-
 
6604
        } elsif ( m/^--Recurse/ ) {
-
 
6605
            delete $data{noRecurse};
-
 
6606
 
-
 
6607
        } elsif ( m/^--NoRecurse/ ) {
-
 
6608
            $data{noRecurse} = 1;
-
 
6609
 
-
 
6610
        } elsif (/^--(.*)/) {
-
 
6611
            Message( "$cmdName: unknown option $_ -- ignored\n" );
-
 
6612
        }
-
 
6613
    }
-
 
6614
    Error("DirTree. No path specified") unless ( defined($data{dirTree}) && $data{dirTree} ne "" );
-
 
6615
    Debug2( "$cmdName. Raw DirTree: $data{dirTree}" );
-
 
6616
 
-
 
6617
    # Prevent the user from escaping from the current directory
-
 
6618
    Error("$cmdName. Absolute paths are not allowed",
-
 
6619
          "Directory: $data{dirTree}") if ( $data{dirTree} =~ m~^/~ || $data{dirTree} =~ m~^.\:~ );
-
 
6620
 
-
 
6621
    #
-
 
6622
    #   Convert the relative path to one that is truely relative to the current
-
 
6623
    #   directory. This may occur when the user uses $ProjectBase
-
 
6624
    #
-
 
6625
    my $abs_dir_tree = AbsPath($data{dirTree});
-
 
6626
    $data{dirTree} = RelPath($abs_dir_tree);
-
 
6627
 
-
 
6628
    #
-
 
6629
    #   Ensure that the user is not trying to escape the package
-
 
6630
    #   Don't allow the user to attempt to package the entire package either
-
 
6631
    #
-
 
6632
    #   Calculate the relative path from $ProjectBase to the target directory
-
 
6633
    #   It must not be above the $ProjectBase 
-
 
6634
    #
-
 
6635
    if ( $data{dirTree} =~ m~^\.\.~)
-
 
6636
    {
-
 
6637
        my $dirFromBase = RelPath($abs_dir_tree, AbsPath($ProjectBase));
-
 
6638
        Error("$cmdName. DirTree cannot extend outside current package.",
-
 
6639
              "Directory: $dirFromBase") if ( $dirFromBase =~ m~\.\.~ );
-
 
6640
        Error("$cmdName. DirTree cannot package entire package.",
-
 
6641
            "Directory: $dirFromBase") if ( $dirFromBase eq '.' );
-
 
6642
    }
-
 
6643
 
-
 
6644
    Debug( "$cmdName( $data{dirTree}");
-
 
6645
    $data{dir} = $dir;
-
 
6646
    $data{type} = $type if defined $type;
-
 
6647
    #DebugDumpData("$cmdName", \%data);
-
 
6648
    push @{$dirRef}, \%data;
-
 
6649
}
-
 
6650
 
-
 
6651
#-------------------------------------------------------------------------------
6477
# Function        : PackageFile
6652
# Function        : PackageFile
6478
#
6653
#
6479
# Description     : Directive to package files
6654
# Description     : Directive to package files
6480
#                   Not to be used to package libraries, executables, headers
6655
#                   Not to be used to package libraries, executables, headers
6481
#                   as this should be done by specialised directives
6656
#                   as this should be done by specialised directives
Line 6681... Line 6856...
6681
 
6856
 
6682
            #
6857
            #
6683
            #   Sanity test the source filename
6858
            #   Sanity test the source filename
6684
            #   User may have misused an option
6859
            #   User may have misused an option
6685
            #
6860
            #
6686
            if ( ( $srcfile =~ m/=/ ) || ( $srcfile =~ m/^-/ ) || ( $srcfile =~ m~/-~ )  )
6861
            if ( !$dir_tree && ( ( $srcfile =~ m/=/ ) || ( $srcfile =~ m/^-/ ) || ( $srcfile =~ m~/-~ ))  )
6687
            {
6862
            {
6688
               Warning ("PackageFile: Suspect source filename: $srcfile");
6863
               Warning ("PackageFile: Suspect source filename: $srcfile");
6689
            }
6864
            }
6690
 
6865
 
6691
            Debug( "PackageFile( $dir/$name, " .
6866
            Debug( "PackageFile( $dir/$name, " .
Line 8740... Line 8915...
8740
    #   Auto package the 'descpkg' file
8915
    #   Auto package the 'descpkg' file
8741
    #   If this makefile packages any files, then it can also package the descpkg file
8916
    #   If this makefile packages any files, then it can also package the descpkg file
8742
    #   The descpkg will be piggybacked into all makefiles that do a package
8917
    #   The descpkg will be piggybacked into all makefiles that do a package
8743
    #
8918
    #
8744
    if ( %PACKAGE_FILES || %PACKAGE_HDRS || %PACKAGE_CLSS || %PACKAGE_LIBS
8919
    if ( %PACKAGE_FILES || %PACKAGE_HDRS || %PACKAGE_CLSS || %PACKAGE_LIBS
8745
                        || %PACKAGE_SHLIBS || %PACKAGE_PROGS )
8920
                        || %PACKAGE_SHLIBS || %PACKAGE_PROGS || @PACKAGE_DIRS )
8746
    {
8921
    {
8747
        Src ('*', 'descpkg') unless ($SRCS{ descpkg });
8922
        Src ('*', 'descpkg') unless ($SRCS{ descpkg });
8748
        PackageFile ('*', 'descpkg');
8923
        PackageFile ('*', 'descpkg');
8749
    }
8924
    }
8750
 
8925
 
Line 8882... Line 9057...
8882
		clean unbuild clobber deploy
9057
		clean unbuild clobber deploy
8883
 
9058
 
8884
default:
9059
default:
8885
all:		install package deploy
9060
all:		install package deploy
8886
build:		make_init generate install_hdr depend make_lib \\
9061
build:		make_init generate install_hdr depend make_lib \\
8887
		install_lib make_install_shlib make_prog install_class
9062
		install_lib make_install_shlib make_prog install_class install_dirs
8888
install:	build install_prog
9063
install:	build install_prog
8889
package:	package_files package_hdr package_lib package_shlib package_prog \\
9064
package:	package_dirs package_files package_hdr package_lib package_shlib \\
8890
		package_class
9065
		package_prog package_class
8891
unpackage:	unpackage_class unpackage_prog unpackage_shlib \\
9066
unpackage:	unpackage_class unpackage_prog unpackage_shlib \\
8892
		unpackage_lib unpackage_hdr unpackage_files
9067
		unpackage_lib unpackage_hdr unpackage_files unpackage_dirs 
8893
uninstall:	uninstall_class uninstall_prog uninstall_shlib \\
9068
uninstall:	uninstall_dirs uninstall_class uninstall_prog uninstall_shlib \\
8894
		uninstall_lib uninstall_hdr
9069
		uninstall_lib uninstall_hdr
8895
clean:		make_clean unmake_prog unmake_test unmake_lib unobj \\
9070
clean:		make_clean unmake_prog unmake_test unmake_lib unobj \\
8896
		undepend ungenerate rmlitter unmake_dir
9071
		undepend ungenerate rmlitter unmake_dir
8897
unbuild:	clean uninstall
9072
unbuild:	clean uninstall
8898
clobber:	unpackage unbuild
9073
clobber:	unpackage unbuild
Line 10279... Line 10454...
10279
 
10454
 
10280
#-------------------------------------------------------------------------------
10455
#-------------------------------------------------------------------------------
10281
#   Installations
10456
#   Installations
10282
 
10457
 
10283
MakeHeader ("Installations");
10458
MakeHeader ("Installations");
10284
PackageRule ( \&InstallCmd, \%INSTALL_HDRS  );
10459
PackageRule    ( \&InstallCmd, \%INSTALL_HDRS  );
10285
PackageRule ( \&InstallCmd, \%INSTALL_CLSS  );
10460
PackageRule    ( \&InstallCmd, \%INSTALL_CLSS  );
10286
PackageRule ( \&InstallCmd, \%INSTALL_LIBS  );
10461
PackageRule    ( \&InstallCmd, \%INSTALL_LIBS  );
10287
PackageRule ( \&InstallCmd, \%INSTALL_SHLIBS  );
10462
PackageRule    ( \&InstallCmd, \%INSTALL_SHLIBS  );
10288
PackageRule ( \&InstallCmd, \%INSTALL_PROGS  );
10463
PackageRule    ( \&InstallCmd, \%INSTALL_PROGS  );
10289
 
-
 
-
 
10464
PackageDirRule ('install_dirs',    \@INSTALL_DIRS);
10290
 
10465
 
10291
#-------------------------------------------------------------------------------
10466
#-------------------------------------------------------------------------------
10292
#   Packaging
10467
#   Packaging
10293
#
10468
#
10294
MakeHeader ("Packaging");
10469
MakeHeader ("Packaging");
10295
PackageRule ( \&PackageCmd, \%PACKAGE_FILES );
10470
PackageRule    ( \&PackageCmd, \%PACKAGE_FILES );
10296
PackageRule ( \&PackageCmd, \%PACKAGE_HDRS );
10471
PackageRule    ( \&PackageCmd, \%PACKAGE_HDRS );
10297
PackageRule ( \&PackageCmd, \%PACKAGE_CLSS );
10472
PackageRule    ( \&PackageCmd, \%PACKAGE_CLSS );
10298
PackageRule ( \&PackageCmd, \%PACKAGE_LIBS );
10473
PackageRule    ( \&PackageCmd, \%PACKAGE_LIBS );
10299
PackageRule ( \&PackageCmd, \%PACKAGE_SHLIBS );
10474
PackageRule    ( \&PackageCmd, \%PACKAGE_SHLIBS );
10300
PackageRule ( \&PackageCmd, \%PACKAGE_PROGS );
10475
PackageRule    ( \&PackageCmd, \%PACKAGE_PROGS );
-
 
10476
PackageDirRule ('package_dirs', \@PACKAGE_DIRS);
10301
 
10477
 
10302
#-------------------------------------------------------------------------------
10478
#-------------------------------------------------------------------------------
10303
#   Uninstall/unpackaging
10479
#   Uninstall/unpackaging
10304
#
10480
#
10305
MakeHeader ("Uninstall/unpackaging");
10481
MakeHeader ("Uninstall/unpackaging");
10306
 
10482
 
10307
UnpackageRule( "uninstall_hdr",         \&UninstallCmd, \%INSTALL_HDRS );
10483
UnpackageRule  ( 'uninstall_hdr',         \&UninstallCmd, \%INSTALL_HDRS );
10308
UnpackageRule( "uninstall_lib",         \&UninstallCmd, \%INSTALL_LIBS );
10484
UnpackageRule  ( 'uninstall_lib',         \&UninstallCmd, \%INSTALL_LIBS );
10309
UnpackageRule( "uninstall_shlib",       \&UninstallCmd, \%INSTALL_SHLIBS );
10485
UnpackageRule  ( 'uninstall_shlib',       \&UninstallCmd, \%INSTALL_SHLIBS );
10310
UnpackageRule( "uninstall_prog",        \&UninstallCmd, \%INSTALL_PROGS );
10486
UnpackageRule  ( 'uninstall_prog',        \&UninstallCmd, \%INSTALL_PROGS );
10311
UnpackageRule( "uninstall_class",       \&UninstallCmd, \%INSTALL_CLSS );
10487
UnpackageRule  ( 'uninstall_class',       \&UninstallCmd, \%INSTALL_CLSS );
-
 
10488
PackageDirRule ( 'uninstall_dirs',        \@INSTALL_DIRS);
10312
 
10489
 
10313
UnpackageRule( "unpackage_files",       \&UnpackageCmd, \%PACKAGE_FILES );
10490
UnpackageRule  ( 'unpackage_files',       \&UnpackageCmd, \%PACKAGE_FILES );
10314
UnpackageRule( "unpackage_hdr",         \&UnpackageCmd, \%PACKAGE_HDRS );
10491
UnpackageRule  ( 'unpackage_hdr',         \&UnpackageCmd, \%PACKAGE_HDRS );
10315
UnpackageRule( "unpackage_lib",         \&UnpackageCmd, \%PACKAGE_LIBS );
10492
UnpackageRule  ( 'unpackage_lib',         \&UnpackageCmd, \%PACKAGE_LIBS );
10316
UnpackageRule( "unpackage_shlib",       \&UnpackageCmd, \%PACKAGE_SHLIBS );
10493
UnpackageRule  ( 'unpackage_shlib',       \&UnpackageCmd, \%PACKAGE_SHLIBS );
10317
UnpackageRule( "unpackage_prog",        \&UnpackageCmd, \%PACKAGE_PROGS );
10494
UnpackageRule  ( 'unpackage_prog',        \&UnpackageCmd, \%PACKAGE_PROGS );
10318
UnpackageRule( "unpackage_class",       \&UnpackageCmd, \%PACKAGE_CLSS );
10495
UnpackageRule  ( 'unpackage_class',       \&UnpackageCmd, \%PACKAGE_CLSS );
-
 
10496
PackageDirRule ( 'unpackage_dirs',        \@PACKAGE_DIRS);
10319
 
10497
 
10320
#-------------------------------------------------------------------------------
10498
#-------------------------------------------------------------------------------
10321
#   Distribution Sets
10499
#   Distribution Sets
10322
#
10500
#
10323
MakeHeader ("Distribution Sets");
10501
MakeHeader ("Distribution Sets");
Line 10369... Line 10547...
10369
    Maketag( "process_tests",       @TOOLSET_UTF_PRE || @TOOLSET_UTF_POST || @TOOLSET_UTF_COLLATE);
10547
    Maketag( "process_tests",       @TOOLSET_UTF_PRE || @TOOLSET_UTF_POST || @TOOLSET_UTF_COLLATE);
10370
    Maketag( "install_hdr",         %INSTALL_HDRS );
10548
    Maketag( "install_hdr",         %INSTALL_HDRS );
10371
    Maketag( "install_class",       %INSTALL_CLSS );
10549
    Maketag( "install_class",       %INSTALL_CLSS );
10372
    Maketag( "install_lib",         %INSTALL_LIBS );
10550
    Maketag( "install_lib",         %INSTALL_LIBS );
10373
    Maketag( "install_prog",        %INSTALL_PROGS );
10551
    Maketag( "install_prog",        %INSTALL_PROGS );
-
 
10552
    Maketag( "install_dirs",        @INSTALL_DIRS );
10374
    Maketag( "deploy",              %DEPLOYPACKAGE );
10553
    Maketag( "deploy",              %DEPLOYPACKAGE );
10375
    Maketag( "package",             %PACKAGE_FILES || %PACKAGE_HDRS || %PACKAGE_CLSS ||
10554
    Maketag( "package",             %PACKAGE_FILES || %PACKAGE_HDRS || %PACKAGE_CLSS ||
10376
                                    %PACKAGE_LIBS || %PACKAGE_SHLIBS || %PACKAGE_PROGS );
10555
                                    %PACKAGE_LIBS || %PACKAGE_SHLIBS || %PACKAGE_PROGS );
10377
 
10556
 
10378
    #
10557
    #
Line 10782... Line 10961...
10782
        }
10961
        }
10783
    }
10962
    }
10784
}
10963
}
10785
 
10964
 
10786
#-------------------------------------------------------------------------------
10965
#-------------------------------------------------------------------------------
-
 
10966
# Function        : PackageDirRule 
-
 
10967
#
-
 
10968
# Description     : Generate special rules for dynamic packaging/installation of directories 
-
 
10969
#
-
 
10970
# Inputs          : $mode        - package_dirs/unpackage_dirs/install_dirs/uninstall_dirs
-
 
10971
#                   $dataRef     - Ref to package/install list
-
 
10972
#                       
-
 
10973
#
-
 
10974
# Returns         : 
-
 
10975
#
-
 
10976
sub PackageDirRule
-
 
10977
{
-
 
10978
    my ($mode, $dataRef) = @_;
-
 
10979
    my $me = MakeEntry::New( *MAKEFILE, $mode , '--Phony' );
-
 
10980
 
-
 
10981
    my $modeText = 'packaging';
-
 
10982
    my $cmdText = 'PackageDir';
-
 
10983
    if ($mode =~ m~install~) {
-
 
10984
        $modeText = 'installing';
-
 
10985
        $cmdText = 'InstallDir';
-
 
10986
    }
-
 
10987
    my $cmd = 'copyDir'; 
-
 
10988
    if ($mode =~ m~^un~) {
-
 
10989
        $cmd = 'unCopyDir';
-
 
10990
        $modeText = 'un' . $modeText;
-
 
10991
        $cmdText = 'Un' . $cmdText;
-
 
10992
    }
-
 
10993
 
-
 
10994
 
-
 
10995
    foreach my $entry ( @{$dataRef}) {
-
 
10996
        $me->NewSection();
-
 
10997
 
-
 
10998
        #
-
 
10999
        #   Conditional installation for DEBUG/PRODUCTION
-
 
11000
        #
-
 
11001
        my $type = $entry->{'type'};
-
 
11002
        if ( $type )
-
 
11003
        {
-
 
11004
           if ( $type eq "D" ) {
-
 
11005
               $me->SectionIfNeq('$(DEBUG)','0');
-
 
11006
           } elsif ( $type eq "P" ) {
-
 
11007
               $me->SectionIfEq('$(DEBUG)','0');
-
 
11008
           } else {
-
 
11009
               Error("INTERNAL: Unexpected packaging type: $type");
-
 
11010
           }
-
 
11011
        }
-
 
11012
 
-
 
11013
        #
-
 
11014
        #   Quote the REs so that they can be passed to a command line
-
 
11015
        #       Replace $ with $$
-
 
11016
        #
-
 
11017
        my $QuoteRe = sub {
-
 
11018
            my ($arg) = @_;
-
 
11019
            $arg=~ s~\$~\$\$~g;
-
 
11020
            return $arg;
-
 
11021
            };
-
 
11022
 
-
 
11023
        #
-
 
11024
        #   The body of the copy
-
 
11025
        #   Create a command line for run-time command
-
 
11026
        #   
-
 
11027
        my @cmd;
-
 
11028
        push @cmd, '$(JatsRunTime)', $cmd, '--', '-$(VERBOSE_OPT)', '--Name='. $cmdText, '--';
-
 
11029
        push @cmd, '-mode=' . $modeText;
-
 
11030
        push @cmd, "'" . '-src=' . $entry->{dirTree} . "'";
-
 
11031
        push @cmd, "'" . '-dst=' . $entry->{dir} . "'";
-
 
11032
        push (@cmd, '-execute' ) if $entry->{exefile};
-
 
11033
        push (@cmd, '-noSymlink' ) if $entry->{noPreserveSymlink};
-
 
11034
        push (@cmd, '-noRecurse' ) if $entry->{noRecurse};
-
 
11035
        push (@cmd, '-stripBase' ) if $entry->{strip_base};
-
 
11036
        push (@cmd, "'" . '-exclude+=' . $QuoteRe->($_) . "'" ) foreach @{$entry->{exclude}};
-
 
11037
        push (@cmd, "'" . '-include+=' . $QuoteRe->($_) . "'" ) foreach @{$entry->{include}};
-
 
11038
        push (@cmd, "'" . '-excludeRe+=' . $QuoteRe->($_) . "'" ) foreach @{$entry->{excludeRe}};
-
 
11039
        push (@cmd, "'" . '-includeRe+=' . $QuoteRe->($_) . "'" ) foreach @{$entry->{includeRe}};
-
 
11040
 
-
 
11041
        $me->AddRecipe(join(' ', @cmd ) );
-
 
11042
    }
-
 
11043
    $me->Print();
-
 
11044
}
-
 
11045
 
-
 
11046
#-------------------------------------------------------------------------------
10787
# Function        : PackageSetRules
11047
# Function        : PackageSetRules
10788
#
11048
#
10789
# Description     : Generate the packageset rules
11049
# Description     : Generate the packageset rules
10790
#                   These appear to be a now-defuct feature
11050
#                   These appear to be a now-defuct feature
10791
#
11051
#