Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
227 dpurdie 1
# -*- mode: perl; tabs: 8; indent-width: 4; show-tabs: yes; -*-
2
# Copyright (C) 1998-2004 ERG Transit Systems, All rights reserved
3
#
4
# Module name   : Makelib.pl
5
# Module type   : Makefile system
6
#
7
# Description:
8
#       This modules builds the primary makefile for each directory,
9
#       used in conjunction with Makelib.pl2.  The produced makefile
10
#       acts as a frontend to platform builds.
11
#
12
# Notes:
13
#
14
#                       *** DO NOT DETAB ***
15
#
16
#       Beware the use of space v's tab characters within the
17
#       makefile generation sessions.
18
#
19
#.........................................................................#
20
 
255 dpurdie 21
require 5.006_001;
227 dpurdie 22
use strict;
23
use warnings;
261 dpurdie 24
use Getopt::Long;
263 dpurdie 25
use JatsError;
227 dpurdie 26
use JatsEnv;
27
use JatsMakeInfo qw(:create);
28
 
29
our $MakelibVersion         = "2.33";           # makelib.pl version
30
 
31
our $ScmRoot                = "";
32
our $ScmSrcDir              = "";
33
our $ScmMakelib             = "";
34
our @ScmDepends             = ();
35
our $ScmExpert              = 0;
36
our $ScmAll                 = 0;
37
our $ProjectBase            = "";               # Base of the user's project
38
our $ScmInterface           = "interface";
39
 
40
our @SUBDIRS                = ();
41
our @PLATFORMS              = ();
42
our %PLATFORMARGS           = ();
43
our @DEFINES                = "";
44
our @RULES                  = ();
45
 
46
our %PACKAGE_DIST           = ();
47
 
48
our $ROOTMAKEFILE           = 0;
49
our $PLATFORMINCLUDED       = 0;
50
our @BUILDPLATFORMS         = ();
51
 
263 dpurdie 52
our $GBE_CONFIG;
53
our $GBE_TOOLS;
54
our $GBE_PERL;
227 dpurdie 55
 
56
#.. Running under 'buildlib.pl' ?
331 dpurdie 57
#       This will be the 'require .../makelib.pl' that is present in
58
#       the build.pl files. Yes, its overly complicated, but it was
59
#       the way it was done.
227 dpurdie 60
#
61
unless ( $::ScmBuildlib )
62
{
63
    MakeLibInit();
64
}
65
 
66
sub MakeLibInit
67
{
261 dpurdie 68
    #.. Test environment
69
    #
227 dpurdie 70
    EnvImport( "GBE_BIN" );
71
    EnvImport( "GBE_PERL" );
72
    EnvImport( "GBE_TOOLS" );
73
    EnvImport( "GBE_CONFIG" );
74
    EnvImport( "GBE_MACHTYPE" );
75
 
261 dpurdie 76
    #.. Common stuff
77
    #
227 dpurdie 78
    require "$::GBE_TOOLS/common.pl";
79
 
80
    CommonInit( "makelib " );
81
    Debug( "version:   $MakelibVersion" );
82
 
261 dpurdie 83
    #.. Parse command line
84
    #       makefile.pl  rootdir Makelib.pl [options ...]
85
    #
86
    Verbose ("Command Line: @ARGV");
87
    my $opt_help = 0;
88
    my $result = GetOptions (
89
                "help+"         => \$opt_help,
90
                "interface=s"   => \$::ScmInterface,
91
                );
92
 
93
    MLUsage() if ( $opt_help || !$result );
94
 
95
    #
96
    #   Needs 2 command line arguments
97
    #
227 dpurdie 98
    $::ScmRoot    = StripDrive( ${ARGV[0]} );
279 dpurdie 99
    $::ScmRoot    = '/./' if ( $::ScmRoot eq '/'  );    # Prevent leading '//'
227 dpurdie 100
    $::ProjectBase= $::ScmRoot;
101
    $::ScmMakelib = ${ARGV[1]};
102
 
103
    Debug( "ARGV:      @ARGV" );
104
    Debug( "Root:      $::ScmRoot" );
105
    Debug( "Makelib:   $::ScmMakelib" );
106
 
261 dpurdie 107
    #.. Get the stuff from the platform definition file
108
    #
227 dpurdie 109
    ConfigLoad();
110
 
261 dpurdie 111
    #.. Get the stuff from the package definition file
112
    #
227 dpurdie 113
    require "$::ScmRoot/package.pl"
114
        if ( -f "$::ScmRoot/package.pl" );
115
}
116
 
