Subversion Repositories DevTools

Rev

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

Rev 255 Rev 261
Line 1... Line 1...
1
# -*- mode: perl; tabs: 8; indent-width: 4; show-tabs: yes; -*-
1
# -*- mode: perl; tabs: 8; indent-width: 4; show-tabs: yes; -*-
2
# Copyright (C) 1998-2004 ERG Transit Systems, All rights reserved
2
# Copyright (C) 1998-2008 ERG Transit Systems, All rights reserved
3
#
3
#
4
# Module name   : makelib.pl2
4
# Module name   : makelib.pl2
5
# Module type   : Makefile system
5
# Module type   : Makefile system
6
#
6
#
7
# Description:
7
# Description:
Line 9... Line 9...
9
#
9
#
10
# Notes:                *** DO NOT DETAB ***
10
# Notes:                *** DO NOT DETAB ***
11
#       Beware the use of space v's tab characters within the
11
#       Beware the use of space v's tab characters within the
12
#       makefile generation sessions.
12
#       makefile generation sessions.
13
#
13
#
14
# Version   Who      Date        Description
-
 
15
#           APY      11/08/99    Created EMBEDDED version (from CB)
-
 
16
#                    11/10/99    PushObjects
-
 
17
#           APY      26/11/99    GBE_DEPENDS defines platform/toolset
-
 
18
#                                  dependencies, used by the 'makefile'
-
 
19
#                                  rules invoked by the build system
-
 
20
#                                  (See makefile.pl for details)
-
 
21
#           APY      09/12/99    toolset cleanup,
-
 
22
#                                   TOOLSETDIRS generated directories
-
 
23
#                                   TOOLSETPROGS generated programs
-
 
24
#                                   TOOLSETTREE generated directories trees
-
 
25
#           APY      03/03/00    Support ! within platform specifications
-
 
26
#           APY      09/03/00    Inc/Src/Lib paths defines within 'global'
-
 
27
#                                sections are now ordered after 'local'
-
 
28
#                                definitions (v1.1).
-
 
29
#                    13/03/00    LIBDIR wasn't explicity defined.
-
 
30
#                                Removed -e switch from usage echo statement
-
 
31
#                    20/03/00    NOSCMDEPEND, allowing clean without
-
 
32
#                                dependency tests against build env.
-
 
33
#                    21/03/00    remove *.cmd during clean operations
-
 
34
#                    22/03/00    AddIncDir(), --NoDepend switch
-
 
35
#           APY      06/04/00    Pass arguments thru PlatformRequire() .
-
 
36
#           APY      17/05/00    Added pl and awk to known extensions
-
 
37
#                    05/06/00    Gave GBE_DEPENDS a default value of <NUL>
-
 
38
#                    15/06/00    PROGOBJS and limited source processing
-
 
39
#                                  within Prog() statements
-
 
40
#                                .PHONY default usage
-
 
41
#                                v1.20
-
 
42
#           GM       xx/08/00    Release build option
-
 
43
#           APY      03/10/00    Renamed several internal rules.
-
 
44
#           APY      02/10/00    UNIX builds
-
 
45
#                    13/11/00    - Handle empty "exe" definitions
-
 
46
#                                - Under unix, Prog(-Lx, -Lx) switch imply -Llibx.a
-
 
47
#           APY      29/11/00    Solaris builds,
-
 
48
#                                - Shared library support
-
 
49
#                                - Required to push library target definition
-
 
50
#                                  into ToolsetAR macros.
-
 
51
#                                - GBE_TARGET, allowing auto hosted PLATFORMS
-
 
52
#                                  (eg SOLARIS, results in SOLARIS_sparc)
-
 
53
#                                - Prog() and Lib() didn't delete objects generated
-
 
54
#                                  from in-line source references.
-
 
55
#                                - Completed package support
-
 
56
#                                OPTIONS
-
 
57
#           APY      27/12/00    'clean' no longer uninstalls, 'use clean uninstall'
-
 
58
#           APY      02/01/01    v2.0
-
 
59
#           APY      12/01/01    Added 'interface' to standard include paths.
-
 
60
#           APY      17/01/01    InstallProg()/PackageProg() defaults to handling
-
 
61
#                                target as a script installation if unknown.
-
 
62
#           APY      24/02/01    Corrected LibNameSplit()
-
 
63
#           GT       26/02/01    TestProg()
-
 
64
#           APY      26/02/01    v2.01
-
 
65
#           APY      07/03/01    - SRC_ARGS parsing using incorrect key,
-
 
66
#                                  which disabled source argument support.
-
 
67
#                                - Following variables can be set via env,
-
 
68
#                                     ScmDebug   = GBE_DEBUG   (0|1)
-
 
69
#                                     ScmVerbose = GBE_VERBOSE (0|1)
-
 
70
#           APY      07/03/01    v2.02, toolset cleanup,
-
 
71
#                                  ToolsetDirTree() generated directories trees
-
 
72
#                                  which recursively remove the specified path.
-
 
73
#                                     <<USE WITH CAUTION, try like "rm -f *">>
-
 
74
#           APY      25/05/01    AddSrcDir() directive was broken by
-
 
75
#                                shlib support.
-
 
76
#           APY      29/06/01    WIN32 support using ActivePerl
-
 
77
#                                v2.1
-
 
78
#           APY      24/09/01    WIN32 dll support (dll naming)
-
 
79
#                                v2.2
-
 
80
#           APY      18/02/02    --expert switch
-
 
81
#                                v2.21
-
 
82
#           APY      26/02/02    - Subdir directory install corrected,
-
 
83
#                                  using StripFileExt.
-
 
84
#                                - $ScmMajor and $ScmMinor
-
 
85
#                    27/02/02    - ScmTargetMach override to GBE_MACHTYPE,
-
 
86
#                                  to support cross compiler toolsets.
-
 
87
#                                - ScmPackage global switch, that disables
-
 
88
#                                  packaging support to support older
-
 
89
#                                  makefiles.
-
 
90
#                    04/05/02    - $mkdiract incorrectly referenced
-
 
91
#                                  LIBDIRS, should modified to LIBDIR.
-
 
92
#                                - modeline inserted into generated image.
-
 
93
#                    05/07/02    - InstallHdr() should search SRCS using the
-
 
94
#                                  basename only (ie StripDir).
-
 
95
#                    16/07/02    - The above InstallHdr() change implied that
-
 
96
#                                  installed images must be basename unique,
-
 
97
#                                  breaking several existing builds. Added
-
 
98
#                                  --Abs attribute, bypassing the SRCS list
-
 
99
#                                  resolved check, assuming an absolute path
-
 
100
#                                  allowing non-unique installations.
-
 
101
#                                  (eg ./eosboot.h and CPU/eosboot.h)
-
 
102
#                                - 2.24
-
 
103
# 2.30      APY      09/02/04    o CORE_DEVL merge 1.9.6
-
 
104
#                                  New options;
-
 
105
#                                    --version, --pversion, --name,
-
 
106
#                                    --includes, --libs
-
 
107
#                                  PDB installation and packaging
-
 
108
#                                  New macros
-
 
109
#                                    GBE_PBASE
-
 
110
#                                    BUILDNAME, BUILDVER and BUILDPREVIOUSVER
-
 
111
#                                    FORCECCOMPILE
-
 
112
#                                  --Shared=current option
-
 
113
#                                o 'Include' directive
-
 
114
#                                o LinkPkgArchive support
-
 
115
#                                   - Include platform.rul
-
 
116
#                                   - LINCDIRS allowing mkdepend trimming
-
 
117
#                                     of package directories.
-
 
118
#                                o ScmTargetHost override of ScmHost
-
 
119
#                                  to support cross compiler toolsets.
-
 
120
#                                o MAKTAG filtering
-
 
121
#                                o Trim drive from cwd.
-
 
122
#                                o PackageHdr, --Strip option
-
 
123
#                                o SetProjectBase
-
 
124
#                                o --interface switch
-
 
125
#                                o Ignore case during platform compares.
-
 
126
#                                o Corrected several var references due
-
 
127
#                                  to 'strict' testing.
-
 
128
#                                o GBE_HOST
-
 
129
#                    16/02/04    o Trim whitespace during ActivePlaform tests
-
 
130
#                                o Strip leading/trailing whitespace
-
 
131
#                                  from platform names.
-
 
132
#                                o --arg switch
-
 
133
#                    18/02/04    o InstallHdr, --Strip option
-
 
134
#                    24/02/04    o Import 'build.cfg'.
-
 
135
#                                o GBE_ARGS
-
 
136
#                                o GBE_PRODUCT
-
 
137
#           DDP      04/03/04    o Added MergeLibrary directive to formalise
-
 
138
#                                  the process of merging two or more libraries
-
 
139
#                    09/03/04    o Moved PDB installation and packaging into the
-
 
140
#                                  VCWIN32 toolset - where it belongs.
-
 
141
#                                o Modified used of chmod to use a -f flag
-
 
142
#                                  to supress warning messages when the file
-
 
143
#                                  does not exist.
-
 
144
#                    12/03/04    o Consolidated the packaging code
-
 
145
#                                o mkdir -p does not like a trailing "/"
-
 
146
#                                  It generates a useless warning message
-
 
147
#                                  Ensure that traling "/"s are removed
-
 
148
#                                o Ensure that the "depend" target creates
-
 
149
#                                  directories before using them
-
 
150
#                    23/03/03    o Include target specific paths within the
-
 
151
#                                  interface/include directory to support
-
 
152
#                                  both include.xxx and include/xxx style
-
 
153
#                                  of paths.
-
 
154
#                    30/03/04    o Add CompileOptions
-
 
155
#                                  Remove leading/trailing spaces from file
-
 
156
#                                  and directory names
-
 
157
#                    07/04/04    o Add support for Product specialisation
-
 
158
#                                  Add VARIABLES to allow the PRODUCT and the BASE
-
 
159
#                                  to be used when installing.
-
 
160
#           APY      14/04/04    ActivePlatform must accumulate ! expressions.
-
 
161
#                    16/04/04    o INCDIR_LOCAL expanded to be,
-
 
162
#                                       inc/$Platform
-
 
163
#                                       inc/$Product
-
 
164
#                                       inc/$Target
-
 
165
#                                       inc
-
 
166
#                                o {Install|Package}{Hdr|Lib|Prog},
-
 
167
#                                       --Product, --Product, --Target options
-
 
168
#                                o PackageProg,
-
 
169
#                                       --Prod and --Debug options
-
 
170
#                                o GBE_TARGET redefined as the products base
-
 
171
#                                  platform, defaults (as normal) to
-
 
172
#                                  GBE_PLATFORM.
-
 
173
#                                o InstallLib upgrading to std interface.
-
 
174
#                                o PKGDIR
-
 
175
#                                   - redefined as PKGDIR/$Pbase
-
 
176
#                                   - Packaging directives strip leading
-
 
177
#                                     $Pbase from --Dir specification.
-
 
178
#                    19/04/04    o MakePaths
-
 
179
#                                   Common search path functionality
-
 
180
#                                   Specialisation of product includes.
-
 
181
#                                   Restored previous !product includes.
-
 
182
#                                o PackageLib and PackageJar,
-
 
183
#                                   --Prod and --Debug options
-
 
184
#                                o AddDir/AddSrcDir/AddIncDir/AddLibDir,
-
 
185
#                                   --NoWarn
-
 
186
#                    20/04/04    o Merged common target directory processing
-
 
187
#                                  of Install/Package directives creating
-
 
188
#                                  __TargetDir
-
 
189
#                                o Add[Src|Inc|Lib]Dir wont generate
-
 
190
#                                  warnings if the path contains embedded
-
 
191
#                                  variables eg. $(GBE_ROOT).
-
 
192
#                                o ActivePlatform --Target/Platform/Product
-
 
193
# 2.32               21/04/04    o __TargetDir, added 'pdir parameter.
-
 
194
#                    03/05/04    o fixes to 'release' generation
-
 
195
#                                o Library ifdef & ifndef conditionals (restored)
-
 
196
#                                  e.g  (--ifdef=TEST, -ltest)
-
 
197
#            DDP     05/05/04    o Generate DSP file
-
 
198
#            APY     06/05/04    TOOLSET/common
-
 
199
#                    12/05/04    PlatformEntry
-
 
200
#                    12/05/04    - Installation directories, mirrored
-
 
201
#                                  defaults of package directory.
-
 
202
#                                - Generate ITAG defined, requiring explicit
-
 
203
#                                  rules for each SUBDIR, plus maintainence of
-
 
204
#                                  'gdbdir' files to remove timestamp issues.
-
 
205
#                                - Seperate IFLAGS for libraries, shlibraries
-
 
206
#                                  and application stages.
-
 
207
#                                - mkdiract replaced within mkdirdep and
-
 
208
#                                  explicit mkdir rules.
-
 
209
#                                - ScmToolsetGenerate and ScmToolsetIFLAG3
-
 
210
#                                  toolset options.
-
 
211
#                                - Uninstall/package, attribute/chmod test
-
 
212
#                                  and set.
-
 
213
#                                - Noisy file removal via GBE_RM
-
 
214
#                                - v2.33
-
 
215
#                     20/05/04   - MergeLibrary syntax extended.
-
 
216
#                     02/07/04   - Added support for --List=xxx in Src directives
-
 
217
#                                  Will create a LIST_xxx array for the user
-
 
218
#                     22/07/04   - Merge common Lib and Prog directives.
-
 
219
#           APY       04/08/04   - Makeinterface
-
 
220
#                                - PLATFORM definition searching
-
 
221
#                                - RmfileCmd, silent clean
-
 
222
#                                - v2.34
-
 
223
#
-
 
224
# $Source: /cvsroot/etm/devl/TOOLS/makelib.pl2,v $
-
 
225
# $Revision: 1.34 $ $Date: 2004/10/20 05:56:04 $ $State: Exp $
-
 
226
# $Author: ayoung $ $Locker:  $
-
 
227
#............................................................................#
-
 
228
 
-
 
229
##############################################################################
14
##############################################################################
230
# Globals:
15
# Globals:
231
#  $ScmVersion          Makelib.pl2 version
16
#  $ScmVersion          Makelib.pl2 version
232
#  $ScmRoot             Command line parameter that gives the root directory
17
#  $ScmRoot             Command line parameter that gives the root directory
233
#                       location for this directory tree.
18
#                       location for this directory tree.
Line 338... Line 123...
338
#....
123
#....
339
 
124
 
340
require 5.006_001;
125
require 5.006_001;
341
use strict;
126
use strict;
342
use warnings;
127
use warnings;
-
 
128
use Getopt::Long;
343
use Data::Dumper;
129
use Data::Dumper;
344
use JatsEnv;
130
use JatsEnv;
345
use MakeEntry;
131
use MakeEntry;
346
use JatsLocateFiles;
132
use JatsLocateFiles;
347
use JatsDPackage;
133
use JatsDPackage;
348
 
134
 
349
 
135
 
350
our $ScmVersion             = "2.34";
136
our $ScmVersion             = "2.34";
351
our $ScmForce               = 0;
-
 
352
our $ScmGlobal              = 0;
137
our $ScmGlobal              = 0;
353
our $ScmRelease             = 0;
-
 
354
our $ScmExpert              = 0;
138
our $ScmExpert              = 0;
355
our $ScmInterface           = "interface";      # default 'interface'
139
our $ScmInterface           = "interface";      # default 'interface'
356
our $ScmPackage             = 1;                # package active by default.
140
our $ScmPackage             = 1;                # package active by default.
357
our $ScmProcessingRootMake  = 0;                # Processing root makefile.pl
141
our $ScmProcessingRootMake  = 0;                # Processing root makefile.pl
358
our $ScmPlatformSeen        = 0;                # Platform directive has been seen
142
our $ScmPlatformSeen        = 0;                # Platform directive has been seen
359
 
143
 
360
our $ScmToolsetVersion      = "";               # version of toolset
144
our $ScmToolsetVersion      = "";               # version of toolset
361
our $ScmToolsetIFLAG3       = 0;                # IFLAGS3 support disabled
-
 
362
our $ScmToolsetGenerate     = 1;                # generate active by default.
145
our $ScmToolsetGenerate     = 1;                # generate active by default.
363
our $ScmToolsetProgDependancies = 1;            # 1: Write program dependancies
146
our $ScmToolsetProgDependancies = 1;            # 1: Write program dependancies
364
                                                # 0: Don't write progdeps. Prog is Phony
147
                                                # 0: Don't write progdeps. Prog is Phony
365
our $ScmToolsetProgSource   = ();               # Toolset Program Source
148
our $ScmToolsetProgSource   = ();               # Toolset Program Source
366
our $ScmRoot                = "";
149
our $ScmRoot                = "";
Line 466... Line 249...
466
our %TESTPROGS              = ();
249
our %TESTPROGS              = ();
467
our %TESTPROG_OBJS          = ();
250
our %TESTPROG_OBJS          = ();
468
our %TESTPROG_LIBS          = ();
251
our %TESTPROG_LIBS          = ();
469
our %TESTPROG_ARGS          = ();
252
our %TESTPROG_ARGS          = ();
470
 
253
 
-
 
254
our %PROGS                  = ();           # Simplify tracking of progs
471
our @PROGS                  = ();
255
our @PROGS                  = ();
472
our @PROGS_EXTRA            = ();
256
our @PROGS_EXTRA            = ();
473
our %PROG_OBJS              = ();
257
our %PROG_OBJS              = ();
474
our %PROG_LIBS              = ();
258
our %PROG_LIBS              = ();
475
our %PROG_ARGS              = ();
259
our %PROG_ARGS              = ();
Line 503... Line 287...
503
#our $CurrentDate           = "";
287
#our $CurrentDate           = "";
504
#our $Cwd                   = "";
288
#our $Cwd                   = "";
505
 
289
 
506
our @GENERATE_FILES         = ();
290
our @GENERATE_FILES         = ();
507
our %DEPLOYPACKAGE          = ();
291
our %DEPLOYPACKAGE          = ();
508
 
292
our %MakeTags;
509
 
293
 
510
#
294
#
511
#   Some toolset options that affect the generation of the makefile
295
#   Some toolset options that affect the generation of the makefile
512
#
296
#
513
our $UseAbsObjects          = 0;                # Default is relative paths to objects
297
our $UseAbsObjects          = 0;                # Default is relative paths to objects
Line 605... Line 389...
605
            AddLibDir( "*", $elem ) if ($elem);
389
            AddLibDir( "*", $elem ) if ($elem);
606
        }
390
        }
607
        $ScmGlobal = $global;                   # Restore global status ...
391
        $ScmGlobal = $global;                   # Restore global status ...
608
    }
392
    }
609
 
393
 
610
    #
-
 
611
    #   Ensure that Data::Dumper module is available and has been loaded
-
 
612
    #
-
 
613
    $::ScmProjectSupport = (eval "require Data::Dumper")
-
 
614
        if ( $::ScmProjectSupport );
-
 
615
 
-
 
616
 
-
 
