Subversion Repositories DevTools

Rev

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

Rev 285 Rev 289
Line 38... Line 38...
38
#  @{G|L}_LIBDIRS       List containing all of library search paths
38
#  @{G|L}_LIBDIRS       List containing all of library search paths
39
#  @LDFLAGS             List containing all of the defined linker flags
39
#  @LDFLAGS             List containing all of the defined linker flags
40
#  @SRCS                List of ALL source files. ie. C/C++ and other (eg .x)
40
#  @SRCS                List of ALL source files. ie. C/C++ and other (eg .x)
41
#                       Key is source file, value is source path
41
#                       Key is source file, value is source path
42
#  @OBJS                List of ALL (non-shared) object files.
42
#  @OBJS                List of ALL (non-shared) object files.
43
#  %SHOBJ_LIB           List of ALL shared library object files and there
43
#  %SHOBJ_LIB           List of ALL shared library object files and associated library.
44
#                       associated library.
-
 
45
#  %OBJSOURCE           List of ALL object files
44
#  %OBJSOURCE           List of ALL object files
46
#                       from that should result from later makes.
45
#                       from that should result from later makes.
47
#                       Key is objectfile, value is source file
46
#                       Key is objectfile, value is source file
48
#  %OBJREFS             List of ALL object files, built options.
47
#  %OBJREFS             List of ALL object files, built options.
49
#  @PROGOBJS            List of ALL application object files.
48
#  @PROGOBJS            List of ALL application object files.
Line 66... Line 65...
66
#  %INSTALL_HDRS        List of headers that are to be installed for later
65
#  %INSTALL_HDRS        List of headers that are to be installed for later
67
#                       "public" consumption.
66
#                       "public" consumption.
68
#  %INSTALL_CLSS        List of Java classes or JAR files that are to be installed
67
#  %INSTALL_CLSS        List of Java classes or JAR files that are to be installed
69
#                       for later "public" consumption.
68
#                       for later "public" consumption.
70
#  @LIBS                List of libraries that are to be built.
69
#  @LIBS                List of libraries that are to be built.
71
#  %LIB_OBJS            List of objects that are to be combined to build the
-
 
72
#                       nominated library.  Key is the library name, the
-
 
73
#                       value is a string of object files to go into
-
 
74
#                       the library.  The object files are '$;' separated.
-
 
75
#  %LIB_ARGS            List of arguments that are to be used when making
-
 
76
#                       the nominated library.  Key is the library name, the
70
#  $LIBS                Ref to a collection of static library descriptors
77
#                       value is a string of arguments to apply.  The
-
 
78
#                       arguments are '$;' separated.
71
#                       Indexed by lib name
79
#  %INSTALL_LIBS        List of libraries that are to be installed for later
72
#  %INSTALL_LIBS        List of libraries that are to be installed for later
80
#                       public consumption.
73
#                       public consumption.
81
#  @MLIBS               List of libraries that are to be built via merging
74
#  @MLIBS               List of libraries that are to be built via merging
82
#  %MLIB_LIBS           List of objects that are to be combined to build the
-
 
83
#                       nominated library.  Key is the library name, the
-
 
84
#                       value is a string of library files to go into
75
#  $MLIBS               Ref to a collection of merged lib descriptors
85
#                       the library.  The object files are '$;' separated.
-
 
86
#  @SHLIBS              List of shared libraries that are to be built.
76
#  @SHLIBS              List of shared libraries that are to be built.
87
#  %SHLIB_OBJS          List of objects that are to be combined to build the
-
 
88
#                       nominated library.  Key is the library name, the
-
 
89
#                       value is a string of object files to go into
-
 
90
#                       the library.  The object files are '$;' separated.
-
 
91
#  %SHLIB_ARGS          List of arguments that are to be used when making
-
 
92
#                       the nominated library.  Key is the library name, the
77
#  $SHLIBS              Ref to collection of shared library information
93
#                       value is a string of arguments to apply.  The
-
 
94
#                       arguments are '$;' separated.
-
 
95
#  %INSTALL_SHLIBS      List of libraries that are to be installed for later
78
#  %INSTALL_SHLIBS      List of libraries that are to be installed for later
96
#                       public consumption.
79
#                       public consumption.
97
#  @PROGS               List of programs (binary executables) that are
80
#  @PROGS               List of programs (binary executables) that are
98
#                       to be built
81
#                       to be built
99
#  %PROG_OBJS           List of objects that are to be combined to build the
-
 
100
#                       nominated program.  Key is the program name, the
82
#  $PROGS               Ref to collection of program information
101
#                       value is a string of object files to go into
-
 
102
#                       the program.  The object files are '$;' separated.
-
 
103
#  %PROG_LIBS           List of libraries that are to be combined to
-
 
104
#                       build the nominated program.  Key is the program
-
 
105
#                       name, the value is a string of library files to
-
 
106
#                       go into the program.  The library files are '$;'
-
 
107
#                       separated.
-
 
108
#  %PROG_ARGS           List of arguments that are to be used when making the
-
 
109
#                       nominated program.  Key is the program name, the
-
 
110
#                       value is a string of arguments to apply.  The
-
 
111
#                       arguments are '$;' separated.
-
 
112
#  %SCRIPTS             List of scripts to 'create' (key) and whether they
83
#  %SCRIPTS             List of scripts to 'create' (key) and whether they
113
#                       should be made executable or not (value).  Script
84
#                       should be made executable or not (value).  Script
114
#                       set to executable is denoted by the value being
85
#                       set to executable is denoted by the value being
115
#                       defined AND true.
86
#                       defined AND true.
116
#  %INSTALL_PROGS       List of programs for "public" cosumption to install
87
#  %INSTALL_PROGS       List of programs for "public" cosumption to install
Line 131... Line 102...
131
use JatsEnv;
102
use JatsEnv;
132
use MakeEntry;
103
use MakeEntry;
133
use JatsLocateFiles;
104
use JatsLocateFiles;
134
use JatsDPackage;
105
use JatsDPackage;
135
use MakeIf;
106
use MakeIf;
-
 
107
use ToolsetPrinter;
136
 
108
use MakeObject;
137
 
109
 
138
 
110
 
139
our $ScmVersion             = "2.34";
111
our $ScmVersion             = "2.34";
140
our $ScmGlobal              = 0;
112
our $ScmGlobal              = 0;
141
our $ScmExpert              = 0;
113
our $ScmExpert              = 0;
Line 146... Line 118...
146
 
118
 
147
our $ScmToolsetVersion      = "";               # version of toolset
119
our $ScmToolsetVersion      = "";               # version of toolset
148
our $ScmToolsetGenerate     = 1;                # generate active by default.
120
our $ScmToolsetGenerate     = 1;                # generate active by default.
149
our $ScmToolsetProgDependancies = 1;            # 1: Write program dependancies
121
our $ScmToolsetProgDependancies = 1;            # 1: Write program dependancies
150
                                                # 0: Don't write progdeps. Prog is Phony
122
                                                # 0: Don't write progdeps. Prog is Phony
-
 
123
our $ScmToolsetSingleType   = 0;                # Toolset does not support Debug and Production
151
our $ScmToolsetProgSource   = ();               # Toolset Program Source
124
our $ScmToolsetProgSource   = ();               # Toolset Program Source
152
our $ScmRoot                = "";
125
our $ScmRoot                = "";
153
our $ScmMakelib             = "";
126
our $ScmMakelib             = "";
154
our $ScmPlatform            = "";
127
our $ScmPlatform            = "";
155
our $ScmMachType            = "";
128
our $ScmMachType            = "";
156
our $ScmSrcDir              = "";
129
our $ScmSrcDir              = "";
157
our @ScmPlatformDirs        = ();
130
our @ScmPlatformDirs        = ();
158
our @ScmPlatformArgs        = ();
131
our @ScmPlatformArgs        = ();
-
 
132
our $ScmBuildType           = 0;                # 0, P, D. 0 == P and D
159
our $ScmProduct             = "";
133
our $ScmProduct             = "";
160
our $ScmTarget              = "";
134
our $ScmTarget              = "";
161
our $ScmTargetHost          = "";
135
our $ScmTargetHost          = "";
162
our $ScmToolset             = "";
136
our $ScmToolset             = "";
163
our @ScmToolsetArgs         = ();
137
our @ScmToolsetArgs         = ();
Line 210... Line 184...
210
our @INITS                  = ();
184
our @INITS                  = ();
211
our @DEFINES                = ();
185
our @DEFINES                = ();
212
our @OBJS                   = ();
186
our @OBJS                   = ();
213
our %SHOBJ_LIB              = ();
187
our %SHOBJ_LIB              = ();
214
our @PROGOBJS               = ();
188
our @PROGOBJS               = ();
-
 
189
our @TESTPROGOBJS           = ();
215
our %OBJSOURCE              = ();
190
our %OBJSOURCE              = ();
216
our @CHDRS                  = ();
191
our @CHDRS                  = ();
217
our @CSRCS                  = ();
192
our @CSRCS                  = ();
218
our @CXXSRCS                = ();
193
our @CXXSRCS                = ();
219
our @ASHDRS                 = ();
194
our @ASHDRS                 = ();
Line 231... Line 206...
231
our @TOOLSETPROGS           = ();
206
our @TOOLSETPROGS           = ();
232
our %INSTALL_HDRS           = ();
207
our %INSTALL_HDRS           = ();
233
our %INSTALL_CLSS           = ();
208
our %INSTALL_CLSS           = ();
234
 
209
 
235
our @LIBS                   = ();
210
our @LIBS                   = ();
236
our %LIB_OBJS               = ();
-
 
237
our %LIB_ARGS               = ();
211
our $LIBS                   = ();
238
our %LIB_PKG                = ();
212
our %LIB_PKG                = ();
239
our %LIB_INS                = ();
213
our %LIB_INS                = ();
240
our %INSTALL_LIBS           = ();
214
our %INSTALL_LIBS           = ();
241
 
215
 
242
our @MLIBS                  = ();
216
our @MLIBS                  = ();
243
our %MLIB_LIBS              = ();
-
 
244
our %MLIB_ARGS              = ();
217
our $MLIBS                  = ();
245
 
218
 
246
our @SHLIBS                 = ();
219
our @SHLIBS                 = ();
-
 
220
our $SHLIBS                 = ();
247
our @SHLIB_TARGETS          = ();
221
our @SHLIB_TARGETS          = ();
248
our %SHLIB_VER              = ();
-
 
249
our %SHLIB_OBJS             = ();
-
 
250
our %SHLIB_LIBS             = ();
-
 
251
our %SHLIB_ARGS             = ();
-
 
252
our %SHLIB_PKG              = ();
222
our %SHLIB_PKG              = ();
253
our %SHLIB_INS              = ();
223
our %SHLIB_INS              = ();
254
our %INSTALL_SHLIBS         = ();
224
our %INSTALL_SHLIBS         = ();
255
 
225
 
256
our %TESTPROGS              = ();
226
our $TESTPROGS              = ();
257
our %TESTPROG_OBJS          = ();
-
 
258
our %TESTPROG_LIBS          = ();
-
 
259
our %TESTPROG_ARGS          = ();
227
our @TESTPROGS              = ();
260
 
228
 
261
our %PROGS                  = ();           # Simplify tracking of progs
229
our $PROGS                  = ();           # Simplify tracking of progs
262
our @PROGS                  = ();
230
our @PROGS                  = ();
263
our @PROGS_EXTRA            = ();
231
our @PROGS_EXTRA            = ();           # Look at doing better !!
264
our %PROG_OBJS              = ();
-
 
265
our %PROG_LIBS              = ();
-
 
266
our %PROG_ARGS              = ();
-
 
267
our %PROG_PKG               = ();
232
our %PROG_PKG               = ();
268
our %PROG_INS               = ();
233
our %PROG_INS               = ();
269
our %INSTALL_PROGS          = ();
234
our %INSTALL_PROGS          = ();
270
 
235
 
271
our %PACKAGE_DIST           = ();
236
our %PACKAGE_DIST           = ();
Line 457... Line 422...
457
                   "Pbase    : $::Pbase",
422
                   "Pbase    : $::Pbase",
458
                   "BuildName: $::ScmBuildPackage")
423
                   "BuildName: $::ScmBuildPackage")
459
                if ( $::Pbase ne $::ScmBuildPackage );
424
                if ( $::Pbase ne $::ScmBuildPackage );
460
        }
425
        }
461
    }
426
    }
-
 
427
 
-
 
428
    #
-
 
429
    #   Create objects to keep track of Libraies and Programs
-
 
430
    #
-
 
431
    $LIBS       = MakeObject::NewType( 'Library',       \@LIBS,     '$(LIBDIR)/', \&GenLibName);
-
 
432
    $MLIBS      = MakeObject::NewType( 'MergedLibrary', \@MLIBS,    '$(LIBDIR)/', \&GenLibName);
-
 
433
    $SHLIBS     = MakeObject::NewType( 'SharedLibrary', \@SHLIBS,   '$(LIBDIR)/', \&GenLibName);
-
 
434
    $PROGS      = MakeObject::NewType( 'Program',       \@PROGS,    '$(BINDIR)/', \&GenProgName);
-
 
435
    $TESTPROGS  = MakeObject::NewType( 'TestProgram',   \@TESTPROGS,'$(BINDIR)/', \&GenProgName);
-
 
436
}
-
 
437
 
-
 
438
#-------------------------------------------------------------------------------
-
 
439
# Function        : GenLibName
-
 