117
#   MLUsage ---
118
#       Makelib command line usage.
119
#..
120
 
121
sub MLUsage
122
{
261 dpurdie 123
    Error ( "Usage: perl makefile.pl <ROOTDIR> <makelib.pl> [options ...]",
124
            "Valid options:",
125
            "   --help            Display Help",
126
            "   --interface=name  Set interface directory",
127
            );
227 dpurdie 128
}
129
 
130
#-------------------------------------------------------------------------------
131
# Function        : SubDir
132
#
133
# Description     : Recurse into the specified sub directories
134
#                   This is one of the very few directives in a 'makefile.pl'
135
#                   that is processed by this script - all the others are
136
#                   processed by makelib.pl2.
137
#
138
#                   This directive MUST appear before the 'Platform' directive
139
#
140
# Inputs          : List of sub directories to visit
141
#
142
# Returns         : Nothing
143
#
144
sub SubDir
145
{
146
    my( @NewDirs );
147
    Debug( "SubDir(@_)" );
148
    Error ("Directive 'SubDir' not allowed in this context") if ( $::ScmBuildlib  );
149
 
150
    #
151
    #   Support different constructs:
152
    #       'dir1 dir2'
153
    #       'dir1','dir2'
154
    #
155
    @NewDirs = map { split /\s+/ } @_;
156
    @NewDirs = grep { defined $_ } @NewDirs;
157
 
158
    foreach my $ThisDir ( @NewDirs )
159
    {
160
        Warning ("SubDir contains a '\\' character: $ThisDir" )
161
            if ( $ThisDir =~ m~\\~);
162
 
163
        if ( grep /^$ThisDir$/, @::SUBDIRS )
164
        {
165
            Warning( "Duplicate SubDir '$ThisDir' -- ignored." );
166
            next;
167
        }
168
        if ( ! ( -e $ThisDir and -d $ThisDir ) )
169
        {
170
            Error( "SubDir(): Subdirectory not found: '$ThisDir'",
171
                   "Current directory: $::Cwd" );
172
        }
173
        if ( ! -f $ThisDir . '/makefile.pl' )
174
        {
175
            Error( "SubDir(): makefile.pl not found in subdirectory: '$ThisDir'",
176
                   "Current directory: $::Cwd" );
177
        }
178
 
179
        push(@::SUBDIRS, $ThisDir);
180
    }
181
}
182
 
183
 
184
#-------------------------------------------------------------------------------
185
# Function        : RootMakefile
186
#
187
# Description     : This function is called from buildlib.pl prior to the
188
#                   generation of the root makefile. The Root Makefile is
189
#                   different to the others in this it does not have any platform
190
#                   specific makefiles associated with it. It is simply used to
191
#                   invoke the makefile in the 'src' subdirectory
192
#
193
# Inputs          : None
194
#
195
# Returns         : Nothing
196
#
197
sub RootMakefile
198
{
199
    Error ("Directive 'RootMakefile' not allowed in this context") if ( $::ScmBuildlib  );
200
    $::ROOTMAKEFILE = 1;
201
}
202
 
203
 
204
sub PackageDist
205
{
206
    my( $name, @elements ) = @_;
207
    Error ("Directive 'PackageDist' not allowed in this context") if ( $::ScmBuildlib  );
208
 
209
    foreach ( @elements ) {
210
        HashJoin( \%::PACKAGE_DIST, $;, $name, "$_" );
211
    }
212
}
213
 
214
 
215
sub Define
216
{
217
    Error ("Directive 'Define' not allowed in this context") if ( $::ScmBuildlib  );
218
    push( @::DEFINES, @_ );
219
}
220
 
221
 
222
sub Defines
223
{
224
    my( $path, $script ) = @_;
225
    my( $line );
226
    Error ("Directive 'Defines' not allowed in this context") if ( $::ScmBuildlib  );
227
 
228
    $script = Exists( $path, $script, "Defines" );
285 dpurdie 229
    open( my $fh, '<' ,$script ) ||
227 dpurdie 230
        Error( "cannot open '$script'" );
285 dpurdie 231
    while (<$fh>) {
227 dpurdie 232
        $_ =~ s/\s*(\n|$)//;                    # kill trailing whitespace & nl
233
        push( @::DEFINES, $_ );
234
    }
235
    push( @::ScmDepends, "$script" );           # makefile dependencies
285 dpurdie 236
    close( $fh );
227 dpurdie 237
}
238
 