617
#.. Determine the value of $ScmMachType
394
#.. Determine the value of $ScmMachType
618
#   In the makefile GBE_MACHTYPE will be set to $ScmMachType.
395
#   In the makefile GBE_MACHTYPE will be set to $ScmMachType.
619
#
396
#
620
#   There is an compatibility issue here.
397
#   There is an compatibility issue here.
621
#   A lot of (legacy) package.pl files use GBE_MACHTYPE to specify platform
398
#   A lot of (legacy) package.pl files use GBE_MACHTYPE to specify platform
Line 667... Line 444...
667
                if ( $::Pbase ne $::ScmBuildPackage );
444
                if ( $::Pbase ne $::ScmBuildPackage );
668
        }
445
        }
669
    }
446
    }
670
}
447
}
671
 
448
 
-
 
449
#-------------------------------------------------------------------------------
-
 
450
# Function        : CommandLine
672
 
451
#
-
 
452
# Description     : Process the command line.
-
 
453
#                   Arguments describes below
-
 
454
#
-
 
455
# Arguments       : ARG0        - Root of the project
-
 
456
#                   ARG1        - Path to this script
-
 
457
#                   ARG2        - Target Platform
-
 
458
#
-
 
459
#                   Options follow
-
 
460
#                       --interface=name    - Name of interface dir
-
 
461
#                       --arg=xxx           - Platform argument
-
 
462
#
-
 
463
#                   Otherwise display a usage message
-
 
464
#
-
 
465
# Returns         : Nothing
-
 
466
#
673
sub CommandLine
467
sub CommandLine
674
{
468
{
675
    my ( $argc, $element );
469
    Verbose ("Command Line: @ARGV");
676
 
470
 
-
 
471
    #
-
 
472
    #   Extract options first
-
 
473
    #
-
 
474
    my $opt_help = 0;
-
 
475
    my $result = GetOptions (
-
 
476
                "help+"         => \$opt_help,
-
 
477
                "interface=s"   => \$::ScmInterface,
-
 
478
                "arg=s"         => sub{ AddPlatformArg( "--$_[1]") }
-
 
479
                );
-
 
480
    Usage() if ( $opt_help || !$result );
-
 
481
 
-
 
482
    #
677
# Arguments
483
    # Need 3 Arguments
678
#
484
    #
679
    $ScmRoot     = ${ARGV[0]};
485
    $ScmRoot     = ${ARGV[0]};
680
    $ScmRoot = RelPath( $ScmRoot );
486
    $ScmRoot     = RelPath( $ScmRoot );
681
    $ProjectBase = $ScmRoot;
487
    $ProjectBase = $ScmRoot;
682
 
488
 
683
    $ScmMakelib  = ${ARGV[1]};
489
    $ScmMakelib  = ${ARGV[1]};
684
    $ScmPlatform = ${ARGV[2]};
490
    $ScmPlatform = ${ARGV[2]};
685
    $ScmTarget   = $ScmPlatform;
491
    $ScmTarget   = $ScmPlatform;
686
 
492
 
687
    Message ("[$ScmPlatform] Generate Makefile");
493
    Message ("[$ScmPlatform] Generate Makefile");
688
    Debug( "root\t=$ScmRoot" );
494
    Debug( "root\t=$ScmRoot" );
689
    Debug( "makelib\t=$ScmMakelib" );
495
    Debug( "makelib\t=$ScmMakelib" );
690
    Debug( "platform\t=$ScmPlatform" );
496
    Debug( "platform\t=$ScmPlatform" );
691
 
-
 
692
    $argc        = 3;
-
 
693
    while ($_ = $ARGV[ $argc++ ]) {
-
 
694
 
-
 
695
        last if ( ! /^-/ );                     # not an option
-
 
696
 
-
 
697
        Debug( "option:    $_" );
-
 
698
 
-
 
699
        /^-h$|^-help$|^--version$|^--help$|^--usage$|^-?$/ && Usage();
-
 
700
 
-
 
701
                                                # long arguments
-
 
702
        next if (/^--interface=(.*)/ && ($ScmInterface = $1));
-
 
703
        next if (/^--arg=(.*)/ && AddPlatformArg( "--$1"));
-
 
704
        next if (/^--release/ && ($ScmRelease = 1));
-
 
705
        next if (/^--dist/ && ($ScmRelease = 2));
-
 
706
        next if (/^--expert/ && ($ScmExpert = 1));
-
 
707
        next if (/^--all/);
-
 
708
 
-
 
709
        last if (/^--$/);                       # End of long arguments
-
 
710
 
-
 
711
        if (/^-D(.*)/) {
-
 
712
            if ($1) {
-
 
713
                $::ScmDebug = $1;
-
 
714
            } else {
-
 
715
                $::ScmDebug = $ARGV[0];
-
 
716
                $argc++;
-
 
717
            }
-
 
718
            next;
-
 
719
        }
-
 
720
 
-
 
721
        next if (/^-V/ && ($::ScmVerbose = 1));
-
 
722
 
-
 
723
        next if (/^-F/ && ($ScmForce = 1));
-
 
724
 
-
 
725
        /^-.*/ && Usage();
-
 
726
    }
-
 
727
}
497
}
728
 
498
 
729
#   Usage ---
499
#   Usage ---
730
#       Command line usage help.
500
#       Command line usage help.
731
#..
501
#..
732
 
502
 
733
sub Usage
503
sub Usage
734
{
504
{
735
    print "" .
-
 
736
"Usage: perl Makefile.pl2 <ROOTDIR> <Makelib.pl2> <PLATFORM> [options ...]
505
    Error ( "Usage: perl makefile.pl2 <ROOTDIR> <makelib.pl2> <PLATFORM> [options ...]",
737
Valid options:
-
 
738
\t-V                Verbose mode
-
 
739
\t-D[debug-level]   Set the debug level
-
 
740
\t-F                Force rebuild
506
            "Valid options:",
741
\t--release         Create a release sandbox
-
 
742
\t--dist            Create a distribution sandbox, like a 'release'
507
            "    --interface=name  Set interface directory",
743
\t                  except all GBE support files are removed (eg CVS).
508
            "    --arg=text        Specify platform argument",
744
\n";
-
 
745
    exit(42);
509
            );
746
}
510
}
747
 
511
 
748
 
512
 
749
#-------------------------------------------------------------------------------
513
#-------------------------------------------------------------------------------
750
# Function        : SubDir
514
# Function        : SubDir
Line 1083... Line 847...
1083
}
847
}
1084
 
848
 
1085
 
849
 
1086
sub ToolsetDefines
850
sub ToolsetDefines
1087
{
851
{
1088
    my( $script ) = @_;
-
 
1089
 
-
 
1090
    Debug2( "ToolsetDefines(@_)" );
852
    Debug2( "ToolsetDefines(@_)" );
1091
 
853
 
1092
    Defines( "$::GBE_CONFIG/TOOLSET", $script );
854
    Defines( "$::GBE_CONFIG/TOOLSET", @_ );
1093
}
855
}
1094
 
856
 
1095
 
857
 
1096
sub ToolsetDir
858
sub ToolsetDir
1097
{
859
{
1098
    my( @dirs ) = @_;
-
 
1099
 
-
 
1100
    Debug2( "ToolsetDir(@_)" );
860
    Debug2( "ToolsetDir(@_)" );
1101
 
861
 
1102
    ADD:
-
 
1103
    foreach my $dir ( @dirs )
-
 
1104
    {
-
 
1105
        foreach my $temp ( @TOOLSETDIRS ) {
-
 
1106
            next ADD if ($temp eq $dir);
-
 
1107
        }
-
 
1108
        push( @TOOLSETDIRS, $dir );
862
    UniquePush ( \@TOOLSETDIRS, @_ );
1109
    }
-
 
1110
}
863
}
1111
 
864
 
1112
 
865
 
1113
sub ToolsetDirTree
866
sub ToolsetDirTree
1114
{
867
{
1115
    my( @dirs ) = @_;
-
 
1116
    my( $dir, $temp );
-
 
1117
 
-
 
1118
    Debug2( "ToolsetDirTree(@_)" );
868
    Debug2( "ToolsetDirTree(@_)" );
1119
 
869
 
1120
    ADD:
-
 
1121
    foreach $dir ( @dirs )
-
 
1122
    {
-
 
1123
        foreach $temp ( @TOOLSETDIRTREES ) {
-
 
1124
            next ADD if ($temp eq $dir);
-
 
1125
        }
-
 
1126
        push( @TOOLSETDIRTREES, $dir );
870
    UniquePush ( \@TOOLSETDIRTREES, @_);
1127
    }
-
 
1128
}
871
}
1129
 
872
 
1130
 
873
 
1131
sub ToolsetGenerate
874
sub ToolsetGenerate
1132
{
875
{
Line 1136... Line 879...
1136
}
879
}
1137
 
880
 
1138
 
881
 
1139
sub ToolsetObj
882
sub ToolsetObj
1140
{
883
{
1141
    my( @objs ) = @_;
-
 
1142
 
-
 
1143
    Debug2( "ToolsetObj(@_)" );
884
    Debug2( "ToolsetObj(@_)" );
1144
 
885
 
1145
    ADD:
-
 
1146
    foreach my $obj ( @objs )
886
    foreach my $obj ( @_ )
1147
    {
887
    {
1148
        foreach my $temp ( @TOOLSETOBJS ) {
-
 
1149
            next ADD if ($temp eq $obj);
-
 
1150
        }
-
 
1151
        push( @TOOLSETOBJS, "$obj.$::o" );
888
        UniquePush( \@TOOLSETOBJS, "$obj.$::o"  );
1152
    }
889
    }
1153
}
890
}
1154
 
891
 
1155
 
892
 
1156
sub ToolsetLib
893
sub ToolsetLib
1157
{
894
{
1158
    my( @libs ) = @_;
-
 
1159
    my( $lib, $temp );
-
 
1160
 
-
 
1161
    Debug2( "ToolsetLib(@_)" );
895
    Debug2( "ToolsetLib(@_)" );
1162
 
896
 
1163
    ADD:
-
 
1164
    foreach $lib ( @libs )
897
    foreach my $lib ( @_ )
1165
    {
898
    {
1166
        foreach $temp ( @TOOLSETLIBS ) {
-
 
1167
            next ADD if ($temp eq $lib);
-
 
1168
        }
-
 
1169
        push( @TOOLSETLIBS, "$lib.$::a" );
899
        UniquePush( \@TOOLSETLIBS, "$lib.$::a" );
1170
    }
900
    }
1171
}
901
}
1172
 
902
 
1173
 
903
 
1174
sub ToolsetProg
904
sub ToolsetProg
1175
{
905
{
1176
    my( @progs ) = @_;
-
 
1177
    my( $prog, $temp );
-
 
1178
 
-
 
1179
    Debug2( "ToolsetProg(@_)" );
906
    Debug2( "ToolsetProg(@_)" );
1180
 
907
 
1181
    ADD:
-
 
1182
    foreach $prog ( @progs )
908
    foreach my $prog ( @_ )
1183
    {
909
    {
1184
        foreach $temp ( @TOOLSETPROGS ) {
-
 
1185
            next ADD if ($temp eq $prog);
-
 
1186
        }
-
 
1187
        push( @TOOLSETPROGS, "$prog$::exe" );
910
        UniquePush( \@TOOLSETPROGS, "$prog$::exe" );
1188
    }
911
    }
1189
}
912
}
1190
 
913
 
1191
 
914
 
1192
sub ToolsetRule
915
sub ToolsetRule
Line 1875... Line 1598...
1875
 
1598
 
1876
    foreach $prog (@progs)
1599
    foreach $prog (@progs)
1877
    {
1600
    {
1878
        Warning( "Duplicate prog ignored '$prog'" )
1601
        Warning( "Duplicate prog ignored '$prog'" )
1879
            unless ( UniquePush(\@PROGS, $prog) );
1602
            unless ( UniquePush(\@PROGS, $prog) );
-
 
1603
        $PROGS{$prog} = 1;
1880
    }
1604
    }
1881
}
1605
}
1882
 
1606
 
1883
 
1607
 
1884
sub AddSourceType
1608
sub AddSourceType
Line 2661... Line 2385...
2661
#                                                 always be executed during the 'GenerateFiles' phase
2385
#                                                 always be executed during the 'GenerateFiles' phase
2662
#                       --UnknownPreq           - Prerequisites are not fully known.
2386
#                       --UnknownPreq           - Prerequisites are not fully known.
2663
#                                                 Rebuild the target whenever it is required.
2387
#                                                 Rebuild the target whenever it is required.
2664
#                       --AutoGenerate          - Examine the generated file to determine when the
2388
#                       --AutoGenerate          - Examine the generated file to determine when the
2665
#                                                 tools is to be run.
2389
#                                                 tools is to be run.
-
 
2390
#                                                 Must be before any options that declare
-
 
2391
#                                                 creation of files.
2666
#                       --Text=<text>           - Display text for command
2392
#                       --Text=<text>           - Display text for command
2667
#
2393
#
2668
#                       --Clean[=arg]           - Call script with arg[-clean] for cleaning. 
2394
#                       --Clean[=arg]           - Call script with arg[-clean] for cleaning. 
2669
#
2395
#
2670
#               Eg: GenerateFiles ( '*', "--Tool=mod_if.pl",
2396
#               Eg: GenerateFiles ( '*', "--Tool=mod_if.pl",
Line 2689... Line 2415...
2689
    my $no_warn;
2415
    my $no_warn;
2690
    my $clean_tag;
2416
    my $clean_tag;
2691
    my $text;
2417
    my $text;
2692
    my $gtype = 1;
2418
    my $gtype = 1;
2693
    my @var_opts;
2419
    my @var_opts;
-
 
2420
    my @genreq_seen;
2694
 
2421
 
2695
    #
2422
    #
2696
    #   Process the first argument - this describes the program that will be used
2423
    #   Process the first argument - this describes the program that will be used
2697
    #   to generate the files. It may be:
2424
    #   to generate the files. It may be:
2698
    #       --Tool          - A Jats Tool or Plugin
2425
    #       --Tool          - A Jats Tool or Plugin
Line 2841... Line 2568...
2841
    } elsif ( $tool =~ /^--Prog=(.*)$/ ) {
2568
    } elsif ( $tool =~ /^--Prog=(.*)$/ ) {
2842
        #
2569
        #
2843
        #   Using a program that has been created within this script
2570
        #   Using a program that has been created within this script
2844
        #
2571
        #
2845
        my $prog = $1;
2572
        my $prog = $1;
2846
        if ( exists $PROG_OBJS{$prog} || exists $PROG_LIBS{$prog} )
2573
        if ( exists $PROGS{$prog} )
2847
        {
2574
        {
2848
            $tool = "\$(BINDIR)/$prog$::exe"
2575
            $tool = "\$(BINDIR)/$prog$::exe"
2849
                unless ( $tool = $SRCS{$prog} );
2576
                unless ( $tool = $SRCS{$prog} );
2850
        UniquePush (\@preq_files, $tool);
2577
        UniquePush (\@preq_files, $tool);
2851
        }
2578
        }
Line 2953... Line 2680...
2953
            #   are generated. Existance of a source file will force the tool
2680
            #   are generated. Existance of a source file will force the tool
2954
            #   to be run during the 'generate' phase, othewise the tool will be run
2681
            #   to be run during the 'generate' phase, othewise the tool will be run
2955
            #   when the generated components are required.
2682
            #   when the generated components are required.
2956
            #
2683
            #
2957
            $gtype = 2;
2684
            $gtype = 2;
-
 
2685
            Warning ("AutoGenerate MUST occur before options that declare generation of files",
-
 
2686
                     "Have seen:", @genreq_seen)
-
 
2687
                if (@genreq_seen);
2958
            next;
2688
            next;
2959
        }
2689
        }
2960
        
2690
        
2961
        if ( $arg =~ /^--Prereq=(.*)/ )
2691
        if ( $arg =~ /^--Prereq=(.*)/ )
2962
        {
2692
        {
Line 2989... Line 2719...
2989
 
2719
 
2990
            #
2720
            #
2991
            #   Examine the file and see if it needs to be compiled
2721
            #   Examine the file and see if it needs to be compiled
2992
            #   Add to the list of source files
2722
            #   Add to the list of source files
2993
            #
2723
            #
-
 
2724
            push @genreq_seen, $arg;
2994
            GenerateSrcFile ( $gtype, $fn  )
2725
            GenerateSrcFile ( $gtype, $fn  )
2995
                if ( UniquePush (\@gen_files, $fn) );
2726
                if ( UniquePush (\@gen_files, $fn) );
2996
 
2727
 
2997
            Debug( "GenerateFiles: ExtraCreated: $fn" );
2728
            Debug( "GenerateFiles: ExtraCreated: $fn" );
2998
            next;
2729
            next;
Line 3117... Line 2848...
3117
 
2848
 
3118
                #
2849
                #
3119
                #   Save for later user
2850
                #   Save for later user
3120
                #   Flag the file as a generated file
2851
                #   Flag the file as a generated file
3121
                #
2852
                #
-
 
2853
                push @genreq_seen, $cmd;
3122
                GenerateSrcFile ( $gtype, $fn  )
2854
                GenerateSrcFile ( $gtype, $fn  )
3123
                    if ( UniquePush (\@gen_files, $fn) );
2855
                    if ( UniquePush (\@gen_files, $fn) );
3124
 
2856
 
3125
                #
2857
                #
3126
                #   Use the directory or the full name
2858
                #   Use the directory or the full name
Line 3719... Line 3451...
3719
    }
3451
    }
3720
    
3452
    
3721
    #
3453
    #
3722
    #   Try a PROG
3454
    #   Try a PROG
3723
    #
3455
    #
3724
    if ( exists $PROG_OBJS{$name} || exists $PROG_LIBS{$name} )
3456
    if ( exists $PROGS{$name} )
3725
    {
3457
    {
3726
        return "\$(BINDIR)/$name$::exe"
3458
        return "\$(BINDIR)/$name$::exe"
3727
    }
3459
    }
3728
 
3460
 
3729
    #
3461
    #
Line 4615... Line 4347...
4615
    #   If not, then may be a script or a TESTPROGS
4347
    #   If not, then may be a script or a TESTPROGS
4616
    #
4348
    #
4617
 
4349
 
4618
    unless ( $framework )
4350
    unless ( $framework )
4619
    {
4351
    {
4620
        if ( $TESTPROGS{$prog} ) {
4352
        if ( exists $TESTPROGS{$prog} ||  exists $PROGS{$prog} ) {
4621
            #
4353
            #
4622
            #   Append a suitable EXE suffix
4354
            #   Append a suitable EXE suffix
4623
            #
4355
            #
4624
            $prog .= "$::exe";
4356
            $prog .= "$::exe";
4625
 
4357
 
Line 4637... Line 4369...
4637
            $winprog = 0
4369
            $winprog = 0
4638
                unless ( $prog =~ m~\.bat$~ )
4370
                unless ( $prog =~ m~\.bat$~ )
4639
 
4371
 
4640
        } else {
4372
        } else {
4641
            Warning("RunTest program not known: $prog",
4373
            Warning("RunTest program not known: $prog",
4642
                  "It is not a TestProg or a Script",
4374
                  "It is not a TestProg, Prog or a Script",
4643
                  "FIX this NOW - It will be an error in a future release" );
4375
                  "The test may fail" );
4644
        }
4376
        }
4645
    }
4377
    }