440
#
-
 
441
# Description     : Helper function to generate a (static) library name
-
 
442
#                   Used by MakeObject::NewType
-
 
443
#
-
 
444
#                   If the toolset doesn't support Debug and Prod, then
-
 
445
#                   The library name will not have the suffix
-
 
446
#
-
 
447
# Inputs          : arg0        - Base name of the library
-
 
448
#
-
 
449
# Returns         : Name of the library as used in the makefiles
-
 
450
#                   Does not include base directory
-
 
451
#
-
 
452
sub GenLibName
-
 
453
{
-
 
454
    if ( $ScmToolsetSingleType ) {
-
 
455
        return "$_[0].$::a"
-
 
456
    } else {
-
 
457
        return "$_[0]\$(GBE_TYPE).$::a"
-
 
458
    }
462
}
459
}
463
 
460
 
464
#-------------------------------------------------------------------------------
461
#-------------------------------------------------------------------------------
-
 
462
# Function        : GenProgName
-
 
463
#
-
 
464
# Description     : Helper function to generate a program name
-
 
465
#                   Used by MakeObject::NewType
-
 
466
#
-
 
467
# Inputs          : arg0        - Base name of the library
-
 
468
#
-
 
469
# Returns         : Name of the program as used in the makefiles
-
 
470
#                   Does not include base directory
-
 
471
#
-
 
472
sub GenProgName
-
 
473
{
-
 
474
    return "$_[0]$::exe"
-
 
475
}
-
 
476
 
-
 
477
 
-
 
478
#-------------------------------------------------------------------------------
465
# Function        : CommandLine
479
# Function        : CommandLine
466
#
480
#
467
# Description     : Process the command line.
481
# Description     : Process the command line.
468
#                   Arguments describes below
482
#                   Arguments describes below
469
#
483
#
Line 617... Line 631...
617
    Error( "Toolset undefined for platform $ScmPlatform ...")
631
    Error( "Toolset undefined for platform $ScmPlatform ...")
618
        unless( $ScmToolset );
632
        unless( $ScmToolset );
619
 
633
 
620
#.. Toolset
634
#.. Toolset
621
#
635
#
622
    $file = Require( "$::GBE_TOOLS/LIB", "ToolsetPrinter.pm", "Toolset common components " );
-
 
623
    push( @ScmDepends, "$file" );
-
 
624
 
-
 
625
    $file = Require( "$::GBE_CONFIG/TOOLSET", $ScmToolset, "Toolset definition " );
636
    $file = Require( "$::GBE_CONFIG/TOOLSET", $ScmToolset, "Toolset definition " );
626
    push( @ScmDepends, "$file" );
637
    push( @ScmDepends, "$file" );
627
 
638
 
628
#.. Package definitions
639
#.. Package definitions
629
#
640
#
Line 704... Line 715...
704
        $ScmProcessingRootMake = 0;
715
        $ScmProcessingRootMake = 0;
705
        push( @ScmDepends, "$file" );
716
        push( @ScmDepends, "$file" );
706
    }
717
    }
707
 
718
 
708
    #
719
    #
-
 
720
    #   Sanity Test for platforms that do not support both debug and production
-
 
721
    #   builds at the same time. This information is flagged by the toolset
-
 
722
    #   which we have now loaded.
-
 
723
    #
-
 
724
    if ( $ScmToolsetSingleType  )
-
 
725
    {
-
 
726
        unless ( $ScmBuildType )
-
 
727
        {
-
 
728
            Error ("The toolset used by the \"$ScmPlatform\" platform does not support",
-
 
729
                   "both Production and Debug Builds" );
-
 
730
        }
-
 
731
    }
-
 
732
 
-
 
733
    #
709
    #   Restore global status ...
734
    #   Restore global status ...
710
    #
735
    #
711
    $ScmGlobal = $global;
736
    $ScmGlobal = $global;
712
}
737
}
713
 
738
 
Line 788... Line 813...
788
#
813
#
789
#   Add arguments to the ScmPlatformArgs, but remove "Global" arguments
814
#   Add arguments to the ScmPlatformArgs, but remove "Global" arguments
790
#       --OnlyDebug
815
#       --OnlyDebug
791
#       --OnlyProduction
816
#       --OnlyProduction
792
#
817
#
-
 
818
#   Capture OnlyDebug and OnlyProd information
-
 
819
#   Will be sanitized by caller.
-
 
820
#
793
sub AddPlatformArg
821
sub AddPlatformArg
794
{
822
{
795
    Debug("AddPlatformArg: @_" );
823
    Debug("AddPlatformArg: @_" );
-
 
824
    foreach  ( @_ )
796
 
825
    {
797
    my @args = grep ( !/^--Only((Debug)|(Prod))/, @_ );
826
        if ( m~^--OnlyDebug~ ) {
-
 
827
            $ScmBuildType = 'D';
-
 
828
        } elsif ( m~--OnlyProd~ ) {
-
 
829
            $ScmBuildType = 'P';
-
 
830
        } else {
798
    UniquePush( \@::ScmPlatformArgs, @args );
831
            UniquePush( \@::ScmPlatformArgs, @_ );
-
 
832
        }
-
 
833
    }
799
 
834
 
800
    Debug("AddPlatformArg: Result: @::ScmPlatformArgs" );
835
    Debug("AddPlatformArg: Result: @::ScmPlatformArgs" );
801
    1;
836
    1;
802
}
837
}
803
 
838
 
Line 921... Line 956...
921
{
956
{
922
    Debug2( "ToolsetLib(@_)" );
957
    Debug2( "ToolsetLib(@_)" );
923
 
958
 
924
    foreach my $lib ( @_ )
959
    foreach my $lib ( @_ )
925
    {
960
    {
926
        UniquePush( \@TOOLSETLIBS, "$lib.$::a" );
961
        UniquePush( \@TOOLSETLIBS, GenLibName( $lib ) );
927
    }
962
    }
928
}
963
}
929
 
964
 
930
 
965
 
931
sub ToolsetProg
966
sub ToolsetProg
932
{
967
{
933
    Debug2( "ToolsetProg(@_)" );
968
    Debug2( "ToolsetProg(@_)" );
934
 
969
 
935
    foreach my $prog ( @_ )
970
    foreach my $prog ( @_ )
936
    {
971
    {
937
        UniquePush( \@TOOLSETPROGS, "$prog$::exe" );
972
        UniquePush( \@TOOLSETPROGS, GenProgName( $prog ) );
938
    }
973
    }
939
}
974
}
940
 
975
 
941
 
976
 
942
sub ToolsetRule
977
sub ToolsetRule
Line 1088... Line 1123...
1088
#       (binary) is to be made, what libraries and object it is
1123
#       (binary) is to be made, what libraries and object it is
1089
#       made from, and any special commands required to perform
1124
#       made from, and any special commands required to perform
1090
#       the program creation.
1125
#       the program creation.
1091
#
1126
#
1092
#       @PROGS          Updated list of programs to create
1127
#       @PROGS          Updated list of programs to create
1093
#       %PROG_OBJS      Updated list of [library-name (key) vs. objects]
-
 
1094
#                       used to generate this program
-
 
1095
#       %PROG_LIBS      Updated list of [library-name (key) vs. libraries]
-
 
1096
#                       used to generate this program
-
 
1097
#       %PROG_PARGS     Updated list of [library-name (key) vs. options]
-
 
1098
#                       used to generate this program
-
 
1099
#
1128
#
1100
#   TestProg( 'platform [, ... ]', 'name', ['obj', ... ],
1129
#   TestProg( 'platform [, ... ]', 'name', ['obj', ... ],
1101
#               ['-llib', ... ], ['options'] )
1130
#               ['-llib', ... ], ['options'] )
1102
#       This subroutine takes a list that defines which test program
1131
#       This subroutine takes a list that defines which test program
1103
#       (binary) is to be made, what libraries and object it is
1132
#       (binary) is to be made, what libraries and object it is
1104
#       made from, and any special commands required to perform
1133
#       made from, and any special commands required to perform
1105
#       the program creation.
1134
#       the program creation.
1106
#
1135
#
1107
#       @TESTPROGS      Updated list of programs to create
1136
#       @TESTPROGS      Updated list of programs to create
1108
#       %TESTPROG_OBJS  Updated list of [library-name (key) vs. objects]
-
 
1109
#                       used to generate this program
-
 
1110
#       %TESTPROG_LIBS  Updated list of [library-name (key) vs. libraries]
-
 
1111
#                       used to generate this program
-
 
1112
#       %TESTPROG_PARGS Updated list of [library-name (key) vs. options]
-
 
1113
#                       used to generate this program
-
 
1114
#
1137
#
1115
#   InstallHdr( 'platform [, ... ]', 'file' [, ...], ['-arg'] )
1138
#   InstallHdr( 'platform [, ... ]', 'file' [, ...], ['-arg'] )
1116
#       This subroutine takes the given list of files and adds them
1139
#       This subroutine takes the given list of files and adds them
1117
#       to the install header files list.  Files in this list will be
1140
#       to the install header files list.  Files in this list will be
1118
#       installed into the 'local header directory' area for public
1141
#       installed into the 'local header directory' area for public
Line 1634... Line 1657...
1634
 
1657
 
1635
    return if ( ! ActivePlatform($platforms) );
1658
    return if ( ! ActivePlatform($platforms) );
1636
 
1659
 
1637
    foreach my $prog (@progs)
1660
    foreach my $prog (@progs)
1638
    {
1661
    {
-
 
1662
        my $pProg = $PROGS->Get($prog);
1639
        Warning( "Duplicate prog ignored '$prog'" )
1663
        Warning( "Duplicate prog ignored '$prog'" )
1640
            unless ( UniquePush(\@PROGS, $prog) );
1664
            if ( $pProg );
1641
        $PROGS{$prog} = 1;
1665
        $pProg = $PROGS->NewAdd($prog)
1642
    }
1666
    }
1643
}
1667
}
1644
 
1668
 
1645
 
1669
 
1646
sub AddSourceType
1670
sub AddSourceType
Line 2626... Line 2650...
2626
    } elsif ( $tool =~ /^--Prog=(.*)$/ ) {
2650
    } elsif ( $tool =~ /^--Prog=(.*)$/ ) {
2627
        #
2651
        #
2628
        #   Using a program that has been created within this script
2652
        #   Using a program that has been created within this script
2629
        #
2653
        #
2630
        my $prog = $1;
2654
        my $prog = $1;
2631
        if ( exists $PROGS{$prog} )
2655
        if ( my $pProg = $PROGS->Get($prog) )
2632
        {
2656
        {
2633
            $tool = "\$(BINDIR)/$prog$::exe"
2657
            $tool = $pProg->getPath()
2634
                unless ( $tool = $SRCS{$prog} );
2658
                unless ( $tool = $SRCS{$prog} );
2635
        UniquePush (\@preq_files, $tool);
2659
        UniquePush (\@preq_files, $tool);
2636
        }
2660
        }
2637
        else
2661
        else
2638
        {
2662
        {
Line 3551... Line 3575...
3551
    }
3575
    }
3552
    
3576
    
3553
    #
3577
    #
3554
    #   Try a PROG
3578
    #   Try a PROG
3555
    #
3579
    #
3556
    if ( exists $PROGS{$name} )
3580
    if ( my $pProg = $PROGS->Get($name) )
3557
    {
3581
    {
3558
        return "\$(BINDIR)/$name$::exe"
3582
        return $pProg->getPath();
3559
    }
3583
    }
3560
 
3584
 
3561
    #
3585
    #
3562
    #   Try searching for the file
3586
    #   Try searching for the file
3563
    #   Uses Data from AddSrcDir
3587
    #   Uses Data from AddSrcDir
Line 3929... Line 3953...
3929
    $lib = "lib$lib"
3953
    $lib = "lib$lib"
3930
       if ( $ScmTargetHost eq "Unix" && $lib !~ m/^lib/);
3954
       if ( $ScmTargetHost eq "Unix" && $lib !~ m/^lib/);
3931
    Debug( "Lib: $lib" );
3955
    Debug( "Lib: $lib" );
3932
 
3956
 
3933
    #
3957
    #
-
 
3958
    #   Create a new object to describe the library
3934
    #   Ensure that only one such lib exists
3959
    #   Ensure that only one such lib exists
-
 
3960
    #   Add the library to the list of static libraries
3935
    #
3961
    #
3936
    Error( "Library of the same name already defined: $lib" )
3962
    Error( "Library of the same name already defined: $lib" )
3937
        if ( grep /^$lib$/, @LIBS );
3963
        if ( $LIBS->Get($lib) );
-
 
3964
    $LIBS->NewAdd($lib);
3938
 
3965
 
3939
    #
3966
    #
3940
    #   Add the library to the list of static libraries
-
 
3941
    #   Process arguments
3967
    #   Process arguments
3942
    #
3968
    #
3943
    push( @LIBS, $lib );
-
 
3944
    push( @LINTLIBS, $lib );
3969
    push( @LINTLIBS, $lib );
3945
    _LibArgs( $lib, @args );
3970
    _LibArgs( $lib, @args );
3946
}
3971
}
3947
 
3972
 
3948
 
3973
 
Line 3972... Line 3997...
3972
    Debug( "ShLib: $lib" );
3997
    Debug( "ShLib: $lib" );
3973
 
3998
 
3974
    #
3999
    #
3975
    #   Ensure that only one such lib exists
4000
    #   Ensure that only one such lib exists
3976
    #
4001
    #