239
 
240
sub Rule
241
{
242
    Error ("Directive 'Rule' not allowed in this context") if ( $::ScmBuildlib  );
243
    push( @::RULES, @_ );
244
}
245
 
246
 
247
sub Rules
248
{
249
    Error ("Directive 'Rules' not allowed in this context") if ( $::ScmBuildlib  );
250
    my( $path, $script ) = @_;
251
    my( $line );
252
 
253
    $script = Exists( $path, $script, "Rules" );
285 dpurdie 254
    open( my $fh, '<' ,$script ) ||
227 dpurdie 255
        Error( "cannot open '$script'" );
285 dpurdie 256
    while (<$fh>) {
227 dpurdie 257
        $_ =~ s/\s*(\n|$)//;                    # kill trailing whitespace & nl
258
        push( @::RULES, $_ );
259
    }
260
    push( @::ScmDepends, "$script" );           # makefile dependencies
285 dpurdie 261
    close( $fh );
227 dpurdie 262
}
263
 
264
#-------------------------------------------------------------------------------
265
# Function        : Platform
266
#
267
# Description     : Within "makelib.pl" the Platform directive is processed
268
#                   in such a manner as to trigger the verification and
269
#                   generation of Makefile and xxxxx.mk files in the tree
270
#                   below the makefile.pl
271
#
272
# Inputs          : A list of platforms for which the body of the makefile.pl
273
#                   are to be processed + GBE_PLATFORM
274
#
275
#                   "*", ...            - A wildcard for all platforms
276
#                                         Options include
277
#                                           --Targets (Not Products)
278
#                                           --Products
279
#                                           --NoPlatformBuilds
280
#                                           !xxx - Exclude a platform
281
#
282
#                   "--NoPlatformBuilds"
283
#
284
#                   "xxx"[, "yyy"]*     - A list of platforms and aliases
285
#
286
#                   "!xxx"              - A platform to be excluded
287
#
288
# Returns         :
289
#
290
sub Platform
291
{
292
    my ( @platforms ) = @_;
285 dpurdie 293
    my $exitVal;
294
    my $platform;
227 dpurdie 295
    my $noplatforms = 0;
296
    my $defplatforms = 0;
297
    my %platforms;
298
 
299
    Debug( "Platform(@_)" );
300
    Error ("Directive 'Platform' not allowed in this context") if ( $::ScmBuildlib  );
301
 
302
    #
303
    #   Import user platform specification (GBE_PLATFORM)
304
    #   Note: This is also used by the Makefile and it cannot be
305
    #         alias expanded or sanitised. Its not really really useful
306
    #
367 dpurdie 307
    #   Only use GBE_PLATFORM if the user has not specified to build ALL makefiles.
227 dpurdie 308
    #
309
    my %filter;
310
    my $filter_present = 0;
311
 
312
    if (  $::ScmAll == 0  )
313
    {
239 dpurdie 314
        $filter{GENERIC} = 1;
227 dpurdie 315
        foreach ( split( ' ', $ENV{ "GBE_PLATFORM" } || '' ) )
316
        {
317
            $filter{$_} = 1;
318
            $filter_present = 1;
319
        }
320
    }
321
 
322
    #
323
    #   Expand out the directive platform list (and optional arguments)
324
    #   Expand wildcards and aliases
325
    #
326
    #   Handle format
327
    #       Platform ('*', '--Options', [!Name]);
328
    #       Platform ('--NoPlatformBuilds' );
329
    #       Platform ('Name', '--Options', [!Name] );
330
    #       Platform ('!Name' );
331
    #
332
    #
333
    if ( $platforms[0] && $platforms[0] eq '*' )
334
    {
335
        my( $targets, $products );              # options
336
        my( @args );
337
        my( @exclude );
338
 
339
        $targets = $products = 0;
340
 
285 dpurdie 341
        foreach ( @platforms ) {
227 dpurdie 342
            next if ( /^\*$/);
343
            next if ( /^--Targets$/ && ($targets = 1));
344
            next if ( /^--Products$/ && ($products = 1));
345
            next if ( /^--NoPlatformBuilds/ && ($noplatforms = 1));
346
            next if ( /^--/ && push @args, $_ );
347
            next if ( /^!/  && push @exclude, $_ );
348
            Warning( "Platform: unknown option $_ -- ignored\n" );
349
        }
350
 
351
        #
352
        #   Determine the list of platforms to expand the '*' into
353
        #   The result may be modified by optional arguments
354
        #       --Targets           # Expands to all targets
355
        #       --Products          # Expands to all products
356
        #       OtherWise           # Expands to all build platforms
357
        #
358
        @platforms = ();                        # zap list
359
 
360
                                                # 'all' platforms
361
        push( @platforms, @::DEFBUILDPLATFORMS )
362
            unless ( $targets | $products );
363
 
364
        #
365
        #   Expand the '*' into a list of platforms that are NOT products
366
        #
367
        if ( $targets && defined( %::ScmBuildPlatforms ) )
368
        {                                       # targets
369
            foreach my $key (keys %::ScmBuildPlatforms) {
370
                push( @platforms, $key )
371
                    if (! defined( %::ScmBuildProducts ) ||
372
                            ! scalar $::ScmBuildProducts{ $key } );
373
            }
374
        }
375
 
376
        #
377
        #   Expand the '*' into a list of platforms that are 'products'
378
        #
379
        if ( $products && defined( %::ScmBuildProducts ) )
380
        {                                       # products
381
            foreach my $key (keys %::ScmBuildProducts) {
382
                push( @platforms, $key );
383
            }
384
        }
385
 
386
        #
387
        #   Distribute arguments over all expanded platforms
388
        #
389
        if ( @args )
390
        {
391
            my @baseplatforms;
392
            foreach  ( @platforms )
393
            {
394
                push @baseplatforms, $_, @args;
395
            }
396
            @platforms = @baseplatforms;
397
        }
398
 
399
        #
400
        #   Place the excluded platforms at the end of the list
401
        #
402
        push @platforms, ExpandPlatforms( @exclude );
403
 
404
    }
405
    elsif ( scalar @platforms == 1 && $platforms[0] eq "--NoPlatformBuilds" )
406
    {                                           # short-cut
407
        $noplatforms = 1;
408
        @platforms = @::DEFBUILDPLATFORMS;
409
    }
410
    else
411
    {                                           # aliasing
412
        @platforms = ExpandPlatforms( @platforms );
413
        #
414
        #   Process excluded platform lists
415
        #   Migrate excluded platforms to the end of the list
416
        #
417
        my (@include, @exclude);
418
 
419
        foreach ( @platforms )
420
        {
421
            next if ( m/^!/ && push @exclude, $_ );
422
            push @include, $_;
423
        }
424
 
425
        #
426
        #   If no included platforms have been found then assume that the
427
        #   list is an exclusion list and seed the platform list with
428
        #   a set of defualt platforms - like '*'
429
        #
430
        #
431
        @include = @::DEFBUILDPLATFORMS unless @include;
432
        @platforms = ( @include, @exclude );
433
    }
434
 
435
    $platform = "";                             # current platform
436
 
437
    #
438
    #   Process the directives expanded list of platforms
439
    #
440
 
441
    #
442
    #   Generate a HASH of lowercase known platform names
443
    #   This will be used to quickly validate platform names
444
    #
445
    my %lc_platforms;
446
    foreach  ( @::BUILDPLATFORMS )
447
    {
448
        $lc_platforms{ lc($_) } = $_;
449
    }
450
 
451
FILTER:
452
    foreach $_ ( @platforms )
453
    {
454
        if ( ! /^--(.*)/ )
455
        {
456
            $_ =~ s/^\s*//g;                    # leading white space
457
            $_ =~ s/\s*(\n|$)//;                # trailing white space
458
 
459
 
460
            #
461
            #   Remove specific platforms from the list
462
            #
463
            $defplatforms = 1;
464
            if ( m/!(.*)/ )
465
            {
466
                Verbose( "Excluded platform removed: $1" );
467
                delete $platforms{$1};
468
                next FILTER;
469
            }
470
 
471
 
472
            if ( exists $platforms{$_}  )
473
            {
474
                Warning( "duplicate platform '$_' -- ignored." );
475
                $platform = "";
476
                next FILTER;
477
            }
478
 
479
            #
480
            #   validate 'platform'
481
            #   Allow the user to have a bad case match ( Fred == fred == FRED )
482
            #
483
            my $lc_platform = lc($_);
484
            unless ( exists( $lc_platforms{$lc_platform}  ) )
485
            {
486
                Warning( "Platform '$_' not contained within BuildPlatforms -- ignored." )
487
                    unless ( exists( $::ScmBuildPlatforms{$_} ));
488
                $platform = "";
489
                next FILTER;
490
            }
491
 
492
            $lc_platform = $lc_platforms{$lc_platform};
493
            if ( $_ ne $lc_platform )
494
            {
495
                Warning( "Mixed case usage of platform '$_' -- corrected." );
496
                $_ = $lc_platform;
497
            }
498
 
499
                                                # filter 'platform'
500
            if ( $filter_present  )
501
            {
502
                if ( ! exists $filter{$_} )
503
                {
504
                    Verbose( "GBE_PLATFORM override $_ -- ignored" );
505
                    $platform = "";
506
                    next FILTER;
507
                }
508
            }
509
 
510
            #
511
            #   Platform not filtered out - must be using it.
512
            #
513
            Verbose( "Platform ... $_" );
514
            $platforms{$_} = 1;                 # Add to platform list
515
            $platform = $_;                     # new platform
516
        }
517
 
518
        elsif ( /^--NoPlatformBuilds$/ )
519
        {
520
            $noplatforms = 1;
521
        }
522
 
523
        elsif ( $platform ne "" )
524
        {                                       # other arguments
525
            Verbose( "          .. $_" );
526
 
527
            HashUniqueJoin( \%::PLATFORMARGS, $; , $platform, $1 ) ||
528
                Warning( "Duplicate argument '$platform=$_' -- ignored." );
529
        }
530
    }
531
    #
532
    #   Sort the platforms to ensure that the ordering is consistient throughout
533
    #
534
    @::PLATFORMS = sort keys %platforms;
535
 
536
    #
537
    #   Trap makefiles that don't have any platforms
538
    #   The user 'should' mark these as --NoPlatformBuilds
539
    #
540
    unless ( @::PLATFORMS )
541
    {
542
        Warning( "No platform definitions." )
543
            unless( $noplatforms || $defplatforms);
544
        $noplatforms = 1;
545
    }
546
 
547
#.. Common rules
548
#
549
    my( $file ) = Require( "$::GBE_CONFIG", "Rules", "Common rules " );
550
    push( @::ScmDepends, "$file" );
551
 
552
 
553
#.. Generate primary makefile
554
#
367 dpurdie 555
    $exitVal = Generate( $noplatforms || $::ROOTMAKEFILE );
556
    if ($::ROOTMAKEFILE == 1)
557
    {
558
        Warning ("WARNING: Problem generating Makefile ($exitVal)")
261 dpurdie 559
            if ($exitVal);
227 dpurdie 560
        return ($exitVal);
561
    }
562
 
367 dpurdie 563
    #
564
    #   Not creating the ROOT Makefile
565
    #   Exit the phase. All the work has been done
566
    #
227 dpurdie 567
    Debug( "Platform ExitVal:   $exitVal" );
568
    exit( $exitVal );
569
}
570
 