4646
 
4378
 
4647
    #
4379
    #
4648
    #   Extract and process options
4380
    #   Extract and process options
Line 4892... Line 4624...
4892
    Error ("Programs are not supported") unless ( defined $::exe );
4624
    Error ("Programs are not supported") unless ( defined $::exe );
4893
    
4625
    
4894
 
4626
 
4895
#.. Fully qualify program path for addition to program list
4627
#.. Fully qualify program path for addition to program list
4896
    UniquePush( \@PROGS, $prog );
4628
    UniquePush( \@PROGS, $prog );
-
 
4629
    $PROGS{$prog} = 1;
4897
 
4630
 
4898
#.. Parse all of the object, library and argument entries
4631
#.. Parse all of the object, library and argument entries
4899
    Debug( "Prog: $prog" );
4632
    Debug( "Prog: $prog" );
4900
    foreach (@elements)
4633
    foreach (@elements)
4901
    {
4634
    {
Line 5902... Line 5635...
5902
            #   or a some other file - and don't append an extension
5635
            #   or a some other file - and don't append an extension
5903
            #
5636
            #
5904
            #   A program may not have any object files, only libraries
5637
            #   A program may not have any object files, only libraries
5905
            #
5638
            #
5906
            $ext = $::exe
5639
            $ext = $::exe
5907
                if ( exists $PROG_OBJS{$prog} || exists $PROG_LIBS{$prog} );
5640
                if ( exists $PROGS{$prog} );
5908
 
5641
 
5909
            #
5642
            #
5910
            #   A "file" that is specified with a "Src" directive may be
5643
            #   A "file" that is specified with a "Src" directive may be
5911
            #   installed as though it were a program
5644
            #   installed as though it were a program
5912
            #
5645
            #
Line 6397... Line 6130...
6397
        } elsif (/^--Package=(.*)/) {
6130
        } elsif (/^--Package=(.*)/) {
6398
            $dist = "$1";
6131
            $dist = "$1";
6399
 
6132
 
6400
        } elsif (/^--Tool(([=])(.*))?$/) {      # Allow Tool and Tool=xxx specfic target
6133
        } elsif (/^--Tool(([=])(.*))?$/) {      # Allow Tool and Tool=xxx specfic target
6401
            my $path = ( defined( $3) ) ? "/$3" : "";
6134
            my $path = ( defined( $3) ) ? "/$3" : "";
6402
            $dir = "\$(PKGDIR)/$path/\$(GBE_HOSTMACH)";
6135
            $dir = "\$(PKGDIR)$path/\$(GBE_HOSTMACH)";
6403
 
6136
 
6404
        } elsif (/^--Extras=(.*)/) {            # Extras=[none, .. ,all]
6137
        } elsif (/^--Extras=(.*)/) {            # Extras=[none, .. ,all]
6405
            foreach my $elem ( split( ',', $1 ) )
6138
            foreach my $elem ( split( ',', $1 ) )
6406
            {
6139
            {
6407
                Error ("PackageLib: Unknown Extras mode: $elem")
6140
                Error ("PackageLib: Unknown Extras mode: $elem")
Line 6439... Line 6172...
6439
            #   or a some other file - and don't append an extension
6172
            #   or a some other file - and don't append an extension
6440
            #
6173
            #
6441
            #   A program may not have any object files, only libraries
6174
            #   A program may not have any object files, only libraries
6442
            #
6175
            #
6443
            $ext = $::exe
6176
            $ext = $::exe
6444
                if ( exists $PROG_OBJS{$prog} || exists $PROG_LIBS{$prog} );
6177
                if ( exists $PROGS{$prog} );
6445
 
6178
 
6446
            #
6179
            #
6447
            #   A "file" that is specified with a "Src" directive may be
6180
            #   A "file" that is specified with a "Src" directive may be
6448
            #   installed as though it were a program
6181
            #   installed as though it were a program
6449
            #
6182
            #
Line 6699... Line 6432...
6699
        #   Must remove the placekeeper marker to allow the entry to be visible
6432
        #   Must remove the placekeeper marker to allow the entry to be visible
6700
        #
6433
        #
6701
        delete $package_entry{'placekeeper'};
6434
        delete $package_entry{'placekeeper'};
6702
        delete $package_entry{'version'};
6435
        delete $package_entry{'version'};
6703
        delete $package_entry{'lib'};
6436
        delete $package_entry{'lib'};
6704
        delete $package_entry{'extras'};
6437
#       delete $package_entry{'extras'};                   # Keep these
6705
        delete $package_entry{'Class'};
6438
        delete $package_entry{'Class'};
6706
 
6439
 
6707
        #
6440
        #
6708
        #   Add the entry
6441
        #   Add the entry
6709
        #
6442
        #
6710
        #   Under some conditions is it possible to attempt to add the same named
6443
        #   Under some conditions is it possible to attempt to add the same named
6711
        #   file. This will result in a circular dependancy in the makefile
6444
        #   file. This will result in a circular dependancy in the makefile
6712
        #
6445
        #
6713
        #   The condition is when merged libaries with PDBs (WINCE+WIN32) are merged
6446
        #   The condition is when merged libaries with PDBs (WINCE+WIN32) are merged
6714
        #   and the source for the mrege is the "local directory.
6447
        #   and the source for the merge is the "local directory.
6715
        #
6448
        #
6716
        #
6449
        #
6717
        my $dst = $package_entry{'dir'} ;
6450
        my $dst = $package_entry{'dir'} ;
6718
        ( my $dfile = $file) =~ s~.*/~~;
6451
        ( my $dfile = $file) =~ s~.*/~~;
6719
        Debug( "    added $dst/$dfile = $file" );
6452
        Debug( "    added $dst/$dfile = $file" );
Line 7072... Line 6805...
7072
#   MakePadded          - Padded line printer (internal)
6805
#   MakePadded          - Padded line printer (internal)
7073
#   PadToPosn           - Calc space+tabs to tabstop (internal)
6806
#   PadToPosn           - Calc space+tabs to tabstop (internal)
7074
#   MakeEntry3          - Complex Line Printer
6807
#   MakeEntry3          - Complex Line Printer
7075
#   MakeDefEntry        - Print a definition line (Production + Debug support)
6808
#   MakeDefEntry        - Print a definition line (Production + Debug support)
7076
#   MakeIfDefEntry      - Print ifdef entry
6809
#   MakeIfDefEntry      - Print ifdef entry
7077
#   MakeIfnDefEntry     - Print ifndef entry    
6810
#   MakeIfnDefEntry     - Print ifndef entry
-
 
6811
#   MakeIfZeroEntry     - Print ifeq entry
7078
#
6812
#
7079
###############################################################################
6813
###############################################################################
7080
 
6814
 
7081
sub MakeHeader
6815
sub MakeHeader
7082
{
6816
{
Line 7354... Line 7088...
7354
    print MAKEFILE "ifndef $iftag\n";
7088
    print MAKEFILE "ifndef $iftag\n";
7355
    MakeDefEntry (@rest);
7089
    MakeDefEntry (@rest);
7356
    print MAKEFILE "endif\n\n";
7090
    print MAKEFILE "endif\n\n";
7357
}
7091
}
7358
 
7092
 
-
 
7093
sub MakeIfZeroEntry
-
 
7094
{
-
 
7095
    my( $iftag, @rest ) = @_;
-
 
7096
 
-
 
7097
    print MAKEFILE "ifeq (\$($iftag),0)\n";
-
 
7098
    MakeDefEntry (@rest);
-
 
7099
    print MAKEFILE "endif\n\n";
-
 
7100
}
-
 
7101
 
7359
#-------------------------------------------------------------------------------
7102
#-------------------------------------------------------------------------------
7360
# Function        : CreateNameList
7103
# Function        : CreateNameList
7361
#
7104
#
7362
# Description     : Create a list of names by adding a prefix and suffix to a
7105
# Description     : Create a list of names by adding a prefix and suffix to a
7363
#                   list of items. This is used to add a directory prefix and a
7106
#                   list of items. This is used to add a directory prefix and a
Line 7963... Line 7706...
7963
        PackageFile ('*', 'descpkg');
7706
        PackageFile ('*', 'descpkg');
7964
    }
7707
    }
7965
 
7708
 
7966
    #
7709
    #
7967
    #   Some toolsets NEED a relative root
7710
    #   Some toolsets NEED a relative root
7968
    #   This is still a bit experimental so its only turned on if the toolset
7711
    #   Note: At the moment ScmRoot is relative anyway, thus this code
7969
    #   asks for it.
7712
    #         does nothing
7970
    #
7713
    #
7971
    my $gbe_root = $::ScmRoot;
7714
    my $gbe_root = $::ScmRoot;
7972
    my $gbe_root_abs = $::CwdDrive . AbsPath( $::ScmRoot );
-
 
7973
    if ( $::UseRelativeRoot )
7715
    if ( $::UseRelativeRoot )
7974
    {
7716
    {
7975
        $gbe_root =  RelPath( $::ScmRoot );
7717
        $gbe_root =  RelPath( $::ScmRoot );
7976
    }
7718
    }
7977
    
7719
    
Line 8011... Line 7753...
8011
    print MAKEFILE <<EOF;
7753
    print MAKEFILE <<EOF;
8012
 
7754
 
8013
#
7755
#
8014
#   Basic definitions
7756
#   Basic definitions
8015
#
7757
#
8016
GBE_ROOT        := $gbe_root
7758
GBE_ROOT	:= $gbe_root
8017
GBE_ROOT_ABS    := $gbe_root_abs
7759
GBE_ROOT_ABS	:= \$(abspath \$(GBE_ROOT))
8018
GBE_HOST	:= $::ScmHost
7760
GBE_HOST	:= $::ScmHost
8019
GBE_HOSTMACH	:= $::GBE_MACHTYPE
7761
GBE_HOSTMACH	:= $::GBE_MACHTYPE
8020
GBE_TARGET	:= $::ScmTarget
7762
GBE_TARGET	:= $::ScmTarget
8021
GBE_MACHTYPE	:= $::ScmMachType
7763
GBE_MACHTYPE	:= $::ScmMachType
8022
GBE_PLATFORM	:= $::ScmPlatform
7764
GBE_PLATFORM	:= $::ScmPlatform
Line 8034... Line 7776...
8034
MakePrint( "GBE_PRODUCT	:= $ScmProduct\n" )
7776
MakePrint( "GBE_PRODUCT	:= $ScmProduct\n" )
8035
    if ( $ScmProduct ne "" );
7777
    if ( $ScmProduct ne "" );
8036
 
7778
 
8037
MakePrint( "GBE_OS_COMMON	:= $::BUILDINFO{$ScmPlatform}{OS_COMMON}\n" )
7779
MakePrint( "GBE_OS_COMMON	:= $::BUILDINFO{$ScmPlatform}{OS_COMMON}\n" )
8038
    if ( exists($::BUILDINFO{$ScmPlatform}{OS_COMMON}) );
7780
    if ( exists($::BUILDINFO{$ScmPlatform}{OS_COMMON}) );
8039
    
-
 
8040
if ( $ScmExpert )
-
 
8041
{
-
 
8042
    print MAKEFILE <<EOF;
-
 
8043
 
7781
 
8044
ifndef SCMDEPEND
-
 
8045
ifndef NOSCMDEPEND
-
 
8046
NOSCMDEPEND	= 1
-
 
8047
endif
-
 
8048
endif
-
 
8049
EOF
-
 
8050
}
-
 
8051
 
7782
 
8052
    print MAKEFILE <<EOF;
7783
    print MAKEFILE <<EOF;
8053
 
7784
 
8054
SHELL           := \$(GBE_BIN)/sh
7785
SHELL           := \$(GBE_BIN)/sh
8055
SHELLARGS       :=
7786
SHELLARGS       :=
Line 8057... Line 7788...
8057
export EXTENDED_LINE MAKE
7788
export EXTENDED_LINE MAKE
8058
 
7789
 
8059
MFLAGS		:= --no-print --warn -r
7790
MFLAGS		:= --no-print --warn -r
8060
BUILDNAME	:= $::ScmBuildName
7791
BUILDNAME	:= $::ScmBuildName
8061
BUILDVER	:= $::ScmBuildVersionFull
7792
BUILDVER	:= $::ScmBuildVersionFull
8062
BUILDVERNUM := $::ScmBuildVersion
7793
BUILDVERNUM	:= $::ScmBuildVersion
8063
BUILDPREVIOUSVER := $::ScmBuildPreviousVersion
7794
BUILDPREVIOUSVER := $::ScmBuildPreviousVersion
8064
DEPLOYPATCH	:= $ScmDeploymentPatch
7795
DEPLOYPATCH	:= $ScmDeploymentPatch
8065
GBE_NOTOOLSTEST := $ScmNoToolsTest
7796
GBE_NOTOOLSTEST := $ScmNoToolsTest
8066
 
7797
 
8067
#
7798
#
8068
#   Ensure PWD is correctly set
7799
#   Ensure PWD is correctly set
8069
#
7800
#
8070
PWD             := \$(CURDIR)
7801
PWD             := \$(CURDIR)
8071
export PWD
7802
export PWD
8072
 
7803
 
-
 
7804
#
-
 
7805
#   NOSCMDEPEND - Used to remove dependency checking of build files
-
 
7806
#                 Used internally by the build system
-
 
7807
#   NODEPEND    - Used to suppress generated dependency file checking
-
 
7808
#                 Mostly done in jmake.pl
-
 
7809
#   EXPERT      - Used to suppress dependency on this makefile
-
 
7810
#
-
 
7811
EOF
-
 
7812
 
-
 
7813
MakePrint( "NOSCMDEPEND	?= " . ($ScmExpert ? '1' : '0' ) . "\n" );
-
 
7814
MakePrint( "EXPERT		?= " . ($ScmExpert ? '1' : '0' ) . "\n" );
-
 
7815
MakePrint( "NODEPEND	?= 0\n" );
-
 
7816
 
-
 
7817
print MAKEFILE <<EOF;
-
 
7818
 
-
 
7819
#
-
 
7820
#   SCM_MAKEFILE - The name of the file to depend upon
-
 
7821
#                  Supressed in EXPERT mode
-
 
7822
#
-
 
7823
ifneq (\$(EXPERT),0)
-
 
7824
SCM_MAKEFILE	:=
-
 
7825
NOSCMDEPEND	:= 1
-
 
7826
else
-
 
7827
SCM_MAKEFILE	:= $Makefile
-
 
7828
endif
-
 
7829
EOF
-
 
7830
 
-
 
7831
print MAKEFILE <<EOF;
-
 
7832
 
8073
#--------- Targets -------------------------------------------------------------
7833
#--------- Targets -------------------------------------------------------------
8074
 
7834
 
8075
.PHONY: 	default all build install package unpackage uninstall \\
7835
.PHONY: 	default all build install package unpackage uninstall \\
8076
		clean unbuild clobber deploy
7836
		clean unbuild clobber deploy
8077
 
7837
 
Line 8085... Line 7845...
8085
unpackage:	unpackage_class unpackage_prog unpackage_shlib \\
7845
unpackage:	unpackage_class unpackage_prog unpackage_shlib \\
8086
		unpackage_lib unpackage_hdr unpackage_files
7846
		unpackage_lib unpackage_hdr unpackage_files
8087
uninstall:	uninstall_class uninstall_prog uninstall_shlib \\
7847
uninstall:	uninstall_class uninstall_prog uninstall_shlib \\
8088
		uninstall_lib uninstall_hdr
7848
		uninstall_lib uninstall_hdr
8089
clean:		make_clean unmake_prog unmake_test unmake_lib unobj \\
7849
clean:		make_clean unmake_prog unmake_test unmake_lib unobj \\
8090
		undepend ungenerate rmlitter make_undir
7850
		undepend ungenerate rmlitter unmake_dir
8091
unbuild:	clean uninstall
7851
unbuild:	clean uninstall
8092
clobber:	unpackage unbuild
7852
clobber:	unpackage unbuild
8093
deploy:		install run_deploy
7853
deploy:		install run_deploy
8094
 
7854
 
8095
#--------- Macros --------------------------------------------------------------
7855
#--------- Macros --------------------------------------------------------------
Line 8126... Line 7886...
8126
    MakeNewLine();
7886
    MakeNewLine();
8127
 
7887
 
8128
#-------------------------------------------------------------------------------
7888
#-------------------------------------------------------------------------------
8129
#
7889
#
8130
#
7890
#
8131
MakeHeader ("Defines, flags and file sets");
7891
    MakeHeader ("Defines, flags and file sets");
8132
 
7892
 
8133
    # Flags
7893
    # Flags
8134
MakeDefEntry ( "IFLAG3", "=", "1" )
-
 
8135
    if ( $ScmToolsetIFLAG3 );
-
 
8136
    
-
 
8137
foreach my $opt ( keys %ScmCompilerOpts )
7894
    foreach my $opt ( keys %ScmCompilerOpts )
8138
{
7895
    {
8139
    MakeDefEntry ( $opt, "=", $ScmCompilerOpts{$opt} );
7896
        MakeDefEntry ( $opt, "=", $ScmCompilerOpts{$opt} );
8140
}
7897
    }
8141
 
7898
 
8142
MakeDefEntry( "CFLAGS",         "=", \@CFLAGS, \@CFLAGS_PROD, \@CFLAGS_DEBUG );
7899
    MakeDefEntry( "CFLAGS",         "=", \@CFLAGS, \@CFLAGS_PROD, \@CFLAGS_DEBUG );
8143
MakeDefEntry( "CLINTFLAGS",     "=", \@CLINTFLAGS, \@CLINTFLAGS_PROD, \@CLINTFLAGS_DEBUG );
7900
    MakeDefEntry( "CLINTFLAGS",     "=", \@CLINTFLAGS, \@CLINTFLAGS_PROD, \@CLINTFLAGS_DEBUG );
8144
MakeDefEntry( "CDEPENDFLAGS",   "=", \@CFLAGS, \@CFLAGS_PROD, \@CFLAGS_DEBUG );
7901
    MakeDefEntry( "CDEPENDFLAGS",   "=", \@CFLAGS, \@CFLAGS_PROD, \@CFLAGS_DEBUG );
8145
MakeDefEntry( "CXXFLAGS",       "=", \@CXXFLAGS, \@CXXFLAGS_PROD, \@CXXFLAGS_DEBUG );
7902
    MakeDefEntry( "CXXFLAGS",       "=", \@CXXFLAGS, \@CXXFLAGS_PROD, \@CXXFLAGS_DEBUG );
8146
MakeDefEntry( "CXXLINTFLAGS",   "=", \@CXXLINTFLAGS, \@CXXLINTFLAGS_PROD, \@CXXLINTFLAGS_DEBUG );
7903
    MakeDefEntry( "CXXLINTFLAGS",   "=", \@CXXLINTFLAGS, \@CXXLINTFLAGS_PROD, \@CXXLINTFLAGS_DEBUG );
8147
MakeDefEntry( "CXXDEPENDFLAG",  "=", \@CXXFLAGS, \@CXXFLAGS_PROD, \@CXXFLAGS_DEBUG );
7904
    MakeDefEntry( "CXXDEPENDFLAG",  "=", \@CXXFLAGS, \@CXXFLAGS_PROD, \@CXXFLAGS_DEBUG );
8148
MakeDefEntry( "ASFLAGS",        "=", \@ASFLAGS );
7905
    MakeDefEntry( "ASFLAGS",        "=", \@ASFLAGS );
8149
MakeDefEntry( "LDFLAGS",        "=", \@LDFLAGS );
7906
    MakeDefEntry( "LDFLAGS",        "=", \@LDFLAGS );
8150
 
7907
 
8151
 
7908
 
8152
#-------------------------------------------------------------------------------
7909
#-------------------------------------------------------------------------------
8153
#   
7910
#   
8154
#
7911
#
8155
MakeHeader ("Tool Search Path",
7912
    MakeHeader ("Tool Search Path",
8156
            "Extend the PATH seen by all the tools to include",
7913
                "Extend the PATH seen by all the tools to include",
8157
            "The tools/bin directories discovered in Packages" );
7914
                "The tools/bin directories discovered in Packages" );
8158
my $put_PATH;
7915
    my $put_PATH;
8159
my $put_LD_LIBRARY_PATH;
7916
    my $put_LD_LIBRARY_PATH;
8160
for my $path ( ToolExtensionPaths() )
7917
    for my $path ( ToolExtensionPaths() )
8161
{
-
 
8162
    MakePrint( "PATH := $path$::ScmPathSep\$(PATH)\n" );
-
 
8163
    $put_PATH = 1;
-
 
8164
 
-
 
8165
    if ( $::ScmHost eq "Unix" )
-
 
8166
    {
7918
    {
-
 
7919
        MakePrint( "PATH := $path$::ScmPathSep\$(PATH)\n" );
-
 
7920
        $put_PATH = 1;
-
 
7921
 
-
 
7922
        if ( $::ScmHost eq "Unix" )
-
 
7923
        {
8167
        MakePrint( "LD_LIBRARY_PATH ?= \n" );
7924
        MakePrint( "LD_LIBRARY_PATH ?= \n" );
8168
        MakePrint( "LD_LIBRARY_PATH := $path$::ScmPathSep\$(LD_LIBRARY_PATH)\n" );
7925
        MakePrint( "LD_LIBRARY_PATH := $path$::ScmPathSep\$(LD_LIBRARY_PATH)\n" );
8169
        $put_LD_LIBRARY_PATH =1;
7926
            $put_LD_LIBRARY_PATH =1;
-
 
7927
        }
8170
    }
7928
    }
8171
}
-
 
8172
 
7929
 
8173
#   Export the appropriate environment variables
7930
    #   Export the appropriate environment variables
8174
#   Note: Windows has an issue with PATH and Path
7931
    #   Note: Windows has an issue with PATH and Path
8175
#         Haven't got to the bottom of it yet, but it would appear that DLL
7932
    #         Haven't got to the bottom of it yet, but it would appear that DLL
8176
#         searching uses Path and other stuff uses PATH. Not too sure how we
7933
    #         searching uses Path and other stuff uses PATH. Not too sure how we
8177
#         end up with two (or more in the environment)
7934
    #         end up with two (or more in the environment)
8178
#
7935
    #
8179
#
7936
    #
8180
if ( $put_LD_LIBRARY_PATH )
7937
    if ( $put_LD_LIBRARY_PATH )
8181
{
7938
    {
8182
    MakePrint( "export LD_LIBRARY_PATH\n" );
7939
    MakePrint( "export LD_LIBRARY_PATH\n" );
8183
}
7940
    }
8184
 
7941
 
8185
if ( $put_PATH )
7942
    if ( $put_PATH )
8186
{
7943
    {
8187
    MakePrint( "Path := \$(PATH)\n" );
7944
    MakePrint( "Path := \$(PATH)\n" );
8188
    MakePrint( "export PATH Path\n" );
7945
    MakePrint( "export PATH Path\n" );
8189
}
7946
    }
8190
 
7947
 
8191
#-------------------------------------------------------------------------------
7948
#-------------------------------------------------------------------------------
8192
#   
7949
#   
8193
#
7950
#
8194
MakeHeader ("Perl Module Search Path",
7951
    MakeHeader ("Perl Module Search Path",
8195
            "Extend the PERL5LIB seen by invocations of perl");
7952
                "Extend the PERL5LIB seen by invocations of perl");
8196
 
7953
 
8197
my $perl_module_found;
7954
    my $perl_module_found;
8198
for my $path ( ToolExtensionPaths() )
7955
    for my $path ( ToolExtensionPaths() )
8199
{
-
 
8200
    if (glob( "$path/*.pm"))
-
 
8201
    {
7956
    {
-
 
7957
        if (glob( "$path/*.pm"))
-
 
7958
        {
8202
        MakePrint( "PERL5LIB := $path$::ScmPathSep\$(PERL5LIB)\n" );
7959
        MakePrint( "PERL5LIB := $path$::ScmPathSep\$(PERL5LIB)\n" );
8203
        $perl_module_found = 1;
7960
            $perl_module_found = 1;
-
 
7961
        }
8204
    }
7962
    }
8205
}
-
 
8206
if ( $perl_module_found  )
7963
    if ( $perl_module_found  )
8207
{
7964
    {
8208
    MakePrint( "export PERL5LIB\n" );
7965
    MakePrint( "export PERL5LIB\n" );
8209
}
7966
    }
8210
 
7967
 
-
 
7968
#-------------------------------------------------------------------------------
-
 
7969
#   Internal Helper Functions
-
 
7970
#   Creating INCLUDE and LIBRARY paths
-
 
7971
#
-
 
7972
 
8211
    # Assist in creating a list paths
7973
# Assist in creating a list paths
8212
    #   $pList  - Reference to an array to which $data will be added
7974
#   $pList  - Reference to an array to which $data will be added
8213
    #   $pSeen  - Hash Ref to track tags that have been seen
7975
#   $pSeen  - Hash Ref to track tags that have been seen
8214
    #   $data   - Data item to add, if tag is defined, but not seen
7976
#   $data   - Data item to add, if tag is defined, but not seen
8215
    #   $tag    - Resolved name for item
7977
#   $tag    - Resolved name for item
8216
    #
7978
#
8217
    sub PushPath
7979
    sub PushPath
8218
    {
7980
    {
8219
        my ($pList, $pSeen, $data, $tag) = @_;
7981
        my ($pList, $pSeen, $data, $tag) = @_;
8220
        if ( $tag )
7982
        if ( $tag )
8221
        {
7983
        {
Line 8267... Line 8029...
8267
    }
8029
    }
8268
 
8030
 
8269
#-------------------------------------------------------------------------------
8031
#-------------------------------------------------------------------------------
8270
#   
8032
#   
8271
#
8033
#
8272
MakeHeader ("Include Search Paths",
8034
    MakeHeader ("Include Search Paths",
8273
            "Local Include Paths" );
8035
                "Local Include Paths" );
8274
 
8036
 
8275
    # Include search path
8037
    # Include search path
8276
    #
8038
    #
8277
    #   user-local
8039
    #   user-local
8278
    #   local/
8040
    #   local/
Line 8280... Line 8042...
8280
    #   interface/
8042
    #   interface/
8281
    #           see above
8043
    #           see above
8282
    #   user-global
8044
    #   user-global
8283
    #
8045
    #
8284
 
8046
 
8285
MakeDefEntry ( "\nLINCDIRS",    "=", \@L_INCDIRS );     # .. Local
8047
    MakeDefEntry ( "\nLINCDIRS",    "=", \@L_INCDIRS );     # .. Local
8286
MakeDefEntry ( "LINCDIRS",      "+=", MakePaths( '$(INCDIR_LOCAL)' ));     # .. Sandbox interface
8048
    MakeDefEntry ( "LINCDIRS",      "+=", MakePaths( '$(INCDIR_LOCAL)' ));     # .. Sandbox interface
8287
MakeDefEntry ( "LINCDIRS",      "+=", MakePaths( '$(INCDIR_INTERFACE)' )); # .. Sandbox interface
8049
    MakeDefEntry ( "LINCDIRS",      "+=", MakePaths( '$(INCDIR_INTERFACE)' )); # .. Sandbox interface
8288
MakeDefEntry ( "LINCDIRS",      "+=", \@G_INCDIRS );    # .. Global
8050
    MakeDefEntry ( "LINCDIRS",      "+=", \@G_INCDIRS );    # .. Global
8289
 
8051
 
8290
MakeDefEntry   ( "INCDIRS",  "= ",  '$(LINCDIRS)' );
8052
    MakeDefEntry   ( "INCDIRS",  "= ",  '$(LINCDIRS)' );
8291
MakeIfDefEntry ( "PINCDIRS", "INCDIRS", "+=", '$(PINCDIRS)' );
8053
    MakeIfDefEntry ( "PINCDIRS", "INCDIRS", "+=", '$(PINCDIRS)' );
8292
MakeDefEntry   ( "LINCDIRS",    "+=", \@S_INCDIRS );    # .. System
8054
    MakeDefEntry   ( "LINCDIRS",    "+=", \@S_INCDIRS );    # .. System
8293
 
8055
 
8294
    # Source search path
8056
    # Source search path
8295
 
8057
 
8296
MakeDefEntry( "\nNODEPDIRS",        "=", \@NODEPDIRS );
8058
    MakeDefEntry( "\nNODEPDIRS",        "=", \@NODEPDIRS );
8297
 
8059
 
8298
MakeDefEntry( "\nSRCDIRS",          "=" , [ @L_SRCDIRS, @G_SRCDIRS ] );
8060
    MakeDefEntry( "\nSRCDIRS",          "=" , [ @L_SRCDIRS, @G_SRCDIRS ] );
8299
MakeIfDefEntry ( "PINCDIRS", "SRCDIRS", "+= ", '$(PINCDIRS)' );
8061
    MakeIfDefEntry ( "PINCDIRS", "SRCDIRS", "+= ", '$(PINCDIRS)' );
8300
MakeDefEntry   ( "SRCDIRS",    "+=", \@S_INCDIRS );    # .. System
8062
    MakeDefEntry   ( "SRCDIRS",    "+=", \@S_INCDIRS );    # .. System
8301
 
8063
 
8302
    # Library search path
8064
    # Library search path
8303
    #
8065
    #
8304
    #   user-local
8066
    #   user-local
8305
    #   local/
8067
    #   local/
8306
    #           see above
8068
    #           see above
8307
    #   interface/
8069
    #   interface/
8308
    #           see above
8070
    #           see above
8309
    #   user-global
8071
    #   user-global
8310
 
8072
 
8311
MakeDefEntry( "\nLIBDIRS",  "=",  '$(LIBDIR)' );                    # User Local
8073
    MakeDefEntry( "\nLIBDIRS",  "=",  '$(LIBDIR)' );                    # User Local
8312
MakeDefEntry( "LIBDIRS",    "+=", \@L_LIBDIRS );                    # Local
8074
    MakeDefEntry( "LIBDIRS",    "+=", \@L_LIBDIRS );                    # Local
8313
MakeDefEntry( "LIBDIRS",    "+=", MakePaths( '$(LIBDIR_LOCAL)' ));  # Sandbox/interface
8075
    MakeDefEntry( "LIBDIRS",    "+=", MakePaths( '$(LIBDIR_LOCAL)' ));  # Sandbox/interface
8314
MakeDefEntry( "LIBDIRS",    "+=", MakePaths( '$(LIBDIR_INTERFACE)' ));
8076
    MakeDefEntry( "LIBDIRS",    "+=", MakePaths( '$(LIBDIR_INTERFACE)' ));
8315
MakeDefEntry( "LIBDIRS",    "+=", \@G_LIBDIRS );                    # Global
8077
    MakeDefEntry( "LIBDIRS",    "+=", \@G_LIBDIRS );                    # Global
8316
MakeIfDefEntry ( "PLIBDIRS", "LIBDIRS", "+= ", '$(PLIBDIRS)' );
8078
    MakeIfDefEntry ( "PLIBDIRS", "LIBDIRS", "+= ", '$(PLIBDIRS)' );
8317
MakeDefEntry( "LIBDIRS",    "+=", \@S_LIBDIRS );                    # System
8079
    MakeDefEntry( "LIBDIRS",    "+=", \@S_LIBDIRS );                    # System
8318
 
8080
 
8319
#-------------------------------------------------------------------------------
8081
#-------------------------------------------------------------------------------
8320
#
8082
#
8321
#   Subdir creation and deletion
8083
#   Subdir creation and deletion
8322
#   Creation is done on the fly
8084
#   Creation is done on the fly
Line 8328... Line 8090...
8328
    MkdirRule( "\$(OBJDIR)", 'OBJDIR' );                # Object build directory
8090
    MkdirRule( "\$(OBJDIR)", 'OBJDIR' );                # Object build directory
8329
    MkdirRule( "\$(OBJDIR)/$_" ) foreach (@SHLIBS);     # Shared library build directory
8091
    MkdirRule( "\$(OBJDIR)/$_" ) foreach (@SHLIBS);     # Shared library build directory
8330
    MkdirRule( "\$(LIBDIR)", 'LIBDIR' );                # Library directory
8092
    MkdirRule( "\$(LIBDIR)", 'LIBDIR' );                # Library directory
8331
    MkdirRule( "\$(BINDIR)", 'BINDIR' );                # Binary directory
8093
    MkdirRule( "\$(BINDIR)", 'BINDIR' );                # Binary directory
8332
 
8094
 
-
 
8095
    #
-
 
8096
    #   Create a directory for library merge tool to work within
-
 
8097
    #
-
 
8098
    MkdirRule( "\$(MLIBDIR)", 'MLIBDIR', '--Path=$(GBE_PLATFORM).MRG', '--RemoveAll' ) if (@MLIBS);
-
 
8099
    
8333
#-------------------------------------------------------------------------------
8100
#-------------------------------------------------------------------------------
8334
#   Generate rules and recipes to create all the toolset specific parts
8101
#   Generate rules and recipes to create all the toolset specific parts
8335
#   This is done fairly early to allow the toolsets to extend various
8102
#   This is done fairly early to allow the toolsets to extend various
8336
#   definitions that may be used later in the makefile construction
8103
#   definitions that may be used later in the makefile construction
8337
#
8104
#
Line 8347... Line 8114...
8347
        return @ret;
8114
        return @ret;
8348
    }
8115
    }
8349
 
8116
 
8350
    foreach my $i ( @PROGS )
8117
    foreach my $i ( @PROGS )
8351
    {
8118
    {
8352
        my( @args, @objects, @libs, @llibs, $l );
8119
        my( @args, @objects, @libs, $l );
8353
 
8120
 
8354
        @args    = argsplit( $PROG_ARGS{ $i } );
8121
        @args    = argsplit( $PROG_ARGS{ $i } );
8355
        @objects = argsplit( $PROG_OBJS{ $i } );
8122
        @objects = argsplit( $PROG_OBJS{ $i } );
8356
        @libs    = argsplit( $PROG_LIBS{ $i } );
8123
        @libs    = argsplit( $PROG_LIBS{ $i } );
8357
 
8124
 
8358
        foreach $l ( @libs ) {                  # List of locally build libraries
-
 
8359
            push( @llibs, "$l" )
-
 
8360
                if ( grep /^$l$/, @LIBS );
-
 
8361
        }
-
 
8362
 
8125
 
8363
        MakePrint( "#---- (${i})\n\n" );
8126
        MakePrint( "#---- (${i})\n\n" );
8364
        if ( $ScmToolsetProgDependancies )
8127
        if ( $ScmToolsetProgDependancies )
8365
        {
8128
        {
-
 
8129
            #
8366
            MakeEntry( "\$(BINDIR)/${i}$::exe:\t", "", "\\\n\t\t", ".$::o ", @objects );
8130
            #   Original style Prog Interface
8367
            MakeEntry( "", "", "\\\n\t\$(BINDIR)/", ".$::a ", @llibs )
8131
            #   Write some depnedency information here and some in the toolset
8368
                if ( @llibs );
8132
            #
-
 
8133
            MakeEntry( "\$(BINDIR)/$i$::exe: ", "", "\\\n\t\t", ".$::o ", @objects );
8369
        }
8134
        }
8370
        else
8135
        else
8371
        {
8136
        {
-
 
8137
            #
-
 
8138
            #   New Style Prog Interface
-
 
8139
            #   The toolset does it all
-
 
8140
            #
-
 
8141
            #   Flag the progam packaging as a placeholder.
-
 
8142
            #   The toolset will replace/update it.
-
 
8143
            #
8372
            PackageProgRemoveFiles( $i );
8144
            PackageProgRemoveFiles( $i );
8373
        }
8145
        }
8374
 
8146
 
8375
        $if->LD( $i, \@args, \@objects, \@libs );
8147
        $if->LD( $i, \@args, \@objects, \@libs );
8376
        $if->LDLINT( $i, \@args, \@objects, \@libs );
8148
        $if->LDLINT( $i, \@args, \@objects, \@libs );
Line 8380... Line 8152...
8380
#   
8152
#   
8381
#
8153
#
8382
    MakeHeader ("Construct Test Programs");
8154
    MakeHeader ("Construct Test Programs");
8383
    foreach my $i ( keys %TESTPROGS )
8155
    foreach my $i ( keys %TESTPROGS )
8384
    {
8156
    {
8385
        my( @args, @objects, @libs, @llibs, $l );
8157
        my( @args, @objects, @libs, $l );
8386
 
8158
 
8387
        @args    = argsplit( $TESTPROG_ARGS{ $i } );
8159
        @args    = argsplit( $TESTPROG_ARGS{ $i } );
8388
        @objects = argsplit( $TESTPROG_OBJS{ $i } );
8160
        @objects = argsplit( $TESTPROG_OBJS{ $i } );
8389
        @libs    = argsplit( $TESTPROG_LIBS{ $i } );
8161
        @libs    = argsplit( $TESTPROG_LIBS{ $i } );
8390
 
8162
 
8391
        foreach $l ( @libs ) {                  # List of locally build libraries
-
 
8392
            push( @llibs, "$l" )
-
 
8393
                if ( grep /^$l$/, @LIBS );
-
 
8394
        }
-
 
8395
 
-
 
8396
        MakePrint( "#---- (${i})\n\n" );
8163
        MakePrint( "#---- (${i})\n\n" );
8397
        if ( $ScmToolsetProgDependancies )
8164
        if ( $ScmToolsetProgDependancies )
8398
        {
8165
        {
8399
            MakeEntry( "\$(BINDIR)/${i}$::exe:\t", "", "\\\n\t\t", ".$::o ", @objects );
8166
            MakeEntry( "\$(BINDIR)/$i$::exe: ", "", "\\\n\t\t", ".$::o ", @objects );
8400
            MakeEntry( "", "", "\\\n\t\$(BINDIR)/", ".$::a ", @llibs )
-
 
8401
                if ( @llibs );
-
 
8402
        }
8167
        }
8403
        else
8168
        else
8404
        {
8169
        {
8405
            PackageProgRemoveFiles( $i );
8170
            PackageProgRemoveFiles( $i );
8406
        }
8171
        }
Line 8417... Line 8182...
8417
    {
8182
    {
8418
        my $tname = "\$(BINDIR)/" . StripDir( $i );
8183
        my $tname = "\$(BINDIR)/" . StripDir( $i );
8419
 
8184
 
8420
 
8185
 
8421
        MakePrint( "$i:\t\tmakefile.pl\n" .
8186
        MakePrint( "$i:\t\tmakefile.pl\n" .
8422
            "\t\@if [ ! -f \"$i\" ]; then echo Script [$i] not found; exit 2; fi\n\n" );
8187
            "\t\$(XX_PRE)if [ ! -f \"$i\" ]; then echo Script [$i] not found; exit 2; fi\n\n" );
8423
 
8188
 
8424
        #
8189
        #
8425
        #   Create a rule to copy the script into the BIN directory
8190
        #   Create a rule to copy the script into the BIN directory
8426
        #   Mark the script as executable - It can't hurt and its there
8191
        #   Mark the script as executable - It can't hurt and its there
8427
        #   to be run as part of a test.
8192
        #   to be run as part of a test.
Line 8491... Line 8256...
8491
 
8256
 
8492
    foreach my $i ( @MLIBS )
8257
    foreach my $i ( @MLIBS )
8493
    {
8258
    {
8494
        my( @args, @libs );
8259
        my( @args, @libs );
8495
 
8260
 
-
 
8261
        MakePrint "#---- (${i})\n\n";
-
 
8262
        
8496
        @libs    = argsplit( $MLIB_LIBS{ $i } );
8263
        @libs    = argsplit( $MLIB_LIBS{ $i } );
8497
        @args    = argsplit( $MLIB_ARGS{ $i } );
8264
        @args    = argsplit( $MLIB_ARGS{ $i } );
8498
 
8265
 
8499
        unless ( defined &ToolsetARMerge )
8266
        unless ( defined &ToolsetARMerge )
8500
        {
8267
        {
Line 8552... Line 8319...
8552
            unless (( $type = $SRC_TYPE{ $sname }) );
8319
            unless (( $type = $SRC_TYPE{ $sname }) );
8553
 
8320
 
8554
        #
8321
        #
8555
        #   Object source is an object file
8322
        #   Object source is an object file
8556
        #   No need the generate the object, just create makefile rule
8323
        #   No need the generate the object, just create makefile rule
-
 
8324
        #   [ddp] Not too sure how we get here
8557
        #
8325
        #
8558
        if ( $ext eq ".$::o" )
8326
        if ( $ext eq ".$::o" )
8559
        {
8327
        {
8560
            MakePrint "$src:";
8328
            MakePrint "$src:";
8561
            MakePrint " $Makefile"
8329
            MakePrint " \$(SCM_MAKEFILE)";
8562
                if ( ! $ScmExpert );
-
 
8563
            MakeNewLine();
8330
            MakeNewLine();
8564
            next;
8331
            next;
8565
        }
8332
        }
8566
 
8333
 
8567
        #
8334
        #
Line 8581... Line 8348...
8581
        $src = AbsPath($src)
8348
        $src = AbsPath($src)
8582
            if ( $UseAbsObjects );
8349
            if ( $UseAbsObjects );
8583
 
8350
 
8584
        #
8351
        #
8585
        #   Extract any user specified dependancies
8352
        #   Extract any user specified dependancies
-
 
8353
        #   These will be added to the dependency list
8586
        #
8354
        #
8587
        my @dlist;
8355
        my @dlist;
8588
        @dlist = split( /$;/, $SRC_DEPEND{$sname} )
8356
        @dlist = split( /$;/, $SRC_DEPEND{$sname} )
8589
            if ( exists $SRC_DEPEND{$sname} );
8357
            if ( exists $SRC_DEPEND{$sname} );
8590
 
8358
 
-
 
8359
        #
8591
        MakeEntry( "\$(OBJDIR)/$i.$::o:\t", "", " \\\n\t", "", $src, @dlist );
8360
        #   Create the dependency part of the object rule
8592
        MakePrint " \\\n\t$Makefile"
8361
        #   The source file MUST be the first dependent recipes
8593
            if ( ! $ScmExpert );
8362
        #   may assume that $< is the name source file
-
 
8363
        #
-
 
8364
        MakeEntry( "\$(OBJDIR)/$i.$::o: $src \$(SCM_MAKEFILE)", "", " \\\n\t", "", @dlist );
8594
 
8365
 
8595
        if ( $type eq ".c" ) {
8366
        if ( $type eq ".c" ) {
8596
            $if->CC(  $src, $i, \@args );
8367
            $if->CC(  $src, $i, \@args );
-
 
8368
 
8597
        } elsif ( $type eq ".cc" ) {
8369
        } elsif ( $type eq ".cc" ) {
8598
            $if->CXX( $src, $i, \@args );
8370
            $if->CXX( $src, $i, \@args );
-
 
8371
 
8599
        } elsif ( $type eq ".asm" ) {
8372
        } elsif ( $type eq ".asm" ) {
8600
            $if->AS( $src, $i, \@args );
8373
            $if->AS( $src, $i, \@args );
-
 
8374
 
8601
        } else {
8375
        } else {
8602
            $if->EXT( $src, $i, \@args ) ||
8376
            $if->EXT( $src, $i, \@args ) ||
8603
                Warning( "Don't know how to build '$ext' images' for $src, $i" );
8377
                Warning( "Don't know how to build '$ext' images' for $src, $i" );
8604
            MakeNewLine();
8378
            MakeNewLine();
8605
        }
8379
        }
Line 8746... Line 8520...
8746
        }
8520
        }
8747
        MakePrint( "\n$i:\t\tmakefile.pl\n" .
8521
        MakePrint( "\n$i:\t\tmakefile.pl\n" .
8748
            "\t\@if [ ! -f \"$i\" ]; then echo ERROR: CopyIn Script [$i] not found; exit 2; fi\n" );
8522
            "\t\@if [ ! -f \"$i\" ]; then echo ERROR: CopyIn Script [$i] not found; exit 2; fi\n" );
8749
    }
8523
    }
8750
 
8524
 
-
 
8525
#-------------------------------------------------------------------------------
-
 
8526
#   Deploy rules
-
 
8527
#
-
 
8528
MakeHeader ("Deploy Rules");
-
 
8529
 
-
 
8530
print MAKEFILE <<EOF;
-
 
8531
.PHONY:		run_deploy
-
 
8532
EOF
-
 
8533
 
-
 
8534
#
-
 
8535
#   Build up the deployfile.pl command line from the available pieces
-
 
8536
#
-
 
8537
my $command_file = "";
-
 
8538
my @command_line;
-
 
8539
 
-
 
8540
if ( %DEPLOYPACKAGE )
-
 
8541
{
-
 
8542
    $command_file = $DEPLOYPACKAGE{'cmdfile'};
-
 
8543
 
-
 
8544
    push @command_line, "\$(XX_PRE)\$(GBE_PERL) -w $command_file";
-
 
8545
    push @command_line, "-r \"\$(GBE_ROOT)\"";
-
 
8546
    push @command_line, "-n \"$DEPLOYPACKAGE{'name'}\"";
-
 
8547
    push @command_line, "-d \"$DEPLOYPACKAGE{'dir'}\"";
-
 
8548
    push @command_line, "-v \"\$(BUILDVER)\"";
-
 
8549
    push @command_line, "-t \"\$(GBE_TYPE)\"";
-
 
8550
    push @command_line, "-o \"\$(BUILDPREVIOUSVER)\"";
-
 
8551
    push @command_line, "-m \"\$(GBE_PLATFORM)\"";
-
 
8552
    push @command_line, "-g \"\$(GBE_TARGET)\"";
-
 
8553
    push @command_line, "-k \"\$(GBE_PRODUCT)\""        if ( $ScmProduct );
-
 
8554
    push @command_line, "-p \"\$(DEPLOYPATCH)\""        if ( $ScmDeploymentPatch );
-
 
8555
 
-
 
8556
}
-
 
8557
 
-
 
8558
MakeEntry( "run_deploy:\t$command_file\n", "\n", "\t\t", " \\\n", @command_line );
-
 
8559
 
-
 
8560
#-------------------------------------------------------------------------------
-
 
8561
#   Custom Rules
-
 
8562
#
-
 
8563
    MakeHeader ("Custom Rules");
-
 
8564
    MakePrintList ( \@RULES );
-
 
8565
 
-
 
8566
#-------------------------------------------------------------------------------
-
 
8567
#   Generated Files
-
 
8568
#
-
 
8569
    MakeHeader ("Generated Files");
-
 
8570
    MakePrint ("\n.PHONY: phony_generate\n\n" );
-
 
8571
    
-
 
8572
    foreach my $i ( @GENERATE_FILES )
-
 
8573
    {
-
 
8574
        my $gen_tag = $i->{'index'};
-
 
8575
 
-
 
8576
        #
-
 
8577
        #   Generate the basic generate rule and recipe
-
 
8578
        #   together with the prerequisites
-
 
8579
        #
-
 
8580
        MakeEntry ( "", ":", "", " ", @{$i->{'gen'}} );
-
 
8581
 
-
 
8582
        unless ( $i->{'clean'} && $i->{'shell'} )
-
 
8583
        {
-
 
8584
            MakeEntry ( "", "", " \\\n\t\t", "", @{$i->{'preq'}} );
-
 
8585
            MakeEntry ( "", "", " \\\n\t\t", "", "phony_generate" ) if $i->{'preq_sus'};
-
 
8586
            MakeEntry ( "", "", " \\\n\t\t", "", "\$(SCM_MAKEFILE)" );
-
 
8587
 
-
 
8588
            MakePrint ("\n\t" . "\@\$(echo) [$i->{'text'}] generating.." );
-
 
8589
            MakePrint ("\n\t" . "\$(XX_PRE)\$(call generate_$gen_tag,)" );
-
 
8590
        }
-
 
8591
 
-
 
8592
        #
-
 
8593
        #   Generate 'clean' rules and recipes
-
 
8594
        #
-
 
8595
        if ( $i->{'clean'} )
-
 
8596
        {
-
 
8597
            MakePrint ("\n\nPHONY: clean_generate_$gen_tag" );
-
 
8598
            MakePrint ("\nclean_generate_$gen_tag:" );
-
 
8599
            MakePrint ("\n\t" . "\@\$(call generate_$gen_tag,$i->{'clean'})" );
-
 
8600
        }
-
 
8601
 
-
 
8602
        #
-
 
8603
        #   Define a function to contain the body of the generation call
-
 
8604
        #   The first argument will be a 'clean' argument
-
 
8605
        #
-
 
8606
        MakePrint ("\n\ndefine generate_$gen_tag" );
-
 
8607
        if ( $i->{'shell'} )
-
 
8608
        {
-
 
8609
            MakeEntry ("\n\t(" , "\\\n\t)\n", " \\\n\t", ";" , @{$i->{'toolargs'}} );
-
 
8610
        }
-
 
8611
        else
-
 
8612
        {
-
 
8613
            MakeEntry ("\n\t" . $i->{'tool'} . ' $1', "\n", " \\\n\t\t", "" , @{$i->{'toolargs'}} );
-
 
8614
        }
-
 
8615
        MakePrint ("endef\n\n" );
-
 
8616
    }
-
 
8617
 
-
 
8618
#-------------------------------------------------------------------------------
-
 
8619
#   Toolset Post Processing
-
 
8620
#   Allow the toolset to perform any post processing, before we finally write
-
 
8621
#   out any definitions.
-
 
8622
#
-
 
8623
#   We will not interprete any more user directives, but new stuff may get added
-
 
8624
#
-
 
8625
#
-
 
8626
MakeHeader ("Toolset Post Processing");
-
 
8627
$if->Postprocess();
-
 
8628
 
-
 
8629
################################################################################
-
 
8630
#   All interactions with the toolset are now complete
-
 
8631
#   All lists are now complete
-
 
8632
#
-
 
8633
#   Can now create internal definitions
-
 
8634
#   
-
 
8635
################################################################################
8751
 
8636
 
-
 
8637
    #
-
 
8638
    #   Would be nice if this would work
-
 
8639
    #   Unfortunatelty we still need $if for the CCDEPENDS and CTAGS work
-
 
8640
    #   These must be defined AFTER the definitions
-
 
8641
    #
-
 
8642
    #   Ideally we should construct our makefile in sections
-
 
8643
    #   and then we can order the sections when we write them out
-
 
8644
    #
-
 
8645
#$if = 0;                            # Ensure the MakeIf class is not called
-
 
8646
                                     # If this file is modified
8752
 
8647
 
8753
#-------------------------------------------------------------------------------
8648
#-------------------------------------------------------------------------------
8754
#   Sources
8649
#   Sources
8755
#
8650
#
8756
MakeHeader  ( "Sources");
8651
MakeHeader  ( "Sources");
Line 8788... Line 8683...
8788
MakeDefEntry( "LINTPROGS",      "+=", CreateNameList( 'prog_', '_lint', \%TESTPROGS ));
8683
MakeDefEntry( "LINTPROGS",      "+=", CreateNameList( 'prog_', '_lint', \%TESTPROGS ));
8789
MakeDefEntry( "PROJECTS",        "=", CreateNameList( 'Project_', '', ListGeneratedProjects(1) ));
8684
MakeDefEntry( "PROJECTS",        "=", CreateNameList( 'Project_', '', ListGeneratedProjects(1) ));
8790
MakeDefEntry( "PROJECTSGEN",     "=", CreateNameList( 'Project_', '', ListGeneratedProjects(0) ));
8685
MakeDefEntry( "PROJECTSGEN",     "=", CreateNameList( 'Project_', '', ListGeneratedProjects(0) ));
8791
MakeDefEntry( "PROJECTSCLEAN",   "=", CreateNameList( 'ProjectClean_', '', \%PROJECTS ));
8686
MakeDefEntry( "PROJECTSCLEAN",   "=", CreateNameList( 'ProjectClean_', '', \%PROJECTS ));
8792
 
8687
 
8793
 
-
 
8794
my $initdep     = "";
-
 
8795
$initdep        = "\$(INITS)" if ( @INITS );
8688
MakeHeader ("Toolset components");
8796
 
-
 
8797
my $mkdirdep    = "";
-
 
8798
$mkdirdep      .= "\$(GBE_OBJDIR) " if ( @CSRCS || @CXXSRCS || @OBJS || %PROG_OBJS || %TESTPROG_OBJS );
8689
MakeDefEntry( "USERGENERATED",        "=", \@USERGENERATED )    if ( @USERGENERATED );
8799
$mkdirdep      .= "\$(SHDIRS) "     if ( %SHOBJ_LIB || @SHLIBS);
-
 
8800
$mkdirdep      .= "\$(GBE_LIBDIR) " if ( @LIBS || @MLIBS || @SHLIBS || %INSTALL_LIBS || %PACKAGE_LIBS );
-
 
8801
$mkdirdep      .= "\$(GBE_BINDIR) " if ( @SHLIBS || %SCRIPTS || @PROGS || %TESTPROGS || %INSTALL_PROGS || %PACKAGE_PROGS );
-
 
8802
 
-
 
8803
 
-
 
8804
my $unobjact    = "";
-
 
8805
$unobjact      .= RmFilesCmd( "OBJS" ) if ( @OBJS );
-
 
8806
$unobjact      .= RmFilesCmd( "SHOBJS" ) if ( %SHOBJ_LIB );
-
 
8807
$unobjact      .= RmFilesCmd( "PROGOBJS" ) if ( @PROGOBJS );
-
 
8808
$unobjact      .= RmFilesCmd( "TESTPROGOBJS" ) if ( %TESTPROG_OBJS );
8690
MakeDefEntry( "TOOLSETGENERATED",     "=", \@TOOLSETGENERATED ) if ( @TOOLSETGENERATED );
8809
 
-
 
8810
my $libdep      = "";
-
 
8811
$libdep         = "\$(GBE_OBJDIR) \$(GBE_LIBDIR) \$(LIBS)" if ( @LIBS );
-
 
8812
 
-
 
8813
my $liblintdep  = "";
-
 
8814
$liblintdep     = "lint_init \$(GBE_OBJDIR) \$(GBE_LIBDIR) \$(LINTLIBS)" if ( @LIBS );
-
 
8815
 
-
 
8816
my $mlibdep     = "";
-
 
8817
$mlibdep        = "\$(GBE_OBJDIR) \$(GBE_LIBDIR) \$(MLIBS)" if ( @MLIBS );
8691
MakeDefEntry( "TOOLSETOBJS",          "=", \@TOOLSETOBJS )      if ( @TOOLSETOBJS );
8818
 
-
 
8819
my $shlibdep    = "";
-
 
8820
$shlibdep       = "\$(SHDIRS) \$(SHLIBS)" if ( @SHLIBS );
-
 
8821
 
-
 
8822
my $shliblintdep= "";
-
 
8823
$shliblintdep   = "lint_init \$(GBE_LIBDIR) \$(LINTSHLIBS)" if ( @SHLIBS );
8692
MakeDefEntry( "TOOLSETLIBS",          "=", \@TOOLSETLIBS )      if ( @TOOLSETLIBS );
8824
 
-
 
8825
my $unlibact    = "";
-
 
8826
$unlibact      .= RmFilesCmd( "LIBS" ) if ( @LIBS );
-
 
8827
$unlibact      .= RmFilesCmd( "MLIBS" ) if ( @MLIBS );
-
 
8828
$unlibact      .= RmFilesCmd( "SHLIBS" ) if ( @SHLIBS );
-
 
8829
 
-
 
8830
my $scriptdep   = "";
-
 
8831
$scriptdep      = "\$(GBE_BINDIR) \$(SCRIPTS)" if ( %SCRIPTS );
-
 
8832
 
-
 
8833
my $unscriptact = "";
-
 
8834
$unscriptact    .= RmFilesCmd( "SCRIPTS" ) if ( %SCRIPTS );
-
 
8835
$unscriptact    .= RmFilesCmd( "COPYIN" )  if ( @COPYIN );
-
 
8836
 
-
 
8837
my $progdep     = "";
-
 
8838
$progdep        = "\$(GBE_OBJDIR) \$(GBE_BINDIR) \$(PROGS)" if ( @PROGS );
-
 
8839
$progdep       .= " \$(PROGS_EXTRA)" if (@PROGS_EXTRA);
-
 
8840
 
-
 
8841
my $projectdep  = "";
-
 
8842
$projectdep     = "\$(PROJECTS)" if (ListGeneratedProjects(1) );
-
 
8843
 
-
 
8844
my $projectgendep  = "";
-
 
8845
$projectgendep     = "\$(PROJECTSGEN)" if (ListGeneratedProjects(0) );
-
 
8846
 
-
 
8847
my $projectcleandep  = "";
-
 
8848
$projectcleandep     = "\$(PROJECTSCLEAN)" if (%PROJECTS);
-
 
8849
 
-
 
8850
my $proglintdep = "";
-
 
8851
$proglintdep    = "lint_init \$(GBE_OBJDIR) \$(GBE_BINDIR) \$(LINTPROGS)" if ( @PROGS || %TESTPROGS );
-
 
8852
 
-
 
8853
my $unprogact   = "";
-
 
8854
$unprogact      = RmFilesCmd( "PROGS" ) if ( @PROGS );
-
 
8855
 
-
 
8856
my $testprogdep = "";
-
 
8857
$testprogdep    = "\$(GBE_OBJDIR) \$(GBE_BINDIR) \$(TESTPROGS)" if ( %TESTPROGS );
8693
MakeDefEntry( "TOOLSETPROGS",         "=", \@TOOLSETPROGS )     if ( @TOOLSETPROGS );
8858
 
-
 
8859
my $untestprogact = "";
-
 
8860
$untestprogact  = RmFilesCmd( "TESTPROGS" ) if ( %TESTPROGS );
-
 
8861
 
-
 
8862
my $generatedep = "";
-
 
8863
$generatedep    = "\$(GENERATED)" if ( @GENERATED );
-
 
8864
 
-
 
8865
my $ungenact    = "";
-
 
8866
$ungenact       .= RmFilesCmd( "GENERATED" ) if ( @GENERATED );
8694
MakeDefEntry( "TOOLSETDIRS",          "=", \@TOOLSETDIRS )      if ( @TOOLSETDIRS );
8867
$ungenact       .= RmFilesCmd( "GENERATED_NOTSRC" ) if ( @GENERATED_NOTSRC );
8695
MakeDefEntry( "TOOLSETDIRTREES",      "=", \@TOOLSETDIRTREES )  if ( @TOOLSETDIRTREES );
8868
 
-
 
8869
my $ungenerate_files    = "";
-
 
8870
$ungenerate_files= "\$(GENERATEDCLEAN)";
-
 
8871
 
8696
 
8872
#--------- Determine compiler flag groups to use ----------------------------
8697
#--------- Determine compiler flag groups to use ----------------------------
8873
#
8698
#
8874
#   Allows the compiler options to be controlled for both the debug and
8699
#   Allows the compiler options to be controlled for both the debug and
8875
#   the production builds. Allows control over
8700
#   the production builds. Allows control over
Line 8888... Line 8713...
8888
USE_DEBUGINFO	:= \$(DEBUG_USE_DEBUGINFO)
8713
USE_DEBUGINFO	:= \$(DEBUG_USE_DEBUGINFO)
8889
endif
8714
endif
8890
 
8715
 
8891
EOF
8716
EOF
8892
 
8717
 
-
 
8718
#-------------------------------------------------------------------------------
-
 
8719
#   Source browsing tools
-
 
8720
#
-
 
8721
MakeHeader ("Source browsing tools");
-
 
8722
    print MAKEFILE <<EOF;
-
 
8723
.PHONY:			ctags
-
 
8724
ctags:
-
 
8725
EOF
-
 
8726
    $if->CTAGS()
-
 
8727
        if (@CSRCS || @CXXSRCS);
8893
 
8728
 
8894
#--------- Determine IFLAG support level ------------------------------------
8729
#-------------------------------------------------------------------------------
-
 
8730
#   Depend
-
 
8731
#   If we are build C or C++ source files then create rules and recipes
-
 
8732
#   to invoke a dependency generator.
-
 
8733
#
-
 
8734
#   NODEPEND is used to disable, at make-time, the dependency generation
-
 
8735
#   and inclusion process.
8895
#
8736
#
-
 
8737
#
-
 
8738
MakeHeader ("Depend");
-
 
8739
if ($::o && (@CSRCS || @CXXSRCS))
-
 
8740
{
-
 
8741
    $ScmDependTags = 1;
-
 
8742
    print MAKEFILE <<EOF;
-
 
8743
depend:			\$(OBJDIR)/depend
-
 
8744
 
-
 
8745
\$(OBJDIR)/depend:	\$(SCM_MAKEFILE) \$(GBE_OBJDIR)
-
 
8746
\$(OBJDIR)/depend:	\$(CSRCS) \$(CXXSRCS)
-
 
8747
ifeq (\$(NODEPEND),0)
-
 
8748
	\@echo [\$@] Doing a make depend..
-
 
8749
	-\$(XX_PRE)\$(rm) -f \$(OBJDIR)/depend
-
 
8750
EOF
-
 
8751
    $if->CCDepend( "\$(OBJDIR)/depend", "\$(CSRCS)" )
-
 
8752
        if ( @CSRCS );
-
 
8753
    $if->CXXDepend( "\$(OBJDIR)/depend", "\$(CXXSRCS)" )
-
 
8754
        if ( @CXXSRCS );
-
 
8755
    MakePrint
-
 
8756
        "\t-\@\$(touch) -f \$(OBJDIR)/depend\n";
-
 
8757
    print MAKEFILE <<EOF;
-
 
8758
else
-
 
8759
	\@echo [\$@] Skipping make depend..
-
 
8760
	-\$(XX_PRE)\$(rm) -f \$(OBJDIR)/depend
-
 
8761
endif
-
 
8762
EOF
-
 
8763
}
-
 
8764
else
-
 
8765
{
-
 
8766
    print MAKEFILE <<EOF;
-
 
8767
depend:
-
 
8768
EOF
-
 
8769
}
-
 
8770
 
-
 
8771
#
8896
#   IFLAG - iteration flag,
8772
#   Rule to unmake the depend file
-
 
8773
#
-
 
8774
    print MAKEFILE <<EOF;
-
 
8775
 
-
 
8776
undepend:
-
 
8777
	-\$(XX_PRE)\$(rm) -f \$(OBJDIR)/depend
-
 
8778
EOF
-
 
8779
 
-
 
8780
#--------- IFLAG Documentation -------------------------------------------------
-
 
8781
#
-
 
8782
#   IFLAG - iteration flag. This is setting by the calling process
-
 
8783
#                           and is a function of the phase being processed
8897
#       0   No external dependencies.
8784
#       0   No external dependencies.
8898
#       1   Source dependency list.
8785
#       1   Source dependency list.
8899
#       2   Shared library dependency list (new).
8786
#       2   Shared library dependency list
8900
#       3   Application dependency list (prevously 2).
8787
#       3   Application dependency list
8901
#
8788
#
8902
#   If IFLAG3 isn't defined, remap to older numbering.
-
 
8903
#
8789
#
-
 
8790
#--------- Dependencies --------------------------------------------------------
-
 
8791
#   Include the 'depend' file if required
-
 
8792
#
8904
MakeHeader ("Determine IFLAG support level" );
8793
    MakeHeader ("Dependency Inclusion");
8905
print MAKEFILE <<EOF;
8794
    print MAKEFILE <<EOF;
8906
ifndef IFLAG3	# IFLAG3 required, if not remap IFLAG to older style
-
 
8907
 ifeq "\$(IFLAG)" "2"
8795
ifeq (\$(NODEPEND),0)
8908
IFLAG		:=1
-
 
8909
 endif
8796
 ifdef IFLAG
8910
 ifeq "\$(IFLAG)" "3"
8797
  ifneq "\$(IFLAG)" "0"
-
 
8798
-include	\$(OBJDIR)/depend
8911
IFLAG		:=2
8799
  endif
8912
 endif
8800
 endif
8913
endif
8801
endif
8914
 
8802
 
8915
EOF
8803
EOF
8916
 
8804
 
8917
#-------------------------------------------------------------------------------
8805
#-------------------------------------------------------------------------------
8918
#   Special targets
8806
#   Special targets
8919
#
8807
#
8920
MakeHeader ("Special targets");
8808
MakeHeader ("Special targets",
-
 
8809
            "These targets are not used by JATS",
-
 
8810
            "They can only used when the makefile is used directly",
-
 
8811
            "This is not the intended use of this makefile",
-
 
8812
           );
8921
 
8813
 
8922
print MAKEFILE <<EOF;
8814
print MAKEFILE <<EOF;
8923
.PHONY:		debug
8815
.PHONY:		debug
8924
debug:
8816
debug:
8925
	@\$(MAKE) -f \$(GBE_PLATFORM).mk DEBUG=1 build
8817
	@\$(MAKE) -f \$(GBE_PLATFORM).mk DEBUG=1 build
Line 8933... Line 8825...
8933
    #
8825
    #
8934
    #   It would appear that these targets are not directly available
8826
    #   It would appear that these targets are not directly available
8935
    #   They can only be accessed if the makefile is used directly, and this
8827
    #   They can only be accessed if the makefile is used directly, and this
8936
    #   is not the intended use
8828
    #   is not the intended use
8937
    #
8829
    #
-
 
8830
    MakePrint("#   PROGS\n");
8938
    foreach my $i ( @PROGS ) {
8831
    foreach my $i ( @PROGS ) {
8939
        MakePrint "${i}:\tmake_init \$(BINDIR)/${i}$::exe\n";
8832
        MakePrint "${i}:\tmake_init \$(BINDIR)/${i}$::exe\n";
8940
    }
8833
    }
8941
 
-
 
8942
    MakeNewLine();
8834
    MakeNewLine();
-
 
8835
 
-
 
8836
    MakePrint("#   TESTPROGS\n");
8943
    foreach my $i ( sort keys %TESTPROGS ) {
8837
    foreach my $i ( sort keys %TESTPROGS ) {
8944
        MakePrint "${i}:\tmake_init \$(BINDIR)/${i}$::exe\n";
8838
        MakePrint "${i}:\tmake_init \$(BINDIR)/${i}$::exe\n";
8945
    }
8839
    }
8946
    MakeNewLine();
8840
    MakeNewLine();
8947
 
8841
 
-
 
8842
    MakePrint("#   PACKAGE_DIST\n");
8948
    foreach my $i ( sort keys %PACKAGE_DIST ) {
8843
    foreach my $i ( sort keys %PACKAGE_DIST ) {
8949
        my(@sets) = split( /$;/, $PACKAGE_DIST{$i} );
8844
        my(@sets) = split( /$;/, $PACKAGE_DIST{$i} );
8950
 
8845
 
8951
        MakeEntry( "package-${i}:\tmake_init package_setALL",
8846
        MakeEntry( "package-${i}:\tmake_init package_setALL",
8952
                "\n", " package_set", "", @sets );
8847
                "\n", " package_set", "", @sets );
8953
    }
8848
    }
8954
    MakeNewLine();
8849
    MakeNewLine();
8955
 
8850
 
-
 
8851
    MakePrint("#   PACKAGE SETS\n");
8956
    MakePrint ".PHONY:\t\tpackage_setALL\n" .
8852
    MakePrint ".PHONY:\t\tpackage_setALL\n" .
8957
                "package_setALL:\n";
8853
                "package_setALL:\n";
8958
                
8854
                
8959
    foreach my $i ( sort keys %PACKAGE_SETS ) {
8855
    foreach my $i ( sort keys %PACKAGE_SETS ) {
8960
        MakePrint ".PHONY:\t\tpackage_set${i}\n" .
8856
        MakePrint ".PHONY:\t\tpackage_set${i}\n" .
Line 9021... Line 8917...
9021
}
8917
}
9022
 
8918
 
9023
    print MAKEFILE <<EOF;
8919
    print MAKEFILE <<EOF;
9024
	"\\n"
8920
	"\\n"
9025
 
8921
 
9026
#   make_init - Test toolset presence and sanity
-
 
9027
#   Will only be called ONCE for each platform in a recursive build
-
 
9028
#   Should be used to ensure that the required toolset is present
-
 
9029
#
-
 
9030
.PHONY:		make_init
-
 
9031
make_init:	$initdep
-
 
9032
 
-
 
9033
#   make_dir    - Create required subdirectories
-
 
9034
#   Will be invoked as a part of most targets that create files
-
 
9035
#   Will not be invoked when cleaning
-
 
9036
#
-
 
9037
.PHONY:		make_dir
-
 
9038
make_dir:	$mkdirdep
-
 
9039
 
-
 
9040
make_clean:
8922
make_clean:
9041
	-\@echo "Removing generated files (objects, libraries, binaries etc)";
8923
	-\@echo "Removing generated files (objects, libraries, binaries etc)";
9042
 
8924
 
9043
#
8925
#
9044
#   Under windows/cygwin, there is a problem with the rm being used
8926
#   Under windows/cygwin, there is a problem with the rm being used
Line 9060... Line 8942...
9060
				\$(rm) -r *.err *.cmd ; );\\
8942
				\$(rm) -r *.err *.cmd ; );\\
9061
			fi ;\\
8943
			fi ;\\
9062
		done;\\
8944
		done;\\
9063
	)
8945
	)
9064
 
8946
 
-
 
8947
.PHONY:		lint_init
-
 
8948
lint_init:
-
 
8949
 
9065
EOF
8950
EOF
9066
 
8951
 
-
 
8952
#
9067
    print MAKEFILE <<EOF;
8953
#   Dependencies for 'make_init'
-
 
8954
#
-
 
8955
#
-
 
8956
my @initdep;
-
 
8957
push @initdep, '$(INITS)' if ( @INITS );
9068
 
8958
 
-
 
8959
#
-
 
8960
#   Dependencies for 'make_dir'
-
 
8961
#
9069
.PHONY:		generate
8962
my @mkdirdep;
-
 
8963
push @mkdirdep, '$(GBE_OBJDIR)' if ( @CSRCS || @CXXSRCS || @OBJS || %PROG_OBJS || %TESTPROG_OBJS );
9070
generate:	make_init $generatedep $projectgendep
8964
push @mkdirdep, '$(SHDIRS)'     if ( %SHOBJ_LIB || @SHLIBS);
-
 
8965
push @mkdirdep, '$(GBE_LIBDIR)' if ( @LIBS || @MLIBS || @SHLIBS || %INSTALL_LIBS || %PACKAGE_LIBS );
-
 
8966
push @mkdirdep, '$(GBE_BINDIR)' if ( @SHLIBS || %SCRIPTS || @PROGS || %TESTPROGS || %INSTALL_PROGS || %PACKAGE_PROGS );
9071
 
8967
 
9072
.PHONY:		ungenerate
8968
#
9073
ungenerate:	toolset_ungen $ungenerate_files
8969
#   Actions for for 'unobj'
-
 
8970
#
9074
$ungenact
8971
my @unobjact;
-
 
8972
push @unobjact, RmFilesCmd( 'OBJS' )            if ( @OBJS );
-
 
8973
push @unobjact, RmFilesCmd( 'SHOBJS' )          if ( %SHOBJ_LIB );
-
 
8974
push @unobjact, RmFilesCmd( 'PROGOBJS' )        if ( @PROGOBJS );
-
 
8975
push @unobjact, RmFilesCmd( 'TESTPROGOBJS' )    if ( %TESTPROG_OBJS );
-
 
8976
push @unobjact, RmFilesCmd( 'TOOLSETOBJS' )     if ( @TOOLSETOBJS );
9075
 
8977
 
9076
.PHONY:		unobj
8978
#
9077
unobj:		toolset_unobj
8979
#   Dependencies for 'make_lib'
-
 
8980
#
9078
$unobjact
8981
my @libdep;
-
 
8982
push @libdep, '$(GBE_OBJDIR)', '$(GBE_LIBDIR)', '$(LIBS)' if ( @LIBS );
9079
 
8983
 
-
 
8984
#
9080
.PHONY:		make_lib
8985
#   Dependencies for 'lint_lib'
-
 
8986
#
9081
make_lib:	$libdep
8987
my @liblintdep;
-
 
8988
push @liblintdep, 'lint_init', '$(GBE_OBJDIR)', '$(GBE_LIBDIR)', '$(LINTLIBS)' if ( @LIBS );
9082
 
8989
 
-
 
8990
#
9083
.PHONY:		lint_lib
8991
#   Dependencies for 'make_mlib'
-
 
8992
#
9084
lint_lib:	$liblintdep
8993
my @mlibdep;
-
 
8994
push @mlibdep, '$(GBE_OBJDIR)', '$(GBE_LIBDIR)', '$(GBE_MLIBDIR)', '$(MLIBS)' if ( @MLIBS );
9085
 
8995
 
-
 
8996
#
9086
.PHONY:		make_mlib
8997
#   Dependencies for 'make_install_shlib' (tag)
-
 
8998
#
9087
make_mlib:	$mlibdep
8999
my @shlibdep;
-
 
9000
push @shlibdep, '$(SHDIRS)', '$(SHLIBS)' if ( @SHLIBS );
9088
 
9001
 
-
 
9002
#
9089
.PHONY:		lint_shlib
9003
#   Dependencies for 'lint_shlib'
-
 
9004
#
9090
lint_shlib:	$shliblintdep
9005
my @shliblintdep;
-
 
9006
push @shliblintdep, 'lint_init', '$(GBE_LIBDIR)', '$(LINTSHLIBS)' if ( @SHLIBS );
9091
 
9007
 
-
 
9008
#
9092
.PHONY:		unmake_lib
9009
#   Actions for 'unmake_lib'
9093
unmake_lib:	toolset_unlib
-
 
-
 
9010
#
9094
$unlibact
9011
my @unlibact;
-
 
9012
push @unlibact, RmFilesCmd( 'SHLIBS' )      if ( @SHLIBS );
-
 
9013
push @unlibact, RmFilesCmd( 'MLIBS' )       if ( @MLIBS );
-
 
9014
push @unlibact, RmFilesCmd( 'LIBS' )        if ( @LIBS );
-
 
9015
push @unlibact, RmFilesCmd( 'TOOLSETLIBS' ) if ( @TOOLSETLIBS );
9095
 
9016
 
-
 
9017
#
9096
.PHONY:		make_script
9018
#   Actions for 'unmake_mlib'
-
 
9019
#
9097
make_script:	$scriptdep
9020
my @unmlibact;
-
 
9021
push @unmlibact, RmFilesCmd( 'MLIBS' ) if ( @MLIBS );
9098
 
9022
 
-
 
9023
#
9099
.PHONY:		unmake_script
9024
#   Dependencies for 'make_script'
9100
unmake_script:
9025
#
9101
$unscriptact
9026
my @scriptdep;
-
 
9027
push @scriptdep, '$(GBE_BINDIR)', '$(SCRIPTS)' if ( %SCRIPTS );
9102
 
9028
 
-
 
9029
#
9103
.PHONY:		make_prog
9030
#   Actions for 'unmake_script'
-
 
9031
#
-
 
9032
my @unscriptact;
-
 
9033
push @unscriptact , RmFilesCmd( 'SCRIPTS' ) if ( %SCRIPTS );
9104
make_prog:	$scriptdep $progdep $projectdep
9034
push @unscriptact , RmFilesCmd( 'COPYIN' )  if ( @COPYIN );
9105
 
9035
 
-
 
9036
#
9106
.PHONY:		lint_prog
9037
#   Dependencies for 'make_prog'
-
 
9038
#
9107
lint_prog:	$proglintdep
9039
my @progdep;
-
 
9040
push @progdep, '$(GBE_OBJDIR)', '$(GBE_BINDIR)', '$(PROGS)' if ( @PROGS );
-
 
9041
push @progdep, '$(PROGS_EXTRA)' if (@PROGS_EXTRA);
9108
 
9042
 
-
 
9043
#
-
 
9044
#   Dependencies for 'make_prog' created for 'projects'
-
 
9045
#
9109
.PHONY:		run_tests
9046
my @projectdep;
9110
run_tests:	$scriptdep $testprogdep
9047
push @projectdep, '$(PROJECTS)' if (ListGeneratedProjects(1) );
9111
 
9048
 
-
 
9049
#
-
 
9050
#   Dependencies for 'generate' created for 'projects'
-
 
9051
#
9112
.PHONY:		run_unit_tests
9052
my @projectgendep;
9113
run_unit_tests:	$scriptdep $testprogdep
9053
push @projectgendep, '$(PROJECTSGEN)' if (ListGeneratedProjects(0) );
9114
 
9054
 
9115
.PHONY:		unmake_prog
-
 
-
 
9055
#
9116
unmake_prog:	toolset_unprog unmake_script $projectcleandep
9056
#   Dependencies for 'unmake_prog' created for 'projects'
-
 
9057
#
9117
$unprogact
9058
my @projectcleandep;
-
 
9059
push @projectcleandep, '$(PROJECTSCLEAN)' if (%PROJECTS);
9118
 
9060
 
-
 
9061
#
9119
.PHONY:		make_test
9062
#   Dependencies for 'lint_prog'
-
 
9063
#
9120
make_test:	$scriptdep $testprogdep
9064
my @proglintdep;
-
 
9065
push @proglintdep, 'lint_init', '$(GBE_OBJDIR)', '$(GBE_BINDIR)', '$(LINTPROGS)' if ( @PROGS || %TESTPROGS );
9121
 
9066
 
-
 
9067
#
9122
.PHONY:		unmake_prog
9068
#   Actions for 'unmake_prog'
9123
unmake_test:	toolset_untestprog unmake_script
-
 
-
 
9069
#
9124
$untestprogact
9070
my @unprogact;
-
 
9071
push @unprogact, RmFilesCmd( 'PROGS' )        if ( @PROGS );
-
 
9072
push @unprogact, RmFilesCmd( 'TOOLSETPROGS' ) if ( @TOOLSETPROGS );
9125
 
9073
 
-
 
9074
#
-
 
9075
#   Dependencies for 'lint_prog'
9126
EOF
9076
#
-
 
9077
my @testprogdep;
-
 
9078
push @testprogdep, '$(GBE_OBJDIR)', '$(GBE_BINDIR)', '$(TESTPROGS)' if ( %TESTPROGS );
9127
 
9079
 
9128
#-------------------------------------------------------------------------------
-
 
9129
#   Source browsing tools
-
 
9130
#
9080
#
9131
MakeHeader ("Source browsing tools");
9081
#   Dependencies for 'run_tests' and friends
-
 
9082
#
-
 
9083
my @untestprogact;
-
 
9084
push @untestprogact ,RmFilesCmd( 'TESTPROGS' ) if ( %TESTPROGS );
-
 
9085
 
-
 
9086
#
-
 
9087
#   Dependencies for 'generated'
-
 
9088
#
-
 
9089
my @generatedep;
-
 
9090
push @generatedep, '$(GENERATED)' if ( @GENERATED );
-
 
9091
 
-
 
9092
#
9132
    print MAKEFILE <<EOF;
9093
#   Actions for 'ungenerate'
-
 
9094
#
9133
.PHONY:			ctags
9095
my @ungenact;
-
 
9096
push @ungenact, RmFilesCmd( 'GENERATED' ) if ( @GENERATED );
-
 
9097
push @ungenact, RmFilesCmd( 'GENERATED_NOTSRC' ) if ( @GENERATED_NOTSRC );
-
 
9098
push @ungenact, RmFilesCmd( 'TOOLSETGENERATED' ) if ( @TOOLSETGENERATED );
-
 
9099
push @ungenact, RmFilesCmd( 'USERGENERATED' ) if ( @USERGENERATED );
-
 
9100
 
9134
ctags:
9101
#
-
 
9102
#   Dependencies for 'ungenerate'
9135
EOF
9103
#
9136
    $if->CTAGS()
9104
my @ungeneratedep;
9137
        if (@CSRCS || @CXXSRCS);
9105
push @ungeneratedep, '$(GENERATEDCLEAN)';
9138
 
9106
 
9139
#-------------------------------------------------------------------------------
9107
#-------------------------------------------------------------------------------
9140
#   Depend
9108
# Function        : PrintPhonyRule
9141
#
9109
#
-
 
9110
# Description     : Helper function to print some internal phony makefile targets
-
 
9111
#                   These are used to hold the basic makefile together
-
 
9112
#
9142
MakeHeader ("Depend");
9113
# Inputs          : $target         - Name of the phony target
9143
if ($::o && (@CSRCS || @CXXSRCS))
9114
#                   $prereq         - Prerequisites
-
 
9115
#                                     Leading spaces removed
-
 
9116
#                   $recipe         - Optional Reference to an array of recipes
-
 
9117
#                                     Will be printed one per line
-
 
9118
#
-
 
9119
#
-
 
9120
sub PrintPhonyRule
9144
{
9121
{
9145
    $ScmDependTags = 1;
9122
    my ($target, $prereq, $recipe) = @_;
9146
    print MAKEFILE <<EOF;
9123
    $prereq =~ s/^\s+//;
9147
depend:			\$(OBJDIR)/depend
-
 
9148
 
9124
 
9149
\$(OBJDIR)/depend:	$Makefile \$(GBE_OBJDIR)
9125
    MakePadded( 2, '.PHONY:', $target, "\n");
9150
\$(OBJDIR)/depend:	\$(CSRCS) \$(CXXSRCS)
-
 
9151
ifndef NODEPEND
-
 
9152
	\@echo [\$@] Doing a make depend..
-
 
9153
	-\@\$(rm) -f \$(OBJDIR)/depend
-
 
9154
EOF
-
 
9155
    $if->CCDepend( "\$(OBJDIR)/depend", "\$(CSRCS)" )
9126
    MakePadded( 2,"$target:", $prereq, "\n");
9156
        if ( @CSRCS );
-
 
9157
    $if->CXXDepend( "\$(OBJDIR)/depend", "\$(CXXSRCS)" )
9127
    MakePrint ("\t\t" . $_ . "\n") foreach ( @{$recipe} );
9158
        if ( @CXXSRCS );
-
 
9159
    MakePrint
9128
    MakePrint ("\n");
9160
        "\t-\@\$(touch) -f \$(OBJDIR)/depend\n";
-
 
9161
    print MAKEFILE <<EOF;
-
 
9162
else
-
 
9163
	\@echo [\$@] Skipping make depend..
-
 
9164
	-\@\$(rm) -f \$(OBJDIR)/depend
-
 
9165
endif
-
 
9166
EOF
-
 
9167
}
-
 
9168
else
-
 
9169
{
-
 
9170
    print MAKEFILE <<EOF;
-
 
9171
depend:
-
 
9172
EOF
-
 
9173
}
9129
}
9174
 
9130
 
-
 
9131
my %MakeTargets;
-
 
9132
 
-
 
9133
#   make_init - Test toolset presence and sanity
-
 
9134
#   Will only be called ONCE for each platform in a recursive build
-
 
9135
#   Should be used to ensure that the required toolset is present
-
 
9136
#
-
 
9137
PrintPhonyRule ('make_init',       "@initdep" );
-
 
9138
 
-
 
9139
#   make_dir    - Create required subdirectories
-
 
9140
#   Will be invoked as a part of most targets that create files
-
 
9141
#   Will be invoked by the calling wrappers
9175
    print MAKEFILE <<EOF;
9142
#   Should not be invoked when cleaning
-
 
9143
#
-
 
9144
PrintPhonyRule ('make_dir',       "@mkdirdep" );
9176
 
9145
 
9177
undepend:
9146
 
-
 
9147
PrintPhonyRule ('generate',       "@generatedep @projectgendep" );
-
 
9148
PrintPhonyRule ('ungenerate',     "@ungeneratedep",  \@ungenact);
-
 
9149
PrintPhonyRule ('unobj',          "",  \@unobjact);
9178
	-\$(GBE_RM) -f \$(OBJDIR)/depend
9150
PrintPhonyRule ('make_lib',       "@libdep" );
9179
EOF
-
 
-
 
9151
PrintPhonyRule ('lint_lib',       "@liblintdep" );
-
 
9152
PrintPhonyRule ('make_mlib',      "@mlibdep" );
-
 
9153
PrintPhonyRule ('lint_shlib',     "@shliblintdep" );
-
 
9154
PrintPhonyRule ('unmake_lib',     "", \@unlibact );
-
 
9155
PrintPhonyRule ('unmake_mlib',    "", \@unmlibact );
-
 
9156
PrintPhonyRule ('make_script',    "@scriptdep" );
-
 
9157
PrintPhonyRule ('unmake_script',  "", \@unscriptact );
-
 
9158
PrintPhonyRule ('make_prog',      "@scriptdep @progdep @projectdep" );
-
 
9159
PrintPhonyRule ('lint_prog',      "@proglintdep" );
-
 
9160
PrintPhonyRule ('run_tests',      "@scriptdep @testprogdep" );
-
 
9161
PrintPhonyRule ('run_unit_tests', "@scriptdep @testprogdep" );
-
 
9162
PrintPhonyRule ('unmake_prog',    "unmake_script @projectcleandep", \@unprogact );
-
 
9163
PrintPhonyRule ('make_test',      "@scriptdep @testprogdep" );
-
 
9164
PrintPhonyRule ('unmake_test',    "unmake_script", \@untestprogact );
9180
 
9165
 
9181
#-------------------------------------------------------------------------------
9166
#-------------------------------------------------------------------------------
9182
#   Package and Installation Summary
9167
#   Package and Installation Summary
9183
#
9168
#
9184
    MakeHeader ("Package and Installation Summary");
9169
    MakeHeader ("Package and Installation Summary");
Line 9211... Line 9196...
9211
        MakePrint "\n\n";
9196
        MakePrint "\n\n";
9212
    }
9197
    }
9213
 
9198
 
9214
InstallTarget( "install_hdr",       \%INSTALL_HDRS );
9199
InstallTarget( "install_hdr",       \%INSTALL_HDRS );
9215
InstallTarget( "install_lib",       \%INSTALL_LIBS,  'make_mlib' );
9200
InstallTarget( "install_lib",       \%INSTALL_LIBS,  'make_mlib' );
9216
InstallTarget( "make_install_shlib",\%INSTALL_SHLIBS, '', $shlibdep);
9201
InstallTarget( "make_install_shlib",\%INSTALL_SHLIBS, '', "@shlibdep" );
9217
InstallTarget( "install_prog",      \%INSTALL_PROGS, 'make_script' );
9202
InstallTarget( "install_prog",      \%INSTALL_PROGS, 'make_script' );
9218
InstallTarget( "install_class",     \%INSTALL_CLSS );
9203
InstallTarget( "install_class",     \%INSTALL_CLSS );
9219
 
9204
 
9220
InstallTarget( "package_files",     \%PACKAGE_FILES );
9205
InstallTarget( "package_files",     \%PACKAGE_FILES );
9221
InstallTarget( "package_hdr",       \%PACKAGE_HDRS );
9206
InstallTarget( "package_hdr",       \%PACKAGE_HDRS );
Line 9262... Line 9247...
9262
UnpackageRule( "unpackage_lib",         \&UnpackageCmd, \%PACKAGE_LIBS );
9247
UnpackageRule( "unpackage_lib",         \&UnpackageCmd, \%PACKAGE_LIBS );
9263
UnpackageRule( "unpackage_shlib",       \&UnpackageCmd, \%PACKAGE_SHLIBS );
9248
UnpackageRule( "unpackage_shlib",       \&UnpackageCmd, \%PACKAGE_SHLIBS );
9264
UnpackageRule( "unpackage_prog",        \&UnpackageCmd, \%PACKAGE_PROGS );
9249
UnpackageRule( "unpackage_prog",        \&UnpackageCmd, \%PACKAGE_PROGS );
9265
UnpackageRule( "unpackage_class",       \&UnpackageCmd, \%PACKAGE_CLSS );
9250
UnpackageRule( "unpackage_class",       \&UnpackageCmd, \%PACKAGE_CLSS );
9266
 
9251
 
-
 
9252
#-------------------------------------------------------------------------------
-
 
9253
#
-
 
9254
#   Subdir deletion
-
 
9255
#   This is done AFTER the toolset functions have been invoked to create the
-
 
9256
#   build artifacts so that the toolsets can create directories too
-
 
9257
#
-
 
9258
#   Note: Toolset directories are deleted first
-
 
9259
#   Note: User Directories are deleted in the reverse order of creation
-
 
9260
#
-
 
9261
    MakeHeader ("Subdir deletion");
-
 
9262
    MakePrint( ".PHONY:		unmake_dir\n" );
-
 
9263
    MakePrint( "unmake_dir:\n" );
-
 
9264
    MakePrint( "\t-\$(AA_PRE)echo Removing directories;" );
-
 
9265
    MakePrint( " \\\n\t\$(rmdir) \$(TOOLSETDIRS);" )            if ( @TOOLSETDIRS );
-
 
9266
    MakePrint( " \\\n\t\$(rm) -rf \$(TOOLSETDIRTREES);" )       if ( @TOOLSETDIRTREES );
-
 
9267
    RmdirRules();
-
 
9268
    MakeNewLine();
-
 
9269
 
-
 
9270
#--------- Toolset Rules -------------------------------------------------------
-
 
9271
    MakeHeader ("Toolset Rules");
-
 
9272
    MakePrintList ( \@TOOLSETRULES );
9267
 
9273
 
9268
#-------------------------------------------------------------------------------
9274
#-------------------------------------------------------------------------------
9269
#   Makefile targets
9275
#   Makefile targets
9270
#
9276
#
9271
MakeHeader ("Makefile targets");
9277
MakeHeader ("Makefile targets",
-
 
9278
            "These targets are not used by JATS",
-
 
9279
            "They can only used when the makefile is used directly",
-
 
9280
            "This is not the intended use of this makefile",
-
 
9281
           );
9272
 
9282
 
9273
#
9283
#
9274
#   Examine %INC and extract included files within JATS
9284
#   Examine %INC and extract included files within JATS
9275
#   These will be added to the list of dependent files
9285
#   These will be added to the list of dependent files
9276
#
9286
#
Line 9286... Line 9296...
9286
        UniquePush (\@ScmDepends, $_ )
9296
        UniquePush (\@ScmDepends, $_ )
9287
    }
9297
    }