3977
    Error("Library of the same name already defined: $lib")
4002
    Error( "Library of the same name already defined: $lib" )
3978
        if ( grep /^$lib$/, @SHLIBS );
4003
        if ( $SHLIBS->Get($lib) );
-
 
4004
    $SHLIBS->NewAdd($lib);
3979
 
4005
    
3980
    #
4006
    #
3981
    #   If the user has not specified a --Shared parameter then provide one
4007
    #   If the user has not specified a --Shared parameter then provide one
3982
    #
4008
    #
3983
    push @args, "--Shared=Current"
4009
    push @args, "--Shared=Current"
3984
        unless ( grep (/^--Shared/, @args) );
4010
        unless ( grep (/^--Shared/, @args) );
3985
 
4011
 
3986
    #
4012
    #
3987
    #   Add the library to the list of shared libraries
-
 
3988
    #   Process arguments
4013
    #   Process arguments
3989
    #
4014
    #
3990
    push( @SHLIBS, $lib );
-
 
3991
    push( @LINTSHLIBS, $lib );
4015
    push( @LINTSHLIBS, $lib );
3992
    _SharedLibArgs( $lib, @args );
4016
    _SharedLibArgs( $lib, @args );
3993
}
4017
}
3994
 
4018
 
3995
 
4019
 
Line 4013... Line 4037...
4013
    $lib = "lib$lib"
4037
    $lib = "lib$lib"
4014
       if ( $ScmTargetHost eq "Unix" && $lib !~ m/^lib/);
4038
       if ( $ScmTargetHost eq "Unix" && $lib !~ m/^lib/);
4015
    Debug( "LibArgs: $lib" );
4039
    Debug( "LibArgs: $lib" );
4016
 
4040
 
4017
    #
4041
    #
4018
    #   Ensure that only one such lib exists
-
 
4019
    #
-
 
4020
    Error("Library name not defined: $lib")
-
 
4021
        unless ( grep /^$lib$/, @LIBS );
-
 
4022
 
-
 
4023
    #
-
 
4024
    #   Process the arguments
4042
    #   Process the arguments
4025
    #
4043
    #
4026
    _LibArgs( $lib, @args );
4044
    _LibArgs( $lib, @args );
4027
}
4045
}
4028
 
4046
 
Line 4040... Line 4058...
4040
{
4058
{
4041
    my( $lib, @elements) = @_;
4059
    my( $lib, @elements) = @_;
4042
    my $obj;
4060
    my $obj;
4043
 
4061
 
4044
    #
4062
    #
-
 
4063
    #   Ensure that only one such lib exists
-
 
4064
    #
-
 
4065
    my $libp = $LIBS->Get($lib);
-
 
4066
    Error("Library name not defined: $lib")
-
 
4067
        unless ( $libp );
-
 
4068
 
-
 
4069
    #
4045
    #   Process each element
4070
    #   Process each element
4046
    #
4071
    #
4047
    foreach (@elements)
4072
    foreach (@elements)
4048
    {
4073
    {
4049
        if ( /^--Shared/ )
4074
        if ( /^--Shared/ )
Line 4069... Line 4094...
4069
        {
4094
        {
4070
            Debug( "LibArgs: arg $_" );
4095
            Debug( "LibArgs: arg $_" );
4071
 
4096
 
4072
            #.. Argument specified - add to argument list
4097
            #.. Argument specified - add to argument list
4073
            #
4098
            #
4074
            HashJoin( \%LIB_ARGS, $;, $lib, "$_" );
4099
            $libp->addItem('ARGS', $_);
-
 
4100
            
4075
            next;
4101
            next;
4076
        }
4102
        }
4077
 
4103
 
4078
        if ( defined %::ScmToolsetProgSource )
4104
        if ( defined %::ScmToolsetProgSource )
4079
        {
4105
        {
Line 4085... Line 4111...
4085
            if ( exists ($::ScmToolsetProgSource{$ext}) )
4111
            if ( exists ($::ScmToolsetProgSource{$ext}) )
4086
            {
4112
            {
4087
                my $full_path = MakeSrcResolve ( $_ );
4113
                my $full_path = MakeSrcResolve ( $_ );
4088
                my $flag = $::ScmToolsetProgSource{$ext};
4114
                my $flag = $::ScmToolsetProgSource{$ext};
4089
                Debug( "LibArgs: src $_" );
4115
                Debug( "LibArgs: src $_" );
4090
                HashJoin( \%LIB_ARGS, $;, $lib, "$flag$full_path" );
4116
                $libp->addItem('ARGS', "$flag$full_path" );
4091
                next;
4117
                next;
4092
            }
4118
            }
4093
        }
4119
        }
4094
 
4120
 
4095
        if ( $::o )
4121
        if ( $::o )
Line 4100... Line 4126...
4100
 
4126
 
4101
        #.. Add to object list.
4127
        #.. Add to object list.
4102
        #   Note:   Object path must be explicit as several
4128
        #   Note:   Object path must be explicit as several
4103
        #           toolsets add additional objects.
4129
        #           toolsets add additional objects.
4104
        #
4130
        #
4105
            HashJoin( \%LIB_OBJS, $;, $lib, "\$(OBJDIR)/$obj" );
4131
            $libp->addItem('OBJS', "\$(OBJDIR)/$obj" );
4106
            next;
4132
            next;
4107
        }
4133
        }
4108
 
4134
 
4109
        #
4135
        #
4110
        #   Don't know how to handle this type of argument
4136
        #   Don't know how to handle this type of argument
Line 4133... Line 4159...
4133
#.. Fully qualify library path for addition to library list.
4159
#.. Fully qualify library path for addition to library list.
4134
    $lib = "lib$lib"
4160
    $lib = "lib$lib"
4135
       if ( $ScmTargetHost eq "Unix" && $lib !~ m/^lib/);
4161
       if ( $ScmTargetHost eq "Unix" && $lib !~ m/^lib/);
4136
    Debug( "ShLibArgs: $lib" );
4162
    Debug( "ShLibArgs: $lib" );
4137
 
4163
 
4138
    #
-
 
4139
    #   Ensure that only one such lib exists
-
 
4140
    #
-
 
4141
    Error ("Library name not defined: $lib\n")
-
 
4142
        unless ( grep /^$lib$/, @SHLIBS );
-
 
4143
 
-
 
4144
    _SharedLibArgs( $lib, @args );
4164
    _SharedLibArgs( $lib, @args );
4145
}
4165
}
4146
 
4166
 
4147
 
4167
 
4148
#-------------------------------------------------------------------------------
4168
#-------------------------------------------------------------------------------
Line 4155... Line 4175...
4155
#                   Arguments to process
4175
#                   Arguments to process
4156
#
4176
#
4157
sub _SharedLibArgs
4177
sub _SharedLibArgs
4158
{
4178
{
4159
    my ( $lib, @elements) = @_;
4179
    my ( $lib, @elements) = @_;
-
 
4180
 
4160
    my ( $shared ) = $SHLIB_VER{ $lib };
4181
    my $libp = $SHLIBS->Get($lib);
-
 
4182
    Error("Library name not defined: $lib")
-
 
4183
        unless ( $libp );
4161
 
4184
 
4162
    #
4185
    #
4163
    #.. Collect --shared arguments
4186
    #.. Collect --Shared arguments
4164
    #
4187
    #
4165
    foreach (@elements)
4188
    foreach (@elements)
4166
    {
4189
    {
-
 
4190
        next unless ( /^--Shared/ );
-
 
4191
 
-
 
4192
        my $shared;
4167
        if ( /^--Shared$/ )
4193
        if ( /^--Shared$/ )
4168
        {
4194
        {
4169
        #.. Shared library, default library version 1.0
4195
        #.. Shared library, default library version 1.0
4170
        #
4196
        #
4171
            Warning( "multiple --Shared arguments" )
-
 
4172
               if ( $shared );
-
 
4173
            $shared = "1.0";
4197
            $shared = "1.0";
4174
            Debug( "ShLibArgs: shared $_ ($shared)" );
-
 
4175
            $SHLIB_VER{ $lib } = $shared;
-
 
4176
        }
4198
        }
4177
        elsif ( /^--Shared=Current$/ )
4199
        elsif ( /^--Shared=Current$/ )
4178
        {
4200
        {
4179
        #.. Shared library, using 'current' build version
4201
        #.. Shared library, using 'current' build version
4180
        #
4202
        #
4181
            Warning( "multiple --Shared arguments" )
-
 
4182
               if ( $shared );
-
 
4183
            $shared = $::ScmBuildVersion;
4203
            $shared = $::ScmBuildVersion;
4184
            $shared = "1.0"
-
 
4185
               if ($shared eq "");
4204
            $shared = "1.0" if ($shared eq "");
4186
            Debug( "ShLibArgs: shared $_ ($shared)" );
-
 
4187
            $SHLIB_VER{ $lib } = $shared;
-
 
4188
        }
4205
        }
4189
        elsif ( /^--Shared=(.*)/ )
4206
        elsif ( /^--Shared=(.*)/ )
4190
        {
4207
        {
4191
        #.. Shared library, specific version
4208
        #.. Shared library, specific version
4192
        #
4209
        #
4193
            my($M, $m) = LibNameSplit($1);
4210
            my($M, $m) = LibNameSplit($1);
-
 
4211
            $shared = "$M.$m";
-
 
4212
        }
4194
 
4213
 
-
 
4214
        #
-
 
4215
        #   Update the shared Names
-
 
4216
        #
-
 
4217
        if ( defined $shared )
-
 
4218
        {
4195
            Warning( "multiple --Shared arguments" )
4219
            Warning( "multiple --Shared arguments" )
4196
            if ($shared);
-
 
4197
                $shared = "$M.$m";
4220
                if ($libp->{ VERSION });
4198
            Debug( "ShLibArgs: shared $_ ($shared)" );
4221
            Debug( "ShLibArgs: shared $_ ($shared)" );
4199
            $SHLIB_VER{ $lib } = $shared;
4222
            $libp->{ VERSION } = $shared;
-
 
4223
        }
-
 
4224
        else
-
 
4225
        {
-
 
4226
            Error ("ShLibArgs: --Shared argument not understood");
4200
        }
4227
        }
4201
    }
4228
    }
4202
 
4229
 
4203
 
4230
 
4204
#.. Parse all of the object and argument entries.
4231
#.. Parse all of the object and argument entries.
4205
#
4232
#
4206
    foreach (@elements)
4233
    foreach (@elements)
4207
    {
4234
    {
4208
        if ( /^--Shared(.*)/ )
4235
        next if ( /^--Shared(.*)/ );
4209
        {
-
 
4210
        #.. Preprocessed above
-
 
4211
        #
-
 
4212
            next;
-
 
4213
        }
-
 
4214
 
4236
 
4215
        if ( /^[-]{1,2}([lL])(.*)/ )
4237
        if ( /^[-]{1,2}([lL])(.*)/ )
4216
        {
4238
        {
4217
        #.. Target library specified - add to library list.
4239
        #.. Target library specified - add to library list.
4218
        #
4240
        #
4219
            Debug( "ShLibArgs: lib  -$1$2" );
4241
            Debug( "ShLibArgs: lib  -$1$2" );
4220
            HashJoin( \%SHLIB_LIBS, $;, $lib, "-$1$2" );
4242
            $libp->addItem('LIBS', "-$1$2" );
4221
            next;
4243
            next;
4222
        }
4244
        }
4223
 
4245
 
4224
        if ( /^--if(.*)/ )
4246
        if ( /^--if(.*)/ )
4225
        {
4247
        {
4226
        #.. Library conditional - add to library list.
4248
        #.. Library conditional - add to library list.
4227
        #
4249
        #
4228
            Debug( "ShLibArgs: cond $_" );
4250
            Debug( "ShLibArgs: cond $_" );
4229
            HashJoin( \%SHLIB_LIBS, $;, $lib, "$_" );
4251
            $libp->addItem('LIBS', $_);
4230
            next;
4252
            next;
4231
        }
4253
        }
4232
 
4254
 
4233
        if ( /^-(.*)/ )
4255
        if ( /^-(.*)/ )
4234
        {                           
4256
        {                           
4235
        #.. Argument specified - add to argument list
4257
        #.. Argument specified - add to argument list
4236
        #
4258
        #
4237
            Debug( "ShLibArgs: arg  $_" );
4259
            Debug( "ShLibArgs: arg  $_" );
4238
            $SHLIB_VER{ $lib } = $shared;
4260
            $libp->addItem('ARGS', $_);
4239
            HashJoin( \%SHLIB_ARGS, $;, $lib, "$_" );
-
 
4240
            next;
4261
            next;
4241
        }
4262
        }
4242
 
4263
 
4243
        if ( defined %::ScmToolsetProgSource )
4264
        if ( defined %::ScmToolsetProgSource )
4244
        {
4265
        {
Line 4250... Line 4271...
4250
            if ( exists ($::ScmToolsetProgSource{$ext}) )
4271
            if ( exists ($::ScmToolsetProgSource{$ext}) )
4251
            {
4272
            {
4252
                my $full_path = MakeSrcResolve ( $_ );
4273
                my $full_path = MakeSrcResolve ( $_ );
4253
                my $flag = $::ScmToolsetProgSource{$ext};
4274
                my $flag = $::ScmToolsetProgSource{$ext};
4254
                Debug( "ShLibArgs: src $_" );
4275
                Debug( "ShLibArgs: src $_" );
4255
                HashJoin( \%SHLIB_ARGS, $;, $lib, "$flag$full_path" );
4276
                $libp->addItem('ARGS', "$flag$full_path");
4256
                next;
4277
                next;
4257
            }
4278
            }
4258
        }
4279
        }
4259
 
4280
 
4260
        if ( $::o )
4281
        if ( $::o )
Line 4266... Line 4287...
4266
        #.. Add to object list.
4287
        #.. Add to object list.
4267
        #   Note:   Object path must be explicit as several
4288
        #   Note:   Object path must be explicit as several
4268
        #           toolsets add additional objects.
4289
        #           toolsets add additional objects.
4269
        #
4290
        #
4270
            $SHOBJ_LIB{ $obj } = $lib;
4291
            $SHOBJ_LIB{ $obj } = $lib;
4271
            HashJoin( \%SHLIB_OBJS, $;, $lib, "\$(OBJDIR)/$obj" );
4292
            $libp->addItem('OBJS', "\$(OBJDIR)/$obj");
4272
            next;
4293
            next;
4273
        }
4294
        }
4274
 
4295
 
4275
        #
4296
        #
4276
        #   Don't know how to handle this type of argument
4297
        #   Don't know how to handle this type of argument
Line 4382... Line 4403...
4382
#.. Fully qualify library path for addition to library list.
4403
#.. Fully qualify library path for addition to library list.
4383
    $lib = "lib$lib"
4404
    $lib = "lib$lib"
4384
       if ( $ScmTargetHost eq "Unix" && $lib !~ m/^lib/);
4405
       if ( $ScmTargetHost eq "Unix" && $lib !~ m/^lib/);
4385
    Debug( "MergeLibrary: $lib" );
4406
    Debug( "MergeLibrary: $lib" );
4386
 
4407
 
-
 
4408
    #
-
 
4409
    #   Create a new object to describe the library
-
 
4410
    #   Ensure that only one such lib exists
-
 
4411
    #   Add the library to the list of static libraries
-
 
4412
    #
-
 
4413
    Error( "Merged Library of the same name already defined: $lib" )
-
 
4414
        if ( $MLIBS->Get($lib) );
-
 
4415
    my $libp = $MLIBS->NewAdd($lib);
-
 
4416
 
4387
#.. Parse all of the object and argument entries.
4417
#.. Parse all of the object and argument entries.
4388
#
4418
#
4389
    foreach (@elements)
4419
    foreach (@elements)
4390
    {
4420
    {
4391
        if ( /^--(.*)/ )
4421
        if ( /^--(.*)/ )
4392
        {
4422
        {
4393
            HashJoin( \%MLIB_ARGS, $;, $lib, "$_" );
4423
            $libp->addItem('ARGS', $_);
4394
        }
4424
        }
4395
        else
4425
        else
4396
        {
4426
        {
4397
            my ($llib);
4427
            my ($llib);
4398
 
4428
 
Line 4407... Line 4437...
4407
            } else {
4437
            } else {
4408
                $llib = $_;
4438
                $llib = $_;
4409
            }
4439
            }
4410
 
4440
 
4411
            Debug( "MergeLibrary: merge $llib" );
4441
            Debug( "MergeLibrary: merge $llib" );
4412
            HashJoin( \%MLIB_LIBS, $;, $lib, $llib );
4442
            $libp->addItem('LIBS', $llib);
4413
        }
4443
        }
4414
    }
4444
    }