571
###############################################################################
572
# Private function section.
573
#       The following functions are used INTERNALLY by makelib.pl.
574
#
575
###############################################################################
576
 
577
#-------------------------------------------------------------------------------
578
# Function        : Generate
579
#
580
# Description     : Build makefiles ...
581
#                   Creates the command data files and the per-target .MK files
582
#
583
# Inputs          : $noplatforms    - 1 if this makefile does not have
367 dpurdie 584
#                                       any platforms. Also set for ROOTMAKEFILE
227 dpurdie 585
#
586
# Returns         : $exitVal
587
#
588
sub Generate
589
{
590
    my( $noplatforms ) = @_;
367 dpurdie 591
    my $exitVal = 0;
227 dpurdie 592
 
367 dpurdie 593
    #.. Build all the per-taget makefiles, if any exist
227 dpurdie 594
    #
595
    $exitVal = GeneratePlatforms()
596
        unless ($noplatforms );
597
 
367 dpurdie 598
    #.. Build the common Makefile.gbe
599
    #
227 dpurdie 600
    GenerateMakefile( $noplatforms );
601
    return $exitVal;
602
}
603
 
367 dpurdie 604
#-------------------------------------------------------------------------------
605
# Function        : GeneratePlatforms
227 dpurdie 606
#
367 dpurdie 607
# Description     : Generate all the per-taget makefiles
608
#                   Create all .mk files in the current directory
227 dpurdie 609
#
367 dpurdie 610
#                   Cleanup of unused .mk files is done when the WriteCommonInfo
611
#                   is processed. Makefiles that are no longer used will be purged
227 dpurdie 612
#
367 dpurdie 613
# Inputs          : None
614
#
615
# Returns         : exitVal
616
#
227 dpurdie 617
sub GeneratePlatforms
618
{
367 dpurdie 619
    my  $exitVal = 0;
620
    my  $exitVal2;
227 dpurdie 621
 
622
    foreach my $platform ( @::PLATFORMS )
623
    {
261 dpurdie 624
        my @CmdLine;
625
        push @CmdLine, $::GBE_PERL, $0, $::ScmRoot;
626
        push @CmdLine, $::ScmMakelib . "2";
627
        push @CmdLine, $platform;
628
        push @CmdLine, "--interface=$::ScmInterface" if ( $::ScmInterface ne "" );
227 dpurdie 629
 
630
        #
631
        #   Insert platform local arguments
632
        #
633
        if ($::PLATFORMARGS{ $platform })
634
        {
261 dpurdie 635
            foreach my $arg (split( /$;/, $::PLATFORMARGS{ $platform } )) {
636
                push @CmdLine,"--arg=$arg";
227 dpurdie 637
            }
638
        }
639
 
261 dpurdie 640
        #
641
        #   Invoke the command
642
        #   Don't use a Shell. Don't need the overhead
643
        #
644
        $exitVal2 = System( '--NoShell', @CmdLine );
227 dpurdie 645
 
261 dpurdie 646
        #
647
        #   Warn on any error
367 dpurdie 648
        #   Overall return code will be set if any platform fails, but we
649
        #   will process all of them first
261 dpurdie 650
        #
651
        if ( $exitVal2 )
652
        {
653
            Warning ("Problem generating $platform.mk in $::Cwd ($exitVal2)");
227 dpurdie 654
            $exitVal = $exitVal2;
655
        }
656
    }
657
 
658
    return $exitVal;
659
}
660
 