9288
}
9298
}
9289
 
9299
 
9290
MakeDefEntry    ( "GBE_DEPENDS", "=" );
9300
MakeDefEntry    ( "GBE_DEPENDS", "=" );
9291
MakeIfnDefEntry ( "NOSCMDEPEND", "GBE_DEPENDS", "+=", \@ScmDepends );
9301
MakeIfZeroEntry ( "NOSCMDEPEND", "GBE_DEPENDS", "+=", \@ScmDepends );
9292
 
9302
 
9293
    print MAKEFILE <<EOF;
9303
    print MAKEFILE <<EOF;
9294
 
9304
 
9295
.PHONY:		makefile
-
 
9296
\$(GBE_PLATFORM).mk:	\$(GBE_DEPENDS)
9305
\$(GBE_PLATFORM).mk:	\$(GBE_DEPENDS)
9297
	\@echo One or more JATS source or internal files have changed, "rebuild" required
9306
	\@echo One or more JATS source or internal files have changed, "rebuild" required
9298
	\@for i in \$? ; do echo "Changed: \$\$i"; done
9307
	\@for i in \$? ; do echo "      Changed: \$\$i"; done
9299
	\@exit 10
9308
	\@exit 10
9300
 
9309
 
9301
EOF
9310
EOF
9302
 