4415
    UniquePush( \@MLIBS, $lib );
-
 
4416
}
4445
}
4417
 
4446
 
4418
#-------------------------------------------------------------------------------
4447
#-------------------------------------------------------------------------------
4419
# Function        : Script
4448
# Function        : Script
4420
#
4449
#
Line 4518... Line 4547...
4518
    #   If not, then may be a script or a TESTPROGS
4547
    #   If not, then may be a script or a TESTPROGS
4519
    #
4548
    #
4520
 
4549
 
4521
    unless ( $framework )
4550
    unless ( $framework )
4522
    {
4551
    {
4523
        if ( exists $TESTPROGS{$prog} ||  exists $PROGS{$prog} ) {
4552
        if ( $TESTPROGS->Get($prog) || $PROGS->Get($prog)  ) {
4524
            #
4553
            #
4525
            #   Append a suitable EXE suffix
4554
            #   Append a suitable EXE suffix
4526
            #
4555
            #
4527
            $prog .= "$::exe";
4556
            $prog = GenProgName( $prog );
4528
 
4557
 
4529
        } elsif ( exists $SCRIPTS{$prog} ) {
4558
        } elsif ( exists $SCRIPTS{$prog} ) {
4530
            #
4559
            #
4531
            #   Script names are raw
4560
            #   Script names are raw
4532
            #   Perl script are invoked directly
4561
            #   Perl script are invoked directly
Line 4710... Line 4739...
4710
    return if ( ! ActivePlatform($platforms) );
4739
    return if ( ! ActivePlatform($platforms) );
4711
 
4740
 
4712
    Error ("TestProg: Program name not defined") unless ( $prog );
4741
    Error ("TestProg: Program name not defined") unless ( $prog );
4713
    Error ("Programs are not supported") unless ( defined $::exe );
4742
    Error ("Programs are not supported") unless ( defined $::exe );
4714
    
4743
    
4715
 
4744
    #
4716
#.. Fully qualify program path for addition to program list
4745
    #   Create a new Prog object, or retrieve any existing one
-
 
4746
    #
-
 
4747
    my $pProg = $TESTPROGS->Get($prog);
-
 
4748
    $pProg = $TESTPROGS->NewAdd($prog)
4717
    $TESTPROGS{$prog} = 1;
4749
        unless ( $pProg );
4718
 
4750
 
4719
#.. Parse all of the object, library and argument entries
4751
#.. Parse all of the object, library and argument entries
4720
    Debug( "TestProg: $prog" );
4752
    Debug( "TestProg: $prog" );
4721
    foreach (@elements)
4753
    foreach (@elements)
4722
    {
4754
    {
4723
        if ( /^[-]{1,2}([lL])(.*)/ )
4755
        if ( /^[-]{1,2}([lL])(.*)/ )
4724
        {
4756
        {
4725
        #.. Target Library specified - add to library list.
4757
        #.. Target Library specified - add to library list.
4726
        #  
4758
        #  
4727
            Debug( "TestProg: lib  -$1$2" );
4759
            Debug( "TestProg: lib  -$1$2" );
4728
            HashJoin( \%TESTPROG_LIBS, $;, $prog, "-$1$2" );
4760
            $pProg->addItem('LIBS', "-$1$2");
4729
            next;
4761
            next;
4730
        }
4762
        }
4731
 
4763
 
4732
        if ( /^--if(.*)/ )
4764
        if ( /^--if(.*)/ )
4733
        {
4765
        {
4734
        #.. Library conditional - add to library list.
4766
        #.. Library conditional - add to library list.
4735
        #
4767
        #
4736
            Debug( "TestProg: cond $_" );
4768
            Debug( "TestProg: cond $_" );
4737
            HashJoin( \%TESTPROG_LIBS, $;, $prog, "$_" );
4769
            $pProg->addItem('LIBS', $_);
4738
            next;
4770
            next;
4739
        }
4771
        }
4740
 
4772
 
4741
        if ( /^-(.*)/ )
4773
        if ( /^-(.*)/ )
4742
        {
4774
        {
4743
        #.. Argument specified - add to argument list
4775
        #.. Argument specified - add to argument list
4744
        #
4776
        #
4745
            Debug( "TestProg: arg $_" );
4777
            Debug( "TestProg: arg $_" );
4746
            HashJoin( \%TESTPROG_ARGS, $;, $prog, "$_" );
4778
            $pProg->addItem('ARGS', $_);
4747
            next;
4779
            next;
4748
        }
4780
        }
4749
 
4781
 
4750
        if ( defined %::ScmToolsetProgSource )
4782
        if ( defined %::ScmToolsetProgSource )
4751
        {
4783
        {
Line 4757... Line 4789...
4757
            if ( exists ($::ScmToolsetProgSource{$ext}) )
4789
            if ( exists ($::ScmToolsetProgSource{$ext}) )
4758
            {
4790
            {
4759
                my $full_path = MakeSrcResolve ( $_ );
4791
                my $full_path = MakeSrcResolve ( $_ );
4760
                my $flag = $::ScmToolsetProgSource{$ext};
4792
                my $flag = $::ScmToolsetProgSource{$ext};
4761
                Debug( "TestProg: src $_" );
4793
                Debug( "TestProg: src $_" );
4762
                HashJoin( \%TESTPROG_ARGS, $;, $prog, "$flag$full_path" );
4794
                $pProg->addItem('ARGS', "$flag$full_path");
4763
                next;
4795
                next;
4764
            }
4796
            }
4765
        }
4797
        }
4766
 
4798
 
4767
        if ( $::o )
4799
        if ( $::o )
Line 4769... Line 4801...
4769
        #.. Object specified - add to object list.
4801
        #.. Object specified - add to object list.
4770
        #
4802
        #
4771
            my $obj = _LibObject( "", $_ );
4803
            my $obj = _LibObject( "", $_ );
4772
 
4804
 
4773
        #.. Add to program object list.
4805
        #.. Add to program object list.
4774
            HashJoin( \%TESTPROG_OBJS, $;, $prog, "\$(OBJDIR)/$obj" );
4806
            $pProg->addItem('OBJS', "\$(OBJDIR)/$obj");
4775
            next;
4807
            next;
4776
        }
4808
        }
4777
 
4809
 
4778
        #
4810
        #
4779
        #   Don't know how to handle this type of argument
4811
        #   Don't know how to handle this type of argument
Line 4792... Line 4824...
4792
    return if ( ! ActivePlatform($platforms) );
4824
    return if ( ! ActivePlatform($platforms) );
4793
 
4825
 
4794
    Error ("Prog: Program name not defined") unless ( $prog );
4826
    Error ("Prog: Program name not defined") unless ( $prog );
4795
    Error ("Programs are not supported") unless ( defined $::exe );
4827
    Error ("Programs are not supported") unless ( defined $::exe );
4796
    
4828
    
4797
 
4829
    #
4798
#.. Fully qualify program path for addition to program list
4830
    #   Create a new Prog object, or retrieve any existing one
-
 
4831
    #
4799
    UniquePush( \@PROGS, $prog );
4832
    my $pProg = $PROGS->Get($prog);
-
 
4833
    $pProg = $PROGS->NewAdd($prog)
4800
    $PROGS{$prog} = 1;
4834
        unless ( $pProg );
4801
 
4835
 
4802
#.. Parse all of the object, library and argument entries
4836
#.. Parse all of the object, library and argument entries
4803
    Debug( "Prog: $prog" );
4837
    Debug( "Prog: $prog" );
4804
    foreach (@elements)
4838
    foreach (@elements)
4805
    {
4839
    {
4806
        if ( /^[-]{1,2}([lL])(.*)/ )
4840
        if ( /^[-]{1,2}([lL])(.*)/ )
4807
        {
4841
        {
4808
        #.. Target Library specified - add to library list.
4842
        #.. Target Library specified - add to library list.
4809
        #  
4843
        #  
4810
            Debug( "Prog: lib  -$1$2" );
4844
            Debug( "Prog: lib  -$1$2" );
4811
            HashJoin( \%PROG_LIBS, $;, $prog, "-$1$2" );
4845
            $pProg->addItem('LIBS', "-$1$2");
4812
            next;
4846
            next;
4813
        }
4847
        }
4814
 
4848
 
4815
        if ( /^--if(.*)/ )
4849
        if ( /^--if(.*)/ )
4816
        {
4850
        {
4817
        #.. Library conditional - add to library list.
4851
        #.. Library conditional - add to library list.
4818
        #
4852
        #
4819
            Debug( "Prog: cond $_" );
4853
            Debug( "Prog: cond $_" );
4820
            HashJoin( \%PROG_LIBS, $;, $prog, "$_" );
4854
            $pProg->addItem('LIBS', $_);
4821
            next;
4855
            next;
4822
        }
4856
        }
4823
 
4857
 
4824
        if ( /^-(.*)/ )
4858
        if ( /^-(.*)/ )
4825
        {
4859
        {
4826
        #.. Argument specified - add to argument list
4860
        #.. Argument specified - add to argument list
4827
        #
4861
        #
4828
            Debug( "Prog: arg $_" );
4862
            Debug( "Prog: arg $_" );
4829
            HashJoin( \%PROG_ARGS, $;, $prog, "$_" );
4863
            $pProg->addItem('ARGS', $_);
4830
            next;
4864
            next;
4831
        }
4865
        }
4832
 
4866
 
4833
        if ( defined %::ScmToolsetProgSource )
4867
        if ( defined %::ScmToolsetProgSource )
4834
        {
4868
        {
Line 4840... Line 4874...
4840
            if ( exists ($::ScmToolsetProgSource{$ext}) )
4874
            if ( exists ($::ScmToolsetProgSource{$ext}) )
4841
            {
4875
            {
4842
                my $full_path = MakeSrcResolve ( $_ );
4876
                my $full_path = MakeSrcResolve ( $_ );
4843
                my $flag = $::ScmToolsetProgSource{$ext};
4877
                my $flag = $::ScmToolsetProgSource{$ext};
4844
                Debug( "Prog: src $_" );
4878
                Debug( "Prog: src $_" );
4845
                HashJoin( \%PROG_ARGS, $;, $prog, "$flag$full_path" );
4879
                $pProg->addItem('ARGS', "$flag$full_path");
4846
                next;
4880
                next;
4847
            }
4881
            }
4848
        }
4882
        }
4849
 
4883
 
4850
        if ( $::o )
4884
        if ( $::o )
Line 4852... Line 4886...
4852
        #.. Object specified - add to object list.
4886
        #.. Object specified - add to object list.
4853
        #
4887
        #
4854
            my $obj = _LibObject( "", $_ );
4888
            my $obj = _LibObject( "", $_ );
4855
 
4889
 
4856
        #.. Add to program object list.
4890
        #.. Add to program object list.
4857
            push @PROGOBJS, $obj;
-
 
4858
            HashJoin( \%PROG_OBJS, $;, $prog, "\$(OBJDIR)/$obj" );
4891
            $pProg->addItem('OBJS', "\$(OBJDIR)/$obj");
4859
            next;
4892
            next;
4860
        }
4893
        }
4861
 
4894
 
4862
        #
4895
        #
4863
        #   Don't know how to handle this type of argument
4896
        #   Don't know how to handle this type of argument
Line 5613... Line 5646...
5613
sub InstallLib
5646
sub InstallLib
5614
{
5647
{
5615
    my( $platforms, @elements ) = @_;
5648
    my( $platforms, @elements ) = @_;
5616
    my( $base, $dir, $package );
5649
    my( $base, $dir, $package );
5617
    my( $lib, $strip );
5650
    my( $lib, $strip );
-
 
5651
    my $org_lib;
5618
 
5652
 
5619
    Debug2( "InstallLib($platforms, @elements)" );
5653
    Debug2( "InstallLib($platforms, @elements)" );
5620
 
5654
 
5621
    return if ( ! ActivePlatform($platforms) );
5655
    return if ( ! ActivePlatform($platforms) );
5622
    Warning ("InstallLib: Needs local directory specified in build.pl") unless ( $::ScmLocal );
5656
    Warning ("InstallLib: Needs local directory specified in build.pl") unless ( $::ScmLocal );
Line 5651... Line 5685...
5651
        my %package_entry;
5685
        my %package_entry;
5652
        if ( ! /^--(.*)/ )
5686
        if ( ! /^--(.*)/ )
5653
        {
5687
        {
5654
            $_ = basename ($_)
5688
            $_ = basename ($_)
5655
                if ( $strip );
5689
                if ( $strip );
-
 
5690
            $org_lib = $_;                      # Original name
5656
 
5691
 
5657
            if ( $ScmTargetHost eq "Unix" ) {
5692
            if ( $ScmTargetHost eq "Unix" ) {
5658
                $lib = "lib$_";                 # Prefix "lib" ....
5693
                $lib = "lib$_";                 # Prefix "lib" ....
5659
                $lib =~ s/^liblib/lib/;         # @LIBS already has lib added
5694
                $lib =~ s/^liblib/lib/;         # @LIBS already has lib added
5660
            } else {
5695
            } else {
5661
                $lib = $_;
5696
                $lib = $_;
5662
            }
5697
            }
5663
 
5698
 
5664
            if ( exists $SHLIB_VER { $lib } )
5699
            if (  my $libp = $SHLIBS->Get($lib) )
5665
            {
5700
            {
5666
                Debug( "InstallLib( $dir/$lib\$(GBE_TYPE).$::so, " .
5701
                Debug( "InstallLib( $dir/$lib\$(GBE_TYPE).$::so, " .
5667
                    "src: \$(LIBDIR)/$lib\$(GBE_TYPE).$::so, dest: $dir)" );
5702
                    "src: \$(LIBDIR)/$lib\$(GBE_TYPE).$::so, dest: $dir)" );
5668
 
5703
 
5669
                #
5704
                #
Line 5671... Line 5706...
5671
                #   The exact format of the name of the shared library is
5706
                #   The exact format of the name of the shared library is
5672
                #   toolset specific. Create an entry to allow the toolset
5707
                #   toolset specific. Create an entry to allow the toolset
5673
                #   to extend the packaging information when the shared library
5708
                #   to extend the packaging information when the shared library
5674
                #   recipe is constructed.
5709
                #   recipe is constructed.
5675
                #
5710
                #
5676
                my $ver = $SHLIB_VER { $lib };
5711
                my $ver = $libp->{ VERSION };
5677
                my $name = "$dir/$lib.$ver.PlaceKeeper";
5712
                my $name = "$dir/$lib.$ver.PlaceKeeper";
5678
 
5713
 
5679
 
-
 
5680
                push @{$SHLIB_INS{$lib}}, $name;
-
 
5681
 
-
 
5682
                $package_entry{'placekeeper'} = 1;
5714
                $package_entry{'placekeeper'} = 1;
5683
                $package_entry{'version'} = $ver;
5715
                $package_entry{'version'} = $ver;
5684
                $package_entry{'lib'} = $lib;
5716
                $package_entry{'lib'} = $lib;
5685
                $package_entry{'dir'} = $dir;
5717
                $package_entry{'dir'} = $dir;
-
 
5718
 
-
 
5719
                push @{$SHLIB_INS{$lib}}, $name;
5686
                $INSTALL_SHLIBS{$name} = {%package_entry};
5720
                $INSTALL_SHLIBS{$name} = {%package_entry};
5687
            }
5721
            }
5688
 
5722
 
-
 
5723
            #
-
 
5724
            #   Clean up the package_entry
-
 
5725
            #   Insert common items
-
 
5726
            #
-
 
5727
            %package_entry = ();
-
 
5728
            $package_entry{'lib'} = $lib;
-
 
5729
            $package_entry{'dir'} = $dir;
-
 
5730
 
5689
            if ( my $libfile = $SRCS{$lib} )
5731
            if ( my $libfile = $SRCS{$lib} )
5690
            {
5732
            {
5691
                #
5733
                #
5692
                #   Allow the user to package a sourced file as a library
5734
                #   Allow the user to package a sourced file as a library
-
 
5735
                #   But must be the un-massaged name of the file.
5693
                #
5736
                #
5694
                Debug( "InstallLib( $dir/$lib, " .
-
 
5695
                    "src: $libfile, dest: $dir )" );
-
 
5696
 
-
 
5697
                push @{$LIB_INS{$lib}}, "$dir/$lib";
-
 
5698
 
-
 
5699
                $package_entry{'src'} = "$libfile";
5737
                $package_entry{'dst'} = "$dir/$org_lib";
5700
                $package_entry{'dir'} = $dir;
5738
                $package_entry{'src'} = $libfile;
5701
 
-
 
5702
                $INSTALL_LIBS{ "$dir/$lib" } = {%package_entry};
-
 
5703
            }
5739
            }
5704
            elsif ( exists $LIB_OBJS { $lib } || ! exists $SHLIB_VER { $lib } )
5740
            elsif ( $LIBS->Get($lib) )
5705
            {
5741
            {
-
 
5742
                #
5706
                Debug( "InstallLib( $dir/$lib\$(GBE_TYPE).$::a, " .
5743
                #   Install a library known to the makefile
5707
                    "src: \$(LIBDIR)/$lib\$(GBE_TYPE).$::a, dest: $dir )" );
5744
                #
5708
 
-
 
5709
                push @{$LIB_INS{$lib}}, "$dir/$lib\$(GBE_TYPE).$::a";
5745
                my $libp = $LIBS->Get($lib);
5710
 
5746
 
5711
                $package_entry{'src'} = "\$(LIBDIR)/$lib\$(GBE_TYPE).$::a";
5747
                $package_entry{'dst'}    = $dir . '/' . $libp->getFullName();
5712
                $package_entry{'dir'} = $dir;
5748
                $package_entry{'src'}    = $libp->getPath();
-
 
5749
            }
-
 
5750
            elsif ( ! $SHLIBS->Get($lib) )
-
 
5751
            {
-
 
5752
                #
-
 
5753
                #   Not a known shared lib
-
 
5754
                #   Not a known static lib
-
 
5755
                #   Not a 'sourced' file
-
 
5756
                #   Assume the a static library has magically appeared
-
 
5757
                #   in the standard LIB directory. May have been placed there
-
 
5758
                #   by a 'rule'
-
 
5759
                #
-
 
5760
                my $libp = $LIBS->New($lib);
5713
 
5761
 
5714
                $INSTALL_LIBS{ "$dir/$lib\$(GBE_TYPE).$::a" } = {%package_entry};
5762
                $package_entry{'dst'}    = $dir . '/' . $libp->getFullName();
-
 
5763
                $package_entry{'src'}    = $libp->getPath();
5715
            }
5764
            }
-
 
5765
 
-
 
5766
            #
-
 
5767
            #   Add entry to various lists if required
-
 
5768
            #
-
 
5769
            PackageLib_AddEntry ('InstallLib', \%LIB_INS, \%INSTALL_LIBS, \%package_entry )
-
 
5770
                if ( exists $package_entry{'dst'} );
5716
        }
5771
        }
5717
    }
5772
    }
5718
 
5773
 
5719
#.. Package
5774
#.. Package
5720
#
5775
#
Line 5839... Line 5894...
5839
            #
5894
            #
5840
            #   If the named target is a program then append the correct
5895
            #   If the named target is a program then append the correct
5841
            #   extension. Otherwise assume that the target is either a script
5896
            #   extension. Otherwise assume that the target is either a script
5842
            #   or a some other file - and don't append an extension
5897
            #   or a some other file - and don't append an extension
5843
            #
5898
            #
5844
            #   A program may not have any object files, only libraries
-
 
5845
            #
-
 
5846
            $ext = $::exe
5899
            $ext = $::exe
5847
                if ( exists $PROGS{$prog} );
5900
                if ( $PROGS->Get($prog) );
5848
 
5901
 
5849
            #
5902
            #
5850
            #   A "file" that is specified with a "Src" directive may be
5903
            #   A "file" that is specified with a "Src" directive may be
5851
            #   installed as though it were a program
5904
            #   installed as though it were a program
5852
            #
5905
            #
Line 6241... Line 6294...
6241
                $lib =~ s/^liblib/lib/;         # @LIBS already has lib added
6294
                $lib =~ s/^liblib/lib/;         # @LIBS already has lib added
6242
            } else {
6295
            } else {
6243
                $lib = $_;
6296
                $lib = $_;
6244
            }
6297
            }
6245
 
6298
 
6246
            if ( exists $SHLIB_VER { $lib } )
6299
            if (  my $libp = $SHLIBS->Get($lib) )
6247
            {
6300
            {
6248
                Debug( "PackageLib( $dir/$lib\$(GBE_TYPE).$::so, " .
6301
                Debug( "PackageLib( $dir/$lib\$(GBE_TYPE).$::so, " .
6249
                    "src: \$(LIBDIR)/$lib\$(GBE_TYPE).$::so, dest: $dir, dist: $dist, type: $type )" );
6302
                    "src: \$(LIBDIR)/$lib\$(GBE_TYPE).$::so, dest: $dir, dist: $dist, type: $type )" );
6250
 
6303
 
6251
                #
6304
                #
Line 6254... Line 6307...
6254
                #   toolset specific. Create an entry to allow the toolset
6307
                #   toolset specific. Create an entry to allow the toolset
6255
                #   to extend the packaging information when the shared library
6308
                #   to extend the packaging information when the shared library
6256
                #   recipe is constructed.
6309
                #   recipe is constructed.
6257
                #
6310
                #
6258
                #
6311
                #
6259
                my $ver = $SHLIB_VER{ $lib };
6312
                my $ver = $libp->{ VERSION };
6260
                my $name = "$dir/$lib.$ver.PlaceKeeper";
6313
                my $name = "$dir/$lib.$ver.PlaceKeeper";
6261
 
6314
 
6262
                push @{$SHLIB_PKG{$lib}}, $name;
-
 
6263
 
-
 
6264
                $package_entry{'placekeeper'} = 1;
6315
                $package_entry{'placekeeper'} = 1;
6265
                $package_entry{'version'} = $ver;
6316
                $package_entry{'version'} = $ver;
6266
                $package_entry{'lib'} = $lib;
6317
                $package_entry{'lib'} = $lib;
6267
                $package_entry{'dir'} = $dir;
6318
                $package_entry{'dir'} = $dir;
6268
                $package_entry{'set'} = $dist;
6319
                $package_entry{'set'} = $dist;
6269
                $package_entry{'type'} = $type if ( $type );
6320
                $package_entry{'type'} = $type if ( $type );
6270
                $package_entry{'extras'} = {%extras} if ( scalar %extras );
6321
                $package_entry{'extras'} = {%extras} if ( scalar %extras );
-
 
6322
 
-
 
6323
                push @{$SHLIB_PKG{$lib}}, $name;
6271
                $PACKAGE_SHLIBS{$name} = {%package_entry};
6324
                $PACKAGE_SHLIBS{$name} = {%package_entry};
6272
            }
6325
            }
6273
 
6326
 
-
 
6327
            #
-
 
6328
            #   Clean up the package_entry
-
 
6329
            #   Insert common items
-
 
6330
            #
-
 
6331
            %package_entry = ();
-
 
6332
            $package_entry{'lib'} = $lib;
-
 
6333
            $package_entry{'dir'} = $dir;
-
 
6334
            $package_entry{'set'} = $dist;
-
 
6335
            $package_entry{'extras'} = {%extras} if ( scalar %extras );
-
 
6336
            $package_entry{'type'} = $type if ( $type );
-
 
6337
 
6274
            if ( my $libfile = $SRCS{$org_lib} )
6338
            if ( my $libfile = $SRCS{$org_lib} )
6275
            {
6339
            {
6276
                #
6340
                #
6277
                #   Allow the user to package a sourced file as a library
6341
                #   Allow the user to package a sourced file as a library
6278
                #   But must be the un-massaged name of the file.
6342
                #   But must be the un-massaged name of the file.
6279
                #
6343
                #
6280
                Debug( "PackageLib( $dir/$org_lib, " .
-
 
6281
                    "src: $libfile, dest: $dir, dist: $dist, type: $type )" );
-
 
6282
 
-
 
6283
                push @{$LIB_PKG{$lib}}, "$dir/$lib";
-
 
6284
 
-
 
6285
                $package_entry{'src'} = "$libfile";
6344
                $package_entry{'dst'} = "$dir/$org_lib";
6286
                $package_entry{'dir'} = $dir;
-
 
6287
                $package_entry{'set'} = $dist;
6345
                $package_entry{'src'} = $libfile;
6288
                $package_entry{'extras'} = {%extras} if ( scalar %extras );
-
 
6289
                $package_entry{'type'} = $type if ( $type );
-
 
6290
 
-
 
6291
                $PACKAGE_LIBS{ "$dir/$org_lib" } = {%package_entry};
-
 
6292
            }
6346
            }
6293
            elsif ( exists $LIB_OBJS { $lib } || ! exists $SHLIB_VER { $lib } )
6347
            elsif ( $LIBS->Get($lib) )
6294
            {
6348
            {
6295
                Debug( "PackageLib( $dir/$lib\$(GBE_TYPE).$::a, " .
6349
                #
6296
                    "src: \$(LIBDIR)/$lib\$(GBE_TYPE).$::a, dest: $dir, dist: $dist, type: $type )" );
6350
                #   Package up a library known to the makefile
6297
 
-
 
-
 
6351
                #
6298
                push @{$LIB_PKG{$lib}}, "$dir/$lib\$(GBE_TYPE).$::a";
6352
                my $libp = $LIBS->Get($lib);
6299
 
6353
 
6300
                $package_entry{'src'} = "\$(LIBDIR)/$lib\$(GBE_TYPE).$::a";
6354
                $package_entry{'dst'}    = $dir . '/' . $libp->getFullName();
6301
                $package_entry{'dir'} = $dir;
6355
                $package_entry{'src'}    = $libp->getPath();
-
 
6356
            }
-
 
6357
            elsif ( ! $SHLIBS->Get($lib) )
-
 
6358
            {
-
 
6359
                #
-
 
6360
                #   Not a known shared lib
6302
                $package_entry{'set'} = $dist;
6361
                #   Not a known static lib
-
 
6362
                #   Not a 'sourced' file
6303
                $package_entry{'extras'} = {%extras} if ( scalar %extras );
6363
                #   Assume the a static library has magically appeared
-
 
6364
                #   in the standard LIB directory. May have been placed there
-
 
6365
                #   by a 'rule'
-
 
6366
                #
6304
                $package_entry{'type'} = $type if ( $type );
6367
                my $libp = $LIBS->New($lib);
6305
 
6368
 
6306
                $PACKAGE_LIBS{ "$dir/$lib\$(GBE_TYPE).$::a" } = {%package_entry};
6369
                $package_entry{'dst'}    = $dir . '/' . $libp->getFullName();
-
 
6370
                $package_entry{'src'}    = $libp->getPath();
6307
            }
6371
            }
-
 
6372
 
-
 
6373
            #
-
 
6374
            #   Add entry to various lists if required
-
 
6375
            #
-
 
6376
            PackageLib_AddEntry ('PackageLib', \%LIB_PKG, \%PACKAGE_LIBS, \%package_entry )
-
 
6377
                if ( exists $package_entry{'dst'} );
6308
        }
6378
        }