661
#-------------------------------------------------------------------------------
662
# Function        : GenerateMakefile
663
#
664
# Description     : Generate the non-platform specific makefile
665
#                   Once upon a time this was a real makefile
666
#                   Now its a simple file and a database as this offeres greater
667
#                   flexability.
668
#
669
#                   The file, "Makefile.gbe" contains enough info to get to the
670
#                   interface directory.
671
#
672
#                   The "database" is held in the interface directory as
673
#                       Makfile.cfg     - index to locate Makefile_nn.cfg
674
#                       Makefile_nn.cfg - data from a makefile.pl
675
#
676
# Inputs          : $noplatforms        - 1: no platform makefiles in this dir
677
#
678
# Returns         : Nothing
679
#
680
sub GenerateMakefile
681
{
682
    my( $noplatforms ) = @_;
683
    my %platform_info;
684
 
685
    #
686
    #   Determine targets that are limited to either debug or production builds
687
    #   This information may come from several places
688
    #
689
    foreach my $key ( @PLATFORMS )
690
    {
691
        my @args;
692
        UniquePush (\@args, split ( /$;/, $::PLATFORMARGS{$key} ))
693
            if ($::PLATFORMARGS{$key});
694
 
695
        UniquePush (\@args, map { s/^--//; $_} split ( /$;/, $::ScmBuildPlatforms{$key} ))
696
            if($::ScmBuildPlatforms{$key});
697
 
698
        my $hasOnlyProd  =  grep /^OnlyProd/, @args;
699
        my $hasOnlyDebug =  grep /^OnlyDebug/, @args;
700
 
701
        if ( $hasOnlyProd && $hasOnlyDebug )
702
        {
703
            Warning ("Target \"$key\" has both OnlyDebug and OnlyProd options",
704
                     "Both options ignored. Target will be built" );
705
 
706
            $hasOnlyProd = $hasOnlyDebug = 0;
707
        }
708
        $platform_info{$key}{prod}  = 1 unless $hasOnlyDebug;
709
        $platform_info{$key}{debug} = 1 unless $hasOnlyProd;
710
    }
711
 
712
    #
713
    #   Update common information in the Makefile_x.cfg file
714
    #
715
    WriteCommonInfo( \@::SUBDIRS, \%platform_info, $noplatforms, $::ROOTMAKEFILE );
716
 
717
    #
718
    #.. Maintain local information in Makefile.gbe
719
    #   This allows us to locate the interface directory
720
    #
721
    Message "[Control] $::Cwd";
722
    CreateMakeInfo();
723
}
724
 
725
1;
726