9311
 
9303
#-------------------------------------------------------------------------------
-
 
9304
#   Custom Rules
-
 
9305
#
-
 
9306
    MakeHeader ("Custom Rules");
-
 
9307
    MakePrintList ( \@RULES );
-
 
9308
 
-
 
9309
#-------------------------------------------------------------------------------
-
 
9310
#   Generated Files
-
 
9311
#
-
 
9312
    MakeHeader ("Generated Files");
-
 
9313
    MakePrint ("\n.PHONY: phony_generate\n\n" );
-
 
9314
    
-
 
9315
    foreach my $i ( @GENERATE_FILES )
-
 
9316
    {
-
 
9317
        my $gen_tag = $i->{'index'};
-
 
9318
 
-
 
9319
        #
-
 
9320
        #   Generate the basic generate rule and recipe
-
 
9321
        #   together with the prerequisites
-
 
9322
        #
-
 
9323
        MakeEntry ( "", ":", "", " ", @{$i->{'gen'}} );
-
 
9324
 
-
 
9325
        unless ( $i->{'clean'} && $i->{'shell'} )
-
 
9326
        {
-
 
9327
            MakeEntry ( "", "", " \\\n\t\t", "", @{$i->{'preq'}} );
-
 
9328
            MakeEntry ( "", "", " \\\n\t\t", "", "phony_generate" ) if $i->{'preq_sus'};
-
 
9329
            MakeEntry ( "", "", " \\\n\t\t", "", "$Makefile" )
-
 
9330
                if ( ! $ScmExpert );
-
 
9331
 
-
 
9332
            MakePrint ("\n\t" . "\@\$(echo) [$i->{'text'}] generating.." );
-
 
9333
            MakePrint ("\n\t" . "\$(XX_PRE)\$(call generate_$gen_tag,)" );
-
 
9334
        }
-
 
9335
 
-
 
9336
        #
-
 
9337
        #   Generate 'clean' rules and recipes
-
 
9338
        #
-
 
9339
        if ( $i->{'clean'} )
-
 
9340
        {
-
 
9341
            MakePrint ("\n\nPHONY: clean_generate_$gen_tag" );
-
 
9342
            MakePrint ("\nclean_generate_$gen_tag:" );
-
 
9343
            MakePrint ("\n\t" . "\@\$(call generate_$gen_tag,$i->{'clean'})" );
-
 
9344
        }
-
 
9345
 
-
 
9346
        #
-
 
9347
        #   Define a function to contain the body of the generation call
-
 
9348
        #   The first argument will be a 'clean' argument
-
 
9349
        #
-
 
9350
        MakePrint ("\n\ndefine generate_$gen_tag" );
-
 
9351
        if ( $i->{'shell'} )
-
 
9352
        {
-
 
9353
            MakeEntry ("\n\t(" , "\\\n\t)\n", " \\\n\t", ";" , @{$i->{'toolargs'}} );
-
 
9354
        }
-
 
9355
        else
-
 
9356
        {
-
 
9357
            MakeEntry ("\n\t" . $i->{'tool'} . ' $1', "\n", " \\\n\t\t", "" , @{$i->{'toolargs'}} );
-
 
9358
        }
-
 
9359
        MakePrint ("endef\n\n" );
-
 
9360
    }