6309
    }
6379
    }
6310
}
6380
}
6311
 
6381
 
-
 
6382
#-------------------------------------------------------------------------------
-
 
6383
# Function        : PackageLib_AddEntry
-
 
6384
#
-
 
6385
# Description     : Helper function to add a package entry
-
 
6386
#                   to the lists
-
 
6387
#
-
 
6388
# Inputs          : $directive          - Directive name
-
 
6389
#                   $pList              - Ref to array list to maintain
-
 
6390
#                   $pHash              - Ref to hash to maintain
-
 
6391
#                   $pData              - Packaging Data
-
 
6392
#                                         Must Take a copy.
-
 
6393
#
-
 
6394
# Returns         : 
-
 
6395
#
-
 
6396
 
-
 
6397
sub PackageLib_AddEntry
-
 
6398
{
-
 
6399
    my ($directive, $pList, $pHash, $pData) = @_;
-
 
6400
 
-
 
6401
    my $lib = delete $pData->{'lib'};
-
 
6402
    my $dst = delete $pData->{'dst'};
-
 
6403
 
-
 
6404
    Error ("INTERNAL PackageLib_AddEntry: lib or dst not defined")
-
 
6405
        unless ( $lib && $dst );
-
 
6406
 
-
 
6407
    Debug( "$directive( ",$dst,
-
 
6408
            ", src: " ,$pData->{'src'},
-
 
6409
            ", dest: ",$pData->{'dir'},
-
 
6410
            ", dist: ",$pData->{'set'},
-
 
6411
            ", type: ",$pData->{'type'} || '',
-
 
6412
            " )" );
-
 
6413
 
-
 
6414
    push @{$pList->{$lib }}, $dst;
-
 
6415
    $pHash->{$dst } = {%$pData};
-
 
6416
}
-
 