-
 
9361
 
-
 
9362
#-------------------------------------------------------------------------------
-
 
9363
#   Deploy rules
-
 
9364
#
-
 
9365
MakeHeader ("Deploy Rules");
-
 
9366
 
-
 
9367
print MAKEFILE <<EOF;
-
 
9368
.PHONY:		run_deploy
-
 
9369
EOF
-
 
9370
 
-
 
9371
#
-
 
9372
#   Build up the deployfile.pl command line from the available pieces
-
 
9373
#
-
 
9374
my $command_file = "";
-
 
9375
my @command_line;
-
 
9376
 
-
 
9377
if ( %DEPLOYPACKAGE )
-
 
9378
{
-
 
9379
    $command_file = $DEPLOYPACKAGE{'cmdfile'};
-
 
9380
 
-
 
9381
    push @command_line, "\$(XX_PRE)\$(GBE_PERL) -w $command_file";
-
 
9382
    push @command_line, "-r \"\$(GBE_ROOT)\"";
-
 
9383
    push @command_line, "-n \"$DEPLOYPACKAGE{'name'}\"";
-
 
9384
    push @command_line, "-d \"$DEPLOYPACKAGE{'dir'}\"";
-
 
9385
    push @command_line, "-v \"\$(BUILDVER)\"";
-
 
9386
    push @command_line, "-t \"\$(GBE_TYPE)\"";
-
 
9387
    push @command_line, "-o \"\$(BUILDPREVIOUSVER)\"";
-
 
9388
    push @command_line, "-m \"\$(GBE_PLATFORM)\"";
-
 
9389
    push @command_line, "-g \"\$(GBE_TARGET)\"";
-
 
9390
    push @command_line, "-k \"\$(GBE_PRODUCT)\""        if ( $ScmProduct );
-
 
9391
    push @command_line, "-p \"\$(DEPLOYPATCH)\""        if ( $ScmDeploymentPatch );
-
 
9392
 
-
 
9393
}
-
 
9394
 
-
 
9395
MakeEntry( "run_deploy:\t$command_file\n", "\n", "\t\t", " \\\n", @command_line );
-
 
9396
 
-
 
9397
 
-
 
9398
#-------------------------------------------------------------------------------
-
 
9399
#   Toolset Post Processing
-
 
9400
#   Allow the toolset to perform any post processing, before we finally write
-
 
9401
#   out any definitions.
-
 
9402
#
-
 
9403
#   We will not interprete any more user directives, but new stuff may get added
-
 
9404
#
-
 
9405
#
-
 
9406
MakeHeader ("Toolset Post Processing");
-
 
9407
$if->Postprocess();
-
 
9408
 
-
 
9409
#-------------------------------------------------------------------------------
-
 
9410
#
-
 
9411
#   Subdir deletion
-
 
9412
#   This is done AFTER the toolset functions have been invoked to create the
-
 
9413
#   build artifacts so that the toolsets can create directories too
-
 
9414
#
-
 
9415
#   Note: Directories are deleted in the reverse order of creation
-
 
9416
#
-
 
9417
    MakeHeader ("Subdir deletion");
-
 
9418
    MakePrint( ".PHONY:		make_undir\n" );
-
 
9419
    MakePrint( "make_undir:	toolset_undir\n" );