6417
 
6312
 
6418
 
6313
sub PackageProg
6419
sub PackageProg
6314
{
6420
{
6315
    my( $platforms, @elements ) = @_;
6421
    my( $platforms, @elements ) = @_;
6316
    my( $base, $dir, $dist, $type );
6422
    my( $base, $dir, $dist, $type );
Line 6384... Line 6490...
6384
            #   or a some other file - and don't append an extension
6490
            #   or a some other file - and don't append an extension
6385
            #
6491
            #
6386
            #   A program may not have any object files, only libraries
6492
            #   A program may not have any object files, only libraries
6387
            #
6493
            #
6388
            $ext = $::exe
6494
            $ext = $::exe
6389
                if ( exists $PROGS{$prog} );
6495
                if ( $PROGS->Get($prog) );
6390
 
6496
 
6391
            #
6497
            #
6392
            #   A "file" that is specified with a "Src" directive may be
6498
            #   A "file" that is specified with a "Src" directive may be
6393
            #   installed as though it were a program
6499
            #   installed as though it were a program
6394
            #
6500
            #
Line 6573... Line 6679...
6573
#                   ie: Add a MAP file to be packaged with a program
6679
#                   ie: Add a MAP file to be packaged with a program
6574
#
6680
#
6575
# Inputs          : ref_spkg  - Reference to the hash that contains the package data
6681
# Inputs          : ref_spkg  - Reference to the hash that contains the package data
6576
#                   ref_dpkg  - Reference to the target package/install hash
6682
#                   ref_dpkg  - Reference to the target package/install hash
6577
#                               Normally the same as ref_dpkg, but does allow
6683
#                               Normally the same as ref_dpkg, but does allow
6578
#                               a static librry to be added to a dynamic library
6684
#                               a static library to be added to a dynamic library
6579
#                               package.
6685
#                               package.
6580
#                   ref_list  - Reference to a hash that may contain package keys to process
6686
#                   ref_list  - Reference to a hash that may contain package keys to process
6581
#                   prog      - Key for index to above
6687
#                   prog      - Key for index to above
6582
#                   file      - A file to be added
6688
#                   file      - A file to be added
6583
#                   args      - Additional packaging arguments
6689
#                   args      - Additional packaging arguments
Line 8373... Line 8479...
8373
#   This is done fairly early to allow the toolsets to extend various
8479
#   This is done fairly early to allow the toolsets to extend various
8374
#   definitions that may be used later in the makefile construction
8480
#   definitions that may be used later in the makefile construction
8375
#
8481
#
8376
    MakeHeader ("Construct Programs");
8482
    MakeHeader ("Construct Programs");
8377
 
8483
 
8378
    sub argsplit
-
 
8379
    {
-
 
8380
        my ($ref) = @_;
-
 
8381
        my (@ret) = ();
-
 
8382
 
-
 
8383
        @ret = split( /$;/, $ref )              # split, only if defined
-
 
8384
            if ( defined($ref) );
-
 
8385
        return @ret;
-
 
8386
    }
-
 
8387
 
-
 
8388
    foreach my $i ( @PROGS )
8484
    foreach my $i ( @PROGS )
8389
    {
8485
    {
8390
        my( @args, @objects, @libs, $l );
8486
        my $pProg = $PROGS->Get($i);
8391
 
-
 
8392
        @args    = argsplit( $PROG_ARGS{ $i } );
8487
        my $pArgs = $pProg->getItems('ARGS');
8393
        @objects = argsplit( $PROG_OBJS{ $i } );
8488
        my $pObjs = $pProg->getItems('OBJS');
8394
        @libs    = argsplit( $PROG_LIBS{ $i } );
8489
        my $pLibs = $pProg->getItems('LIBS');
8395
 
8490
 
-
 
8491
        #
-
 
8492
        #   Create a list of program object files
-
 
8493
        #
-
 
8494
        push @PROGOBJS, @$pObjs;
8396
 
8495
 
8397
        MakePrint( "#---- (${i})\n\n" );
8496
        MakePrint( "#---- (${i})\n\n" );
8398
        if ( $ScmToolsetProgDependancies )
8497
        if ( $ScmToolsetProgDependancies )
8399
        {
8498
        {
8400
            #
8499
            #
Line 8407... Line 8506...
8407
            #          by many,many lines of output. This makes it difficult
8506
            #          by many,many lines of output. This makes it difficult
8408
            #          to see the error.
8507
            #          to see the error.
8409
            #
8508
            #
8410
            #       2) Lack of Flexability
8509
            #       2) Lack of Flexability
8411
            #
8510
            #
8412
            MakeEntry( "\$(BINDIR)/$i$::exe: ", "", "\\\n\t\t", ".$::o ", @objects );
8511
            MakeEntry( "\$(BINDIR)/$i$::exe: ", "", "\\\n\t\t", ".$::o ", $pObjs );
8413
        }
8512
        }
8414
        else
8513
        else
8415
        {
8514
        {
8416
            #
8515
            #
8417
            #   New Style Prog Interface
8516
            #   New Style Prog Interface
Line 8421... Line 8520...
8421
            #   The toolset will replace/update it.
8520
            #   The toolset will replace/update it.
8422
            #
8521
            #
8423
            PackageProgRemoveFiles( $i );
8522
            PackageProgRemoveFiles( $i );
8424
        }
8523
        }
8425
 
8524
 
8426
        $if->LD( $i, \@args, \@objects, \@libs );
8525
        $if->LD    ( $i, $pArgs, $pObjs, $pLibs );
8427
        $if->LDLINT( $i, \@args, \@objects, \@libs );
8526
        $if->LDLINT( $i, $pArgs, $pObjs, $pLibs );
8428
    }
8527
    }
8429
 
8528
 
8430
#-------------------------------------------------------------------------------
8529
#-------------------------------------------------------------------------------
8431
#   
8530
#   
8432
#
8531
#
8433
    MakeHeader ("Construct Test Programs");
8532
    MakeHeader ("Construct Test Programs");
8434
    foreach my $i ( keys %TESTPROGS )
8533
    foreach my $i ( @TESTPROGS )
8435
    {
8534
    {
8436
        my( @args, @objects, @libs, $l );
8535
        my $pProg = $TESTPROGS->Get($i);
8437
 
-
 
8438
        @args    = argsplit( $TESTPROG_ARGS{ $i } );
8536
        my $pArgs = $pProg->getItems('ARGS');
8439
        @objects = argsplit( $TESTPROG_OBJS{ $i } );
8537
        my $pObjs = $pProg->getItems('OBJS');
8440
        @libs    = argsplit( $TESTPROG_LIBS{ $i } );
8538
        my $pLibs = $pProg->getItems('LIBS');
8441
 
8539
 
-
 
8540
        #
-
 
8541
        #   Create a list of program object files
-
 
8542
        #
-
 
8543
        push @TESTPROGOBJS, @$pObjs;
-
 
8544
        
8442
        MakePrint( "#---- (${i})\n\n" );
8545
        MakePrint( "#---- (${i})\n\n" );
8443
        if ( $ScmToolsetProgDependancies )
8546
        if ( $ScmToolsetProgDependancies )
8444
        {
8547
        {
8445
            MakeEntry( "\$(BINDIR)/$i$::exe: ", "", "\\\n\t\t", ".$::o ", @objects );
8548
            MakeEntry( "\$(BINDIR)/$i$::exe: ", "", "\\\n\t\t", ".$::o ", $pObjs );
8446
        }
8549
        }
8447
        else
8550
        else
8448
        {
8551
        {
8449
            PackageProgRemoveFiles( $i );
8552
            PackageProgRemoveFiles( $i );
8450
        }
8553
        }
8451
 
8554
 
8452
        $if->LD( $i, \@args, \@objects, \@libs );
8555
        $if->LD    ( $i, $pArgs, $pObjs, $pLibs );
8453
        $if->LDLINT( $i, \@args, \@objects, \@libs );
8556
        $if->LDLINT( $i, $pArgs, $pObjs, $pLibs );
8454
    }
8557
    }
8455
 
8558
 
8456
#-------------------------------------------------------------------------------
8559
#-------------------------------------------------------------------------------
8457
#
8560
#
8458
#
8561
#
Line 8479... Line 8582...
8479
#   
8582
#   
8480
#
8583
#
8481
    MakeHeader ("Construct Libraries");
8584
    MakeHeader ("Construct Libraries");
8482
    foreach my $i ( @LIBS )
8585
    foreach my $i ( @LIBS )
8483
    {
8586
    {
8484
        my( @args, @objects );
8587
        my $pLib  = $LIBS->Get($i);
8485
 
-
 
8486
        @objects = argsplit( $LIB_OBJS{ $i } );
8588
        my $pArgs = $pLib->getItems('ARGS');
8487
        @args    = argsplit( $LIB_ARGS{ $i } );
8589
        my $pObjs = $pLib->getItems('OBJS');
8488
 
8590
 
8489
        MakePrint "#---- (${i})\n\n";
8591
        MakePrint "#---- (${i})\n\n";
8490
        $if->AR( $i, \@args, \@objects );
8592
        $if->AR(     $i, $pArgs, $pObjs, $pLib);
8491
        $if->ARLINT( $i, \@args, \@objects );
8593
        $if->ARLINT( $i, $pArgs, $pObjs, $pLib );
8492
    }
8594
    }
8493
 
8595
 
-
 
8596
#-------------------------------------------------------------------------------
-
 
8597
#   
-
 
8598
#
-
 
8599
    MakeHeader ("Construct Merged Libraries");
8494
    sub MlibEntry
8600
    sub MlibEntry
8495
    {
8601
    {
8496
        my( $mlib, @libs ) = @_;
8602
        my( $mlib, $plib, $pLibs ) = @_;
8497
        my @flib;
8603
        my @flib;
8498
 
8604
 
8499
        MakePrint "\$(LIBDIR)/$mlib\$(GBE_TYPE).$::a:\t";
8605
        MakePrint '$(LIBDIR)/' . GenLibName($mlib) . ":";
8500
        foreach my $lib ( @libs )
8606
        foreach my $lib ( @$pLibs )
8501
        {
8607
        {
-
 
8608
            #
-
 
8609
            #   Each library name may contains one embedded option which
-
 
8610
            #   specifies the source directory
-
 
8611
            #       libname[,--Option | BaseSubdir]
-
 
8612
            #
8502
            my ($slib, $sdir) = split( ',', $lib );
8613
            my ($slib, $sdir) = split( ',', $lib );
8503
 
8614
 
8504
            #
8615
            #
8505
            #   By default the librares are pulled from LOCAL unless the
8616
            #   By default the librares are pulled from LOCAL unless the
8506
            #   library is built in this directory, in which case it will
8617
            #   library is built in this directory, in which case it will
-
 
8618
            #   be used.
8507
            #
8619
            #
8508
            #
-
 
8509
            unless ( $sdir )
-
 
8510
            {
-
 
8511
                $sdir = ( exists $LIB_OBJS { $slib } ) ? '--Here' : '--Local';
8620
            $sdir = ( $LIBS->Get($slib) ) ? '--Here' : '--Local'
8512
            }
8621
                unless ( $sdir );
8513
 
8622
 
8514
            #
8623
            #
8515
            #   --Interface     - Pull library from the interface directory
8624
            #   --Interface     - Pull library from the interface directory
8516
            #   --Local         - Pull library from the local directory
8625
            #   --Local         - Pull library from the local directory
8517
            #   --SubDir=xxxx   - Pull library from specified subdirectory
8626
            #   --SubDir=xxxx   - Pull library from specified subdirectory
Line 8533... Line 8642...
8533
 
8642
 
8534
            } else {
8643
            } else {
8535
                $sdir .= '/$(LIBDIR)';
8644
                $sdir .= '/$(LIBDIR)';
8536
            }
8645
            }
8537
 
8646
 
8538
            MakePrint "\\\n\t\t${sdir}/${slib}\$(GBE_TYPE).$::a";
8647
            MakePrint " \\\n\t\t${sdir}/" . GenLibName($slib);
8539
            push @flib, "${sdir}/${slib}";
8648
            push @flib, "${sdir}/${slib}";
8540
        }
8649
        }
8541
        return @flib;
8650
        return \@flib;
8542
    }
8651
    }
8543
 
8652
 
8544
    foreach my $i ( @MLIBS )
8653
    foreach my $i ( @MLIBS )
8545
    {
8654
    {
-
 
8655
        my $pLib  = $MLIBS->Get($i);
8546
        my( @args, @libs );
8656
        my $pArgs = $pLib->getItems('ARGS');
-
 
8657
        my $pLibs = $pLib->getItems('LIBS');
8547
 
8658
 
8548
        MakePrint "#---- (${i})\n\n";
8659
        MakePrint "#---- (${i})\n\n";
8549
        
8660
        
8550
        @libs    = argsplit( $MLIB_LIBS{ $i } );
-
 
8551
        @args    = argsplit( $MLIB_ARGS{ $i } );
-
 
8552
 
-
 
8553
        unless ( defined &ToolsetARMerge )
8661
        unless ( defined &ToolsetARMerge )
8554
        {
8662
        {
8555
            Warning( "Merging of libraries not supported in this toolset yet" );
8663
            Warning( "Merging of libraries not supported in this toolset yet" );
8556
            Warning( "MergeLibrary: \"$i\" will not be created" );
8664
            Warning( "MergeLibrary: \"$i\" will not be created" );
8557
        }
8665
        }
Line 8560... Line 8668...
8560
            #
8668
            #
8561
            #   Create the dependency rule
8669
            #   Create the dependency rule
8562
            #       Target library : source library list
8670
            #       Target library : source library list
8563
            #           Recipe - generated by the toolset
8671
            #           Recipe - generated by the toolset
8564
            #
8672
            #
8565
            foreach ( @args )
8673
            foreach ( @$pArgs )
8566
            {
8674
            {
8567
                Warning( "Ignoring unknown argument to MergeLibrary. $_" );
8675
                Warning( "Ignoring unknown argument to MergeLibrary. $_" );
8568
            }
8676
            }
8569
            @libs = MlibEntry( $i, @libs );
8677
            $pLibs = MlibEntry( $i, $pLib, $pLibs );
8570
            $if->ARMerge( $i, \@args, \@libs );
8678
            $if->ARMerge( $i, $pArgs, $pLibs, $pLib );
8571
        }
8679
        }
8572
    }
8680
    }
8573
 
8681
 
-
 
8682
#-------------------------------------------------------------------------------
-
 
8683
#   
-
 
8684
#
-
 
8685
    MakeHeader ("Construct Shared Libraries");
8574
    foreach my $i ( @SHLIBS )
8686
    foreach my $i ( @SHLIBS )
8575
    {
8687
    {
8576
        my( @args, @objects, @libs );
8688
        my $pShlib  = $SHLIBS->Get($i);
8577
 
-
 
8578
        @args    = argsplit( $SHLIB_ARGS{ $i } );
8689
        my $pArgs = $pShlib->getItems('ARGS');
8579
        @objects = argsplit( $SHLIB_OBJS{ $i } );
8690
        my $pObjs = $pShlib->getItems('OBJS');
8580
        @libs    = argsplit( $SHLIB_LIBS{ $i } );
8691
        my $pLibs = $pShlib->getItems('LIBS');
-
 
8692
        my $version = $pShlib->{VERSION};
8581
 
8693
 
8582
        $if->SHLD( $i, \@args, \@objects, \@libs );
8694
        $if->SHLD    ( $i, $pArgs, $pObjs, $pLibs, $version );
8583
        $if->SHLDLINT( $i, \@args, \@objects, \@libs );
8695
        $if->SHLDLINT( $i, $pArgs, $pObjs, $pLibs, $version );
8584
    }
8696
    }
8585
 
8697
 
8586
#-------------------------------------------------------------------------------
8698
#-------------------------------------------------------------------------------
8587
#   Construct Objects
8699
#   Construct Objects
8588
#   For each object within OBJSOURCE construct the following:
8700
#   For each object within OBJSOURCE construct the following:
Line 8964... Line 9076...
8964
MakeDefEntry( "GENERATEDCLEAN",  "=",  CreateNameList( 'clean_generate_', '', ListCleanGenerated() ));
9076
MakeDefEntry( "GENERATEDCLEAN",  "=",  CreateNameList( 'clean_generate_', '', ListCleanGenerated() ));
8965
MakeDefEntry( "INSTALL_HDRS",    "=",  \%INSTALL_HDRS ) if ( %INSTALL_HDRS );
9077
MakeDefEntry( "INSTALL_HDRS",    "=",  \%INSTALL_HDRS ) if ( %INSTALL_HDRS );
8966
MakeDefEntry( "INSTALL_CLSS",    "=",  \%INSTALL_CLSS ) if ( %INSTALL_CLSS );
9078
MakeDefEntry( "INSTALL_CLSS",    "=",  \%INSTALL_CLSS ) if ( %INSTALL_CLSS );
8967
MakeDefEntry( "OBJS",            "=", CreateNameList( '$(OBJDIR)/', ".$::o", \@OBJS) );
9079
MakeDefEntry( "OBJS",            "=", CreateNameList( '$(OBJDIR)/', ".$::o", \@OBJS) );
8968
MakeDefEntry( "SHOBJS",          "=", CreateNameList( '$(OBJDIR)/', ".$::o", \%SHOBJ_LIB ));
9080
MakeDefEntry( "SHOBJS",          "=", CreateNameList( '$(OBJDIR)/', ".$::o", \%SHOBJ_LIB ));
8969
MakeDefEntry( "PROGOBJS",        "=", CreateNameList( '$(OBJDIR)/', ".$::o", \@PROGOBJS ));
9081
MakeDefEntry( "PROGOBJS",        "=", CreateNameList( '', ".$::o", \@PROGOBJS ));
8970
MakeDefEntry( "TESTPROGOBJS",    "=", CreateNameList( '$(OBJDIR)/', ".$::o", \%TESTPROG_OBJS ));
9082
MakeDefEntry( "TESTPROGOBJS",    "=", CreateNameList( '', ".$::o", \@TESTPROGOBJS ));
8971
MakeDefEntry( "LIBS",            "=", CreateNameList( '$(LIBDIR)/', "\$(GBE_TYPE).$::a", \@LIBS)) if ($::a);
9083
MakeDefEntry( "LIBS",            "=", $LIBS->AllTargets() ) if ($::a);
8972
MakeDefEntry( "MLIBS",           "=", CreateNameList( '$(LIBDIR)/', "\$(GBE_TYPE).$::a", \@MLIBS)) if ($::a);
9084
MakeDefEntry( "MLIBS",           "=", $MLIBS->AllTargets() ) if ($::a);
8973
MakeDefEntry( "SHNAMES",         "=", \@SHLIBS );
9085
MakeDefEntry( "SHNAMES",         "=", \@SHLIBS );
8974
MakeDefEntry( "SHDIRS",          "=", CreateNameList( '$(OBJDIR)/', "", \@SHLIBS ));
9086
MakeDefEntry( "SHDIRS",          "=", CreateNameList( '$(OBJDIR)/', "", \@SHLIBS ));
8975
MakeDefEntry( "SHLIBS",          "=", \@SHLIB_TARGETS );
9087
MakeDefEntry( "SHLIBS",          "=", \@SHLIB_TARGETS );
8976
MakeDefEntry( "SCRIPTS",         "=", CreateNameList( '$(BINDIR)/', "", \%SCRIPTS ));
9088
MakeDefEntry( "SCRIPTS",         "=", CreateNameList( '$(BINDIR)/', "", \%SCRIPTS ));
8977
MakeDefEntry( "COPYIN",          "=", \@COPYIN );
9089
MakeDefEntry( "COPYIN",          "=", \@COPYIN );
8978
MakeDefEntry( "PROGS",           "=", CreateNameList( '$(BINDIR)/', "$::exe", \@PROGS ));
9090
MakeDefEntry( "PROGS",           "=", $PROGS->AllTargets() );
8979
MakeDefEntry( "PROGS_EXTRA",     "=", \@PROGS_EXTRA );
9091
MakeDefEntry( "PROGS_EXTRA",     "=", \@PROGS_EXTRA );
8980
MakeDefEntry( "TESTPROGS",       "=", CreateNameList( '$(BINDIR)/', "$::exe", \%TESTPROGS ));
9092
MakeDefEntry( "TESTPROGS",       "=", $TESTPROGS->AllTargets());
8981
MakeDefEntry( "LINTLIBS",        "=", CreateNameList( 'lib_', '_lint', \@LINTLIBS ));
9093
MakeDefEntry( "LINTLIBS",        "=", CreateNameList( 'lib_', '_lint', \@LINTLIBS ));
8982
MakeDefEntry( "LINTSHLIBS",      "=", CreateNameList( 'shlib_', '_lint', \@LINTSHLIBS ));
9094
MakeDefEntry( "LINTSHLIBS",      "=", CreateNameList( 'shlib_', '_lint', \@LINTSHLIBS ));
8983
MakeDefEntry( "LINTPROGS",       "=", CreateNameList( 'prog_', '_lint', \@PROGS ));
9095
MakeDefEntry( "LINTPROGS",       "=", CreateNameList( 'prog_', '_lint', \@PROGS ));
8984
MakeDefEntry( "LINTPROGS",      "+=", CreateNameList( 'prog_', '_lint', \%TESTPROGS ));
9096
MakeDefEntry( "LINTPROGS",      "+=", CreateNameList( 'prog_', '_lint', \@TESTPROGS ));
8985
MakeDefEntry( "PROJECTS",        "=", CreateNameList( 'Project_', '', ListGeneratedProjects(1) ));
9097
MakeDefEntry( "PROJECTS",        "=", CreateNameList( 'Project_', '', ListGeneratedProjects(1) ));
8986
MakeDefEntry( "PROJECTSGEN",     "=", CreateNameList( 'Project_', '', ListGeneratedProjects(0) ));
9098
MakeDefEntry( "PROJECTSGEN",     "=", CreateNameList( 'Project_', '', ListGeneratedProjects(0) ));
8987
MakeDefEntry( "PROJECTSCLEAN",   "=", CreateNameList( 'ProjectClean_', '', \%PROJECTS ));
9099
MakeDefEntry( "PROJECTSCLEAN",   "=", CreateNameList( 'ProjectClean_', '', \%PROJECTS ));
8988
 