-
 
9420
    MakePrint( "\t-\$(AA_PRE)echo Removing directories;" );
-
 
9421
    RmdirRules();
-
 
9422
    MakeNewLine();
-
 
9423
 
-
 
9424
 
-
 
9425
#--------- Toolset rules ----------------------------------------------------
-
 
9426
MakeHeader ("Toolset rules");
-
 
9427
 
-
 
9428
MakeDefEntry( "USERGENERATED",        "=", \@USERGENERATED )    if ( @USERGENERATED );
-
 
9429
MakeDefEntry( "TOOLSETGENERATED",     "=", \@TOOLSETGENERATED ) if ( @TOOLSETGENERATED );
-
 
9430
MakeDefEntry( "TOOLSETOBJS",          "=", \@TOOLSETOBJS )      if ( @TOOLSETOBJS );
-
 
9431
MakeDefEntry( "TOOLSETLIBS",          "=", \@TOOLSETLIBS )      if ( @TOOLSETLIBS );
-
 
9432
MakeDefEntry( "TOOLSETPROGS",         "=", \@TOOLSETPROGS )     if ( @TOOLSETPROGS );
-
 
9433
MakeDefEntry( "TOOLSETDIRS",          "=", \@TOOLSETDIRS )      if ( @TOOLSETDIRS );
-
 
9434
MakeDefEntry( "TOOLSETDIRTREES",      "=", \@TOOLSETDIRTREES )  if ( @TOOLSETDIRTREES );
-
 
9435
 
-
 
9436
my $me_ungenact = MakeEntry::New( *MAKEFILE, 'toolset_ungen', '--Phony' );
-
 
9437
   $me_ungenact->AddRecipe( '$(call RmFiles,TOOLSETGENERATED)' ) if ( @TOOLSETGENERATED );
-
 
9438
   $me_ungenact->AddRecipe( '$(call RmFiles,USERGENERATED)' )    if ( @USERGENERATED );
-
 
9439
   $me_ungenact->Print();
-
 
9440
 
-
 
9441
my $me_unobjact = MakeEntry::New( *MAKEFILE, 'toolset_unobj', '--Phony' );
-
 
9442
   $me_unobjact->AddRecipe( '$(call RmFiles,TOOLSETOBJS)' )    if ( @TOOLSETOBJS );
-
 
9443
   $me_unobjact->Print();
-
 
9444
 
-
 
9445
my $me_unlibac = MakeEntry::New( *MAKEFILE, 'toolset_unlib', '--Phony' );
-
 
9446
   $me_unlibac->AddRecipe( '$(call RmFiles,TOOLSETLIBS)' )    if ( @TOOLSETLIBS );
-
 
9447
   $me_unlibac->Print();
-
 
9448
 
-
 
9449
my $me_unprogact = MakeEntry::New( *MAKEFILE, 'toolset_unprog', '--Phony' );
-
 
9450
   $me_unprogact->AddRecipe( '$(call RmFiles,TOOLSETPROGS)' )    if ( @TOOLSETPROGS );
-
 
9451
   $me_unprogact->Print();
-
 
9452
 
-
 
9453
my $me_undiract = MakeEntry::New( *MAKEFILE, 'toolset_undir', '--Phony' );
-
 
9454
   $me_undiract->AddRecipe( '$(rmdir) $(TOOLSETDIRS)' )             if ( @TOOLSETDIRS );
-
 
9455
   $me_undiract->AddRecipe( '$(GBE_RM) -rf $(TOOLSETDIRTREES)' )    if ( @TOOLSETDIRTREES );
-
 
9456
   $me_undiract->Print();
-
 
9457
 
-
 
9458
my $me_untestprogact = MakeEntry::New( *MAKEFILE, 'toolset_untestprog', '--Phony' );
-
 
9459
   $me_untestprogact->Print();
-
 
9460
 
-
 
9461
 
-
 
9462
#--------- Toolset Rules -------------------------------------------------------
-
 
9463
    MakeHeader ("Toolset Rules");
-
 
9464
    MakePrintList ( \@TOOLSETRULES );
-
 
9465
 
-
 
9466
#--------- Dependencies --------------------------------------------------------
-
 
9467
    MakeHeader ("Dependencies");
-
 
9468
    print MAKEFILE <<EOF;
-
 
9469
ifndef NODEPEND
-
 
9470
 ifdef IFLAG
-
 
9471
  ifneq "\$(IFLAG)" "0"
-
 
9472
-include	\$(OBJDIR)/depend
-
 
9473
  endif
-
 
9474
 endif
-
 
9475
endif
-
 
9476
 
-
 
9477
EOF
-
 
9478
 
-
 
9479
#--------- Maketags ------------------------------------------------------------
9312
#--------- Maketags ------------------------------------------------------------
9480
    MakeHeader ("Maketags");
-
 
-
 
9313
 
9481
    Maketag( "make_init",           @INITS );
9314
    Maketag( "make_init",           @INITS );
9482
    Maketag( "make_dir",            $mkdirdep );
9315
    Maketag( "make_dir",            @mkdirdep );
9483
    Maketag( "generate",            $generatedep || $projectgendep || @USERGENERATED || ($ScmToolsetGenerate != 0) );
9316
    Maketag( "generate",            @generatedep || @projectgendep || @USERGENERATED || ($ScmToolsetGenerate != 0) );
9484
    Maketag( "depend",              $ScmDependTags != 0 );
9317
    Maketag( "depend",              $ScmDependTags != 0 );
9485
    Maketag( "make_lib",            $libdep );
9318
    Maketag( "make_lib",            @libdep );
-
 
9319
    Maketag( "make_mlib",           @mlibdep );
9486
    Maketag( "make_install_shlib",  %INSTALL_SHLIBS || $shlibdep);
9320
    Maketag( "make_install_shlib",  %INSTALL_SHLIBS || @shlibdep);
9487
    Maketag( "make_script",         $scriptdep );
9321
    Maketag( "make_script",         @scriptdep );
9488
    Maketag( "make_prog",           $progdep || $projectdep );
9322
    Maketag( "make_prog",           @progdep || @projectdep );
9489
    Maketag( "make_test",           $testprogdep );
9323
    Maketag( "make_test",           @testprogdep );
9490
    Maketag( "run_tests",           @TESTS_TO_RUN || @TESTPROJECT_TO_URUN);
9324
    Maketag( "run_tests",           @TESTS_TO_RUN || @TESTPROJECT_TO_URUN);
9491
    Maketag( "run_unit_tests",      $TESTS_TO_AUTORUN || @TESTPROJECT_TO_ARUN);
9325
    Maketag( "run_unit_tests",      $TESTS_TO_AUTORUN || @TESTPROJECT_TO_ARUN);
9492
    Maketag( "install_hdr",         %INSTALL_HDRS );
9326
    Maketag( "install_hdr",         %INSTALL_HDRS );
9493
    Maketag( "install_class",       %INSTALL_CLSS );
9327
    Maketag( "install_class",       %INSTALL_CLSS );
9494
    Maketag( "install_lib",         %INSTALL_LIBS );
9328
    Maketag( "install_lib",         %INSTALL_LIBS );
9495
    Maketag( "install_prog",        %INSTALL_PROGS );
9329
    Maketag( "install_prog",        %INSTALL_PROGS );
9496
    Maketag( "deploy",              %DEPLOYPACKAGE );
9330
    Maketag( "deploy",              %DEPLOYPACKAGE );
9497
    Maketag( "package",             %PACKAGE_FILES || %PACKAGE_HDRS || %PACKAGE_CLSS ||
9331
    Maketag( "package",             %PACKAGE_FILES || %PACKAGE_HDRS || %PACKAGE_CLSS ||
9498
                                    %PACKAGE_LIBS || %PACKAGE_SHLIBS || %PACKAGE_PROGS );
9332
                                    %PACKAGE_LIBS || %PACKAGE_SHLIBS || %PACKAGE_PROGS );
9499
 
9333
 
-
 
9334
    #
-
 
9335
    #   Display tags in the MAKEFILE
-
 
9336
    #   Not used here - just for show
-
 
9337
    #
-
 
9338
    MakeHeader ("Maketags");
-
 
9339
    foreach my $tag ( sort keys %MakeTags )
-
 
9340
    {
-
 
9341
        MakePadded( 2, "#   $tag:", defined ($MakeTags{$tag}) ? 1 : 0, "\n");
-
 
9342
    }
-
 
9343
 
9500
#-------------------------------------------------------------------------------
9344
#-------------------------------------------------------------------------------
9501
#   End of Makefile
9345
#   End of Makefile
9502
#
9346
#
9503
    MakeHeader ("End of Makefile");
9347
    MakeHeader ("End of Makefile");
9504
    close( MAKEFILE );
9348
    close( MAKEFILE );
Line 9525... Line 9369...
9525
# Inputs          : tag_name
9369
# Inputs          : tag_name
9526
#                   dep
9370
#                   dep
9527
#
9371
#
9528
# Returns         : 
9372
# Returns         : 
9529
#
9373
#
9530
our %MakeTags;
-
 
9531
sub Maketag
9374
sub Maketag
9532
{
9375
{
9533
    my( $tag, $dep ) = @_;
9376
    my( $tag, $dep ) = @_;
9534
    $MakeTags{$tag} = 1 if ( defined($dep) && $dep );
9377
    $MakeTags{$tag} = 1 if ( defined($dep) && $dep );
9535
}
9378
}
Line 9607... Line 9450...
9607
 
9450
 
9608
    #
9451
    #
9609
    #   Create a definition of the physical directory
9452
    #   Create a definition of the physical directory
9610
    #
9453
    #
9611
    my $path = $MkdirRuleData{$subdir}{path};
9454
    my $path = $MkdirRuleData{$subdir}{path};
9612
    MakePrint "\n$alias\t:= $path" if ( $path && $alias );
9455
    MakePadded (2, $alias, ":= $path\n") if ( $path && $alias );
9613
 
9456
 
9614
    #   Create an alias to be used within rules
9457
    #   Create an alias to be used within rules
9615
    #   The defined aliase will be prefixed with 'GBE_'
9458
    #   The defined aliase will be prefixed with 'GBE_'
9616
    #
9459
    #
9617
    MakePrint "\nGBE_$alias\t:= $subdir/$MkdirRuleGbeFile" if ( $alias );
9460
    MakePadded (2, "GBE_$alias", ":= $subdir/$MkdirRuleGbeFile\n") if ( $alias );
9618
 
9461
 
9619
    #
9462
    #
9620
    #   Create a recipe to create the directory
9463
    #   Create a recipe to create the directory
9621
    #   This is not as simple as it sounds
9464
    #   This is not as simple as it sounds
9622
    #   The touch is required.
9465
    #   The touch is required.
9623
    #       Had 'timestamp' issues on solaris'. The 'echo' did not appear
9466
    #       Had 'timestamp' issues on solaris'. The 'echo' did not appear
9624
    #       to be enough. Perhaps the output was not flushed
9467
    #       to be enough. Perhaps the output was not flushed
9625
    #
9468
    #
-
 
9469
    MakePadded (2, "$subdir", ": $subdir/$MkdirRuleGbeFile\n");
9626
    MakePrint
9470
    MakePrint
9627
        "\n".
-
 
9628
        "$subdir:\t$subdir/$MkdirRuleGbeFile\n".
-
 
9629
        "$subdir/$MkdirRuleGbeFile:\n".
9471
        "$subdir/$MkdirRuleGbeFile:\n".
9630
        "\t\$(XX_PRE)if [ ! -d $subdir ]; then \$(mkdir) -p $subdir; fi; \\\n".
9472
        "\t\$(XX_PRE)if [ ! -d $subdir ]; then \$(mkdir) -p $subdir; fi; \\\n".
9631
        "\t\$(echo) '# DO NOT REMOVE.' > \$@; \\\n".
9473
        "\t\$(echo) '# DO NOT REMOVE.' > \$@; \\\n".
9632
        "\t\$(touch) \$@\n\n";
9474
        "\t\$(touch) \$@\n\n";
9633
 
-
 
9634
}
9475
}
9635
 
9476
 
9636
#-------------------------------------------------------------------------------
9477
#-------------------------------------------------------------------------------
9637
# Function        : RmdirRules
9478
# Function        : RmdirRules
9638
#
9479
#
Line 9653... Line 9494...
9653
    #   Sort such that subdirs are deleted files
9494
    #   Sort such that subdirs are deleted files
9654
    #
9495
    #
9655
    foreach my $subdir ( reverse sort keys %MkdirRuleData )
9496
    foreach my $subdir ( reverse sort keys %MkdirRuleData )
9656
    {
9497
    {
9657
        MakePrint "\\\n";                       # join to previous line
9498
        MakePrint "\\\n";                       # join to previous line
9658
        MakePrint "\tif [ -d $subdir ]; then\\\n";
9499
        MakePrint "\tif [ -d $subdir ]; then \\\n";
9659
        MakePrint "\t\t\$(rm) -f $subdir/$MkdirRuleGbeFile; \\\n" unless $MkdirRuleData{$subdir}{remove_all}; ;;
9500
        unless ( $MkdirRuleData{$subdir}{remove_all} )
-
 
9501
        {
9660
        MakePrint "\t\t\$(rm) -rf $subdir/*; \\\n" if $MkdirRuleData{$subdir}{remove_all}; ;
9502
            MakePrint "\t\t\$(rm) -f $subdir/$MkdirRuleGbeFile; \\\n";
9661
        MakePrint "\t\t\$(rmdir) $subdir;\\\n";
9503
            MakePrint "\t\t\$(rmdir) $subdir; \\\n";
-
 
9504
        }
-
 
9505
        else
-
 
9506
        {
-
 
9507
            MakePrint "\t\t\$(rm) -rf $subdir; \\\n";
-
 
9508
        }
9662
        MakePrint "\tfi;";
9509
        MakePrint "\tfi;";
9663
    }
9510
    }
9664
}
9511
}
9665
 
9512
 
9666
#-------------------------------------------------------------------------------
9513
#-------------------------------------------------------------------------------
Line 9687... Line 9534...
9687
        my $data = $MkdirRuleData{$subdir};
9534
        my $data = $MkdirRuleData{$subdir};
9688
        MkdirRule($subdir, $data->{alias}, $data->{path} );
9535
        MkdirRule($subdir, $data->{alias}, $data->{path} );
9689
    }
9536
    }
9690
}
9537
}
9691
 
9538
 
9692
 
-
 
9693
#-------------------------------------------------------------------------------
9539
#-------------------------------------------------------------------------------
9694
# Function        : PackageRule
9540
# Function        : PackageRule
9695
#
9541
#
9696
# Description     : Generate rules and recipes to "install" and "package" files
9542
# Description     : Generate rules and recipes to "install" and "package" files
9697
#
9543
#
Line 9853... Line 9699...
9853
#   Internal macro interface, see RULE.STD for definitions:
9699
#   Internal macro interface, see RULE.STD for definitions:
9854
#
9700
#
9855
sub RmFilesCmd
9701
sub RmFilesCmd
9856
{
9702
{
9857
    my ( $list ) = @_;
9703
    my ( $list ) = @_;
9858
    return "\t\$(call RmFiles,$list)\n";
9704
    return "\$(call RmFiles,$list)";
9859
}
9705
}
9860
 
9706
 
9861
sub InstallCmd
9707
sub InstallCmd
9862
{
9708
{
9863
    my( $dest, $file, $path, $fmode ) = @_;
9709
    my( $dest, $file, $path, $fmode ) = @_;