9100
 
8989
MakeHeader ("Toolset components");
9101
MakeHeader ("Toolset components");
Line 9102... Line 9214...
9102
endif
9214
endif
9103
 
9215
 
9104
EOF
9216
EOF
9105
 
9217
 
9106
#-------------------------------------------------------------------------------
9218
#-------------------------------------------------------------------------------
9107
#   Special targets
-
 
9108
#
-
 
9109
MakeHeader ("Special targets",
-
 
9110
            "These targets are not used by JATS",
-
 
9111
            "They can only used when the makefile is used directly",
-
 
9112
            "This is not the intended use of this makefile",
-
 
9113
           );
-
 
9114
 
-
 
9115
print MAKEFILE <<EOF;
-
 
9116
.PHONY:		debug
-
 
9117
debug:
-
 
9118
	@\$(MAKE) -f \$(GBE_PLATFORM).mk DEBUG=1 build
-
 
9119
 
-
 
9120
.PHONY:		prod
-
 
9121
prod:
-
 
9122
	@\$(MAKE) -f \$(GBE_PLATFORM).mk DEBUG=0 build
-
 
9123
 
-
 
9124
EOF
-
 
9125
 
-
 
9126
    #
-
 
9127
    #   It would appear that these targets are not directly available
-
 
9128
    #   They can only be accessed if the makefile is used directly, and this
-
 
9129
    #   is not the intended use
-
 
9130
    #
-
 
9131
    MakePrint("#   PROGS\n");
-
 
9132
    foreach my $i ( @PROGS ) {
-
 
9133
        MakePrint "${i}:\tmake_init \$(BINDIR)/${i}$::exe\n";
-
 
9134
    }
-
 
9135
    MakeNewLine();
-
 
9136
 
-
 
9137
    MakePrint("#   TESTPROGS\n");
-
 
9138
    foreach my $i ( sort keys %TESTPROGS ) {
-
 
9139
        MakePrint "${i}:\tmake_init \$(BINDIR)/${i}$::exe\n";
-
 
9140
    }
-
 
9141
    MakeNewLine();
-
 
9142
 
-
 
9143
    MakePrint("#   PACKAGE_DIST\n");
-
 
9144
    foreach my $i ( sort keys %PACKAGE_DIST ) {
-
 
9145
        my(@sets) = split( /$;/, $PACKAGE_DIST{$i} );
-
 
9146
 
-
 
9147
        MakeEntry( "package-${i}:\tmake_init package_setALL",
-
 
9148
                "\n", " package_set", "", @sets );
-
 
9149
    }
-
 
9150
    MakeNewLine();
-
 
9151
 
-
 
9152
#-------------------------------------------------------------------------------
-
 
9153
#   Standard rules
9219
#   Standard rules
9154
#
9220
#
9155
MakeHeader ("Standard rules");
9221
MakeHeader ("Standard rules");
9156
 
9222
 
9157
    print MAKEFILE <<EOF;
9223
    print MAKEFILE <<EOF;
Line 9180... Line 9246...
9180
	"  rmlitter:        remove litter (core, bak, tmp, err and cmd files)\\n"\\
9246
	"  rmlitter:        remove litter (core, bak, tmp, err and cmd files)\\n"\\
9181
	"  clean:           delete generate, obj, libraries and programs\\n"\\
9247
	"  clean:           delete generate, obj, libraries and programs\\n"\\
9182
	"  unbuild:         delete everything which can be remade\\n"\\
9248
	"  unbuild:         delete everything which can be remade\\n"\\
9183
	"  clobber:         unbuilds and deletes packages\\n"\\
9249
	"  clobber:         unbuilds and deletes packages\\n"\\
9184
EOF
9250
EOF
9185
if ( scalar @PROGS ) {
-
 
9186
    print MAKEFILE <<EOF;
-
 
9187
	"\\n"\\
-
 
9188
	"Application targets:\\n"\\
-
 
9189
	"  @PROGS\\n"\\
-
 
9190
EOF
-
 
9191
}
-
 
9192
if ( %TESTPROGS ) {
-
 
9193
    print MAKEFILE <<EOF;
-
 
9194
	"\\n"\\
-
 
9195
	"Test Application targets:\\n"\\
-
 
9196
EOF
-
 
9197
        MakeEntry( "\t\"   ", "\\n\"\\\n", " ", "", sort keys(%TESTPROGS) );
-
 
9198
}
-
 
9199
if ( %PACKAGE_DIST ) {
-
 
9200
    print MAKEFILE <<EOF;
-
 
9201
	"\\n"\\
-
 
9202
	"Package distributions:\\n"\\
-
 
9203
EOF
-
 
9204
    foreach my $i ( sort keys %PACKAGE_DIST ) {
-
 
9205
        my(@sets) = split( /$;/, $PACKAGE_DIST{$i} );
-
 
9206
        MakeEntry( "\t\"   ${i}, using set(s)", "\\n\"\\\n", " ", "", @sets );
-
 
9207
    }
-
 
9208
}
-
 
9209
 
9251
 
9210
    print MAKEFILE <<EOF;
9252
    print MAKEFILE <<EOF;
9211
	"\\n"
9253
	"\\n"
9212
 
9254
 
9213
make_clean:
9255
make_clean:
Line 9224... Line 9266...
9224
.PHONY:		rmlitter
9266
.PHONY:		rmlitter
9225
rmlitter:
9267
rmlitter:
9226
	-\$(XX_PRE)( echo "Removing litter"; \\
9268
	-\$(XX_PRE)( echo "Removing litter"; \\
9227
		\$(touch) _delete.bak _delete.tmp _delete.err ;\\
9269
		\$(touch) _delete.bak _delete.tmp _delete.err ;\\
9228
		\$(rm) -f core *.bak *.tmp *.err ;\\
9270
		\$(rm) -f core *.bak *.tmp *.err ;\\
9229
		for subdir in \$(SHDIRS) \$(OBJDIR) ; do \\
9271
		for subdir in \$(SHDIRS) ; do \\
-
 
9272
			if [ -d \$\$subdir ] ; then \\
-
 
9273
				( cd \$\$subdir ;\\
-
 
9274
				\$(touch) _delete.err _delete.cmd ;\\
-
 
9275
				\$(rm) -r * ; );\\
-
 
9276
			fi ;\\
-
 
9277
		done;\\
-
 
9278
		for subdir in \$(OBJDIR) ; do \\
9230
			if [ -d \$\$subdir ] ; then \\
9279
			if [ -d \$\$subdir ] ; then \\
9231
				( cd \$\$subdir ;\\
9280
				( cd \$\$subdir ;\\
9232
				\$(touch) _delete.err _delete.cmd ;\\
9281
				\$(touch) _delete.err _delete.cmd ;\\
9233
				\$(rm) -r *.err *.cmd ; );\\
9282
				\$(rm) -r *.err *.cmd ; );\\
9234
			fi ;\\
9283
			fi ;\\
Line 9249... Line 9298...
9249
 
9298
 
9250
#
9299
#
9251
#   Dependencies for 'make_dir'
9300
#   Dependencies for 'make_dir'
9252
#
9301
#
9253
my @mkdirdep;
9302
my @mkdirdep;
9254
push @mkdirdep, '$(GBE_OBJDIR)' if ( @CSRCS || @CXXSRCS || @OBJS || %PROG_OBJS || %TESTPROG_OBJS );
9303
push @mkdirdep, '$(GBE_OBJDIR)' if ( @CSRCS || @CXXSRCS || @OBJS || @PROGOBJS || @TESTPROGOBJS );
9255
push @mkdirdep, '$(SHDIRS)'     if ( %SHOBJ_LIB || @SHLIBS);
9304
push @mkdirdep, '$(SHDIRS)'     if ( %SHOBJ_LIB || @SHLIBS);
9256
push @mkdirdep, '$(GBE_LIBDIR)' if ( @LIBS || @MLIBS || @SHLIBS || %INSTALL_LIBS || %PACKAGE_LIBS );
9305
push @mkdirdep, '$(GBE_LIBDIR)' if ( @LIBS || @MLIBS || @SHLIBS || %INSTALL_LIBS || %PACKAGE_LIBS );
9257
push @mkdirdep, '$(GBE_BINDIR)' if ( @SHLIBS || %SCRIPTS || @PROGS || %TESTPROGS || %INSTALL_PROGS || %PACKAGE_PROGS );
9306
push @mkdirdep, '$(GBE_BINDIR)' if ( @SHLIBS || %SCRIPTS || @PROGS || @TESTPROGS || %INSTALL_PROGS || %PACKAGE_PROGS );
9258
 
9307
 
9259
#
9308
#
9260
#   Actions for for 'unobj'
9309
#   Actions for for 'unobj'
9261
#
9310
#
9262
my @unobjact;
9311
my @unobjact;
9263
push @unobjact, RmFilesCmd( 'OBJS' )            if ( @OBJS );
9312
push @unobjact, RmFilesCmd( 'OBJS' )            if ( @OBJS );
9264
push @unobjact, RmFilesCmd( 'SHOBJS' )          if ( %SHOBJ_LIB );
9313
push @unobjact, RmFilesCmd( 'SHOBJS' )          if ( %SHOBJ_LIB );
9265
push @unobjact, RmFilesCmd( 'PROGOBJS' )        if ( @PROGOBJS );
9314
push @unobjact, RmFilesCmd( 'PROGOBJS' )        if ( @PROGOBJS );
9266
push @unobjact, RmFilesCmd( 'TESTPROGOBJS' )    if ( %TESTPROG_OBJS );
9315
push @unobjact, RmFilesCmd( 'TESTPROGOBJS' )    if ( @TESTPROGOBJS );
9267
push @unobjact, RmFilesCmd( 'TOOLSETOBJS' )     if ( @TOOLSETOBJS );
9316
push @unobjact, RmFilesCmd( 'TOOLSETOBJS' )     if ( @TOOLSETOBJS );
9268
 
9317
 
9269
#
9318
#
9270
#   Dependencies for 'make_lib'
9319
#   Dependencies for 'make_lib'
9271
#
9320
#
Line 9351... Line 9400...
9351
 
9400
 
9352
#
9401
#
9353
#   Dependencies for 'lint_prog'
9402
#   Dependencies for 'lint_prog'
9354
#
9403
#
9355
my @proglintdep;
9404
my @proglintdep;
9356
push @proglintdep, 'lint_init', '$(GBE_OBJDIR)', '$(GBE_BINDIR)', '$(LINTPROGS)' if ( @PROGS || %TESTPROGS );
9405
push @proglintdep, 'lint_init', '$(GBE_OBJDIR)', '$(GBE_BINDIR)', '$(LINTPROGS)' if ( @PROGS || @TESTPROGS );
9357
 
9406
 
9358
#
9407
#
9359
#   Actions for 'unmake_prog'
9408
#   Actions for 'unmake_prog'
9360
#
9409
#
9361
my @unprogact;
9410
my @unprogact;
Line 9364... Line 9413...
9364
 
9413
 
9365
#
9414
#
9366
#   Dependencies for 'lint_prog'
9415
#   Dependencies for 'lint_prog'
9367
#
9416
#
9368
my @testprogdep;
9417
my @testprogdep;
9369
push @testprogdep, '$(GBE_OBJDIR)', '$(GBE_BINDIR)', '$(TESTPROGS)' if ( %TESTPROGS );
9418
push @testprogdep, '$(GBE_OBJDIR)', '$(GBE_BINDIR)', '$(TESTPROGS)' if ( @TESTPROGS );
9370
 
9419
 
9371
#
9420
#
9372
#   Dependencies for 'run_tests' and friends
9421
#   Dependencies for 'run_tests' and friends
9373
#
9422
#
9374
my @untestprogact;
9423
my @untestprogact;
9375
push @untestprogact ,RmFilesCmd( 'TESTPROGS' ) if ( %TESTPROGS );
9424
push @untestprogact ,RmFilesCmd( 'TESTPROGS' ) if ( @TESTPROGS );
9376
 
9425
 
9377
#
9426
#
9378
#   Dependencies for 'generated'
9427
#   Dependencies for 'generated'
9379
#
9428
#
9380
my @generatedep;
9429
my @generatedep;
Line 10051... Line 10100...
10051
{
10100
{
10052
    my( $file ) = @_;
10101
    my( $file ) = @_;
10053
    return "\t\$(call UnpackageFile,$file)";
10102
    return "\t\$(call UnpackageFile,$file)";
10054
}
10103
}
10055
 
10104
 
10056
 
-
 
10057
1;
10105
1;
10058
 
10106