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; -*-
5709 dpurdie 2
# Copyright (c) VIX TECHNOLOGY (AUST) LTD
227 dpurdie 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
 
3967 dpurdie 31
our $ScmRoot;
227 dpurdie 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
    {
2450 dpurdie 160
        $ThisDir =~ s~/+$~~;
227 dpurdie 161
        Warning ("SubDir contains a '\\' character: $ThisDir" )
162
            if ( $ThisDir =~ m~\\~);
163
 
164
        if ( grep /^$ThisDir$/, @::SUBDIRS )
165
        {
166
            Warning( "Duplicate SubDir '$ThisDir' -- ignored." );
167
            next;
168
        }
169
        if ( ! ( -e $ThisDir and -d $ThisDir ) )
170
        {
171
            Error( "SubDir(): Subdirectory not found: '$ThisDir'",
172
                   "Current directory: $::Cwd" );
173
        }
174
        if ( ! -f $ThisDir . '/makefile.pl' )
175
        {
176
            Error( "SubDir(): makefile.pl not found in subdirectory: '$ThisDir'",
177
                   "Current directory: $::Cwd" );
178
        }
179
 
180
        push(@::SUBDIRS, $ThisDir);
181
    }
182
}
183
 
184
 
185
#-------------------------------------------------------------------------------
186
# Function        : RootMakefile
187
#
188
# Description     : This function is called from buildlib.pl prior to the
189
#                   generation of the root makefile. The Root Makefile is
190
#                   different to the others in this it does not have any platform
191
#                   specific makefiles associated with it. It is simply used to
192
#                   invoke the makefile in the 'src' subdirectory
193
#
194
# Inputs          : None
195
#
196
# Returns         : Nothing
197
#
198
sub RootMakefile
199
{
200
    Error ("Directive 'RootMakefile' not allowed in this context") if ( $::ScmBuildlib  );
201
    $::ROOTMAKEFILE = 1;
202
}
203
 
204
 
205
sub PackageDist
206
{
207
    my( $name, @elements ) = @_;
208
    Error ("Directive 'PackageDist' not allowed in this context") if ( $::ScmBuildlib  );
209
 
210
    foreach ( @elements ) {
211
        HashJoin( \%::PACKAGE_DIST, $;, $name, "$_" );
212
    }
213
}
214
 
215
 
216
sub Define
217
{
218
    Error ("Directive 'Define' not allowed in this context") if ( $::ScmBuildlib  );
219
    push( @::DEFINES, @_ );
220
}
221
 
222
 
223
sub Defines
224
{
225
    my( $path, $script ) = @_;
226
    my( $line );
227
    Error ("Directive 'Defines' not allowed in this context") if ( $::ScmBuildlib  );
228
 
229
    $script = Exists( $path, $script, "Defines" );
285 dpurdie 230
    open( my $fh, '<' ,$script ) ||
227 dpurdie 231
        Error( "cannot open '$script'" );
285 dpurdie 232
    while (<$fh>) {
227 dpurdie 233
        $_ =~ s/\s*(\n|$)//;                    # kill trailing whitespace & nl
234
        push( @::DEFINES, $_ );
235
    }
236
    push( @::ScmDepends, "$script" );           # makefile dependencies
285 dpurdie 237
    close( $fh );
227 dpurdie 238
}
239
 
240
 
241
sub Rule
242
{
243
    Error ("Directive 'Rule' not allowed in this context") if ( $::ScmBuildlib  );
244
    push( @::RULES, @_ );
245
}
246
 
247
 
248
sub Rules
249
{
250
    Error ("Directive 'Rules' not allowed in this context") if ( $::ScmBuildlib  );
251
    my( $path, $script ) = @_;
252
    my( $line );
253
 
254
    $script = Exists( $path, $script, "Rules" );
285 dpurdie 255
    open( my $fh, '<' ,$script ) ||
227 dpurdie 256
        Error( "cannot open '$script'" );
285 dpurdie 257
    while (<$fh>) {
227 dpurdie 258
        $_ =~ s/\s*(\n|$)//;                    # kill trailing whitespace & nl
259
        push( @::RULES, $_ );
260
    }
261
    push( @::ScmDepends, "$script" );           # makefile dependencies
285 dpurdie 262
    close( $fh );
227 dpurdie 263
}
264
 
265
#-------------------------------------------------------------------------------
266
# Function        : Platform
267
#
268
# Description     : Within "makelib.pl" the Platform directive is processed
269
#                   in such a manner as to trigger the verification and
270
#                   generation of Makefile and xxxxx.mk files in the tree
271
#                   below the makefile.pl
272
#
273
# Inputs          : A list of platforms for which the body of the makefile.pl
274
#                   are to be processed + GBE_PLATFORM
275
#
276
#                   "*", ...            - A wildcard for all platforms
277
#                                         Options include
278
#                                           --Targets (Not Products)
279
#                                           --Products
280
#                                           --NoPlatformBuilds
281
#                                           !xxx - Exclude a platform
282
#
283
#                   "--NoPlatformBuilds"
284
#
285
#                   "xxx"[, "yyy"]*     - A list of platforms and aliases
286
#
287
#                   "!xxx"              - A platform to be excluded
288
#
289
# Returns         :
290
#
291
sub Platform
292
{
293
    my ( @platforms ) = @_;
285 dpurdie 294
    my $exitVal;
295
    my $platform;
227 dpurdie 296
    my $noplatforms = 0;
297
    my $defplatforms = 0;
298
    my %platforms;
299
 
300
    Debug( "Platform(@_)" );
301
    Error ("Directive 'Platform' not allowed in this context") if ( $::ScmBuildlib  );
302
 
303
    #
304
    #   Import user platform specification (GBE_PLATFORM)
305
    #   Note: This is also used by the Makefile and it cannot be
306
    #         alias expanded or sanitised. Its not really really useful
307
    #
367 dpurdie 308
    #   Only use GBE_PLATFORM if the user has not specified to build ALL makefiles.
227 dpurdie 309
    #
310
    my %filter;
311
    my $filter_present = 0;
312
 
313
    if (  $::ScmAll == 0  )
314
    {
239 dpurdie 315
        $filter{GENERIC} = 1;
227 dpurdie 316
        foreach ( split( ' ', $ENV{ "GBE_PLATFORM" } || '' ) )
317
        {
318
            $filter{$_} = 1;
319
            $filter_present = 1;
320
        }
321
    }
322
 
323
    #
324
    #   Expand out the directive platform list (and optional arguments)
325
    #   Expand wildcards and aliases
326
    #
327
    #   Handle format
328
    #       Platform ('*', '--Options', [!Name]);
329
    #       Platform ('--NoPlatformBuilds' );
330
    #       Platform ('Name', '--Options', [!Name] );
331
    #       Platform ('!Name' );
332
    #
333
    #
334
    if ( $platforms[0] && $platforms[0] eq '*' )
335
    {
336
        my( $targets, $products );              # options
337
        my( @args );
338
        my( @exclude );
339
 
340
        $targets = $products = 0;
341
 
285 dpurdie 342
        foreach ( @platforms ) {
227 dpurdie 343
            next if ( /^\*$/);
344
            next if ( /^--Targets$/ && ($targets = 1));
345
            next if ( /^--Products$/ && ($products = 1));
346
            next if ( /^--NoPlatformBuilds/ && ($noplatforms = 1));
347
            next if ( /^--/ && push @args, $_ );
348
            next if ( /^!/  && push @exclude, $_ );
349
            Warning( "Platform: unknown option $_ -- ignored\n" );
350
        }
351
 
352
        #
353
        #   Determine the list of platforms to expand the '*' into
354
        #   The result may be modified by optional arguments
355
        #       --Targets           # Expands to all targets
356
        #       --Products          # Expands to all products
357
        #       OtherWise           # Expands to all build platforms
358
        #
359
        @platforms = ();                        # zap list
360
 
361
                                                # 'all' platforms
362
        push( @platforms, @::DEFBUILDPLATFORMS )
363
            unless ( $targets | $products );
364
 
365
        #
366
        #   Expand the '*' into a list of platforms that are NOT products
367
        #
369 dpurdie 368
        if ( $targets && ( %::ScmBuildPlatforms ) )
227 dpurdie 369
        {                                       # targets
370
            foreach my $key (keys %::ScmBuildPlatforms) {
371
                push( @platforms, $key )
369 dpurdie 372
                    if (! ( %::ScmBuildProducts ) ||
227 dpurdie 373
                            ! scalar $::ScmBuildProducts{ $key } );
374
            }
375
        }
376
 
377
        #
378
        #   Expand the '*' into a list of platforms that are 'products'
379
        #
369 dpurdie 380
        if ( $products && ( %::ScmBuildProducts ) )
227 dpurdie 381
        {                                       # products
382
            foreach my $key (keys %::ScmBuildProducts) {
383
                push( @platforms, $key );
384
            }
385
        }
386
 
387
        #
388
        #   Distribute arguments over all expanded platforms
389
        #
390
        if ( @args )
391
        {
392
            my @baseplatforms;
393
            foreach  ( @platforms )
394
            {
395
                push @baseplatforms, $_, @args;
396
            }
397
            @platforms = @baseplatforms;
398
        }
399
 
400
        #
401
        #   Place the excluded platforms at the end of the list
402
        #
403
        push @platforms, ExpandPlatforms( @exclude );
404
 
405
    }
406
    elsif ( scalar @platforms == 1 && $platforms[0] eq "--NoPlatformBuilds" )
407
    {                                           # short-cut
408
        $noplatforms = 1;
409
        @platforms = @::DEFBUILDPLATFORMS;
410
    }
411
    else
412
    {                                           # aliasing
413
        @platforms = ExpandPlatforms( @platforms );
414
        #
415
        #   Process excluded platform lists
416
        #   Migrate excluded platforms to the end of the list
417
        #
418
        my (@include, @exclude);
419
 
420
        foreach ( @platforms )
421
        {
422
            next if ( m/^!/ && push @exclude, $_ );
423
            push @include, $_;
424
        }
425
 
426
        #
427
        #   If no included platforms have been found then assume that the
428
        #   list is an exclusion list and seed the platform list with
429
        #   a set of defualt platforms - like '*'
430
        #
431
        #
432
        @include = @::DEFBUILDPLATFORMS unless @include;
433
        @platforms = ( @include, @exclude );
434
    }
435
 
436
    $platform = "";                             # current platform
437
 
438
    #
439
    #   Process the directives expanded list of platforms
440
    #
441
 
442
    #
443
    #   Generate a HASH of lowercase known platform names
444
    #   This will be used to quickly validate platform names
445
    #
446
    my %lc_platforms;
447
    foreach  ( @::BUILDPLATFORMS )
448
    {
449
        $lc_platforms{ lc($_) } = $_;
450
    }
451
 
452
FILTER:
453
    foreach $_ ( @platforms )
454
    {
455
        if ( ! /^--(.*)/ )
456
        {
457
            $_ =~ s/^\s*//g;                    # leading white space
458
            $_ =~ s/\s*(\n|$)//;                # trailing white space
459
 
460
 
461
            #
462
            #   Remove specific platforms from the list
463
            #
464
            $defplatforms = 1;
465
            if ( m/!(.*)/ )
466
            {
467
                Verbose( "Excluded platform removed: $1" );
468
                delete $platforms{$1};
469
                next FILTER;
470
            }
471
 
472
 
473
            if ( exists $platforms{$_}  )
474
            {
475
                Warning( "duplicate platform '$_' -- ignored." );
476
                $platform = "";
477
                next FILTER;
478
            }
479
 
480
            #
481
            #   validate 'platform'
482
            #   Allow the user to have a bad case match ( Fred == fred == FRED )
483
            #
484
            my $lc_platform = lc($_);
485
            unless ( exists( $lc_platforms{$lc_platform}  ) )
486
            {
487
                Warning( "Platform '$_' not contained within BuildPlatforms -- ignored." )
488
                    unless ( exists( $::ScmBuildPlatforms{$_} ));
489
                $platform = "";
490
                next FILTER;
491
            }
492
 
493
            $lc_platform = $lc_platforms{$lc_platform};
494
            if ( $_ ne $lc_platform )
495
            {
496
                Warning( "Mixed case usage of platform '$_' -- corrected." );
497
                $_ = $lc_platform;
498
            }
499
 
500
                                                # filter 'platform'
501
            if ( $filter_present  )
502
            {
503
                if ( ! exists $filter{$_} )
504
                {
505
                    Verbose( "GBE_PLATFORM override $_ -- ignored" );
506
                    $platform = "";
507
                    next FILTER;
508
                }
509
            }
510
 
511
            #
512
            #   Platform not filtered out - must be using it.
513
            #
514
            Verbose( "Platform ... $_" );
515
            $platforms{$_} = 1;                 # Add to platform list
516
            $platform = $_;                     # new platform
517
        }
518
 
519
        elsif ( /^--NoPlatformBuilds$/ )
520
        {
521
            $noplatforms = 1;
522
        }
523
 
524
        elsif ( $platform ne "" )
525
        {                                       # other arguments
526
            Verbose( "          .. $_" );
527
 
528
            HashUniqueJoin( \%::PLATFORMARGS, $; , $platform, $1 ) ||
529
                Warning( "Duplicate argument '$platform=$_' -- ignored." );
530
        }
531
    }
532
    #
533
    #   Sort the platforms to ensure that the ordering is consistient throughout
534
    #
535
    @::PLATFORMS = sort keys %platforms;
536
 
537
    #
538
    #   Trap makefiles that don't have any platforms
539
    #   The user 'should' mark these as --NoPlatformBuilds
540
    #
541
    unless ( @::PLATFORMS )
542
    {
543
        Warning( "No platform definitions." )
544
            unless( $noplatforms || $defplatforms);
545
        $noplatforms = 1;
546
    }
547
 
548
#.. Common rules
549
#
550
    my( $file ) = Require( "$::GBE_CONFIG", "Rules", "Common rules " );
551
    push( @::ScmDepends, "$file" );
552
 
553
 
554
#.. Generate primary makefile
555
#
367 dpurdie 556
    $exitVal = Generate( $noplatforms || $::ROOTMAKEFILE );
557
    if ($::ROOTMAKEFILE == 1)
558
    {
559
        Warning ("WARNING: Problem generating Makefile ($exitVal)")
261 dpurdie 560
            if ($exitVal);
227 dpurdie 561
        return ($exitVal);
562
    }
563
 
367 dpurdie 564
    #
565
    #   Not creating the ROOT Makefile
566
    #   Exit the phase. All the work has been done
567
    #
227 dpurdie 568
    Debug( "Platform ExitVal:   $exitVal" );
569
    exit( $exitVal );
570
}
571
 
572
###############################################################################
573
# Private function section.
574
#       The following functions are used INTERNALLY by makelib.pl.
575
#
576
###############################################################################
577
 
578
#-------------------------------------------------------------------------------
579
# Function        : Generate
580
#
581
# Description     : Build makefiles ...
582
#                   Creates the command data files and the per-target .MK files
583
#
584
# Inputs          : $noplatforms    - 1 if this makefile does not have
367 dpurdie 585
#                                       any platforms. Also set for ROOTMAKEFILE
227 dpurdie 586
#
587
# Returns         : $exitVal
588
#
589
sub Generate
590
{
591
    my( $noplatforms ) = @_;
367 dpurdie 592
    my $exitVal = 0;
227 dpurdie 593
 
367 dpurdie 594
    #.. Build all the per-taget makefiles, if any exist
227 dpurdie 595
    #
596
    $exitVal = GeneratePlatforms()
597
        unless ($noplatforms );
598
 
367 dpurdie 599
    #.. Build the common Makefile.gbe
600
    #
227 dpurdie 601
    GenerateMakefile( $noplatforms );
602
    return $exitVal;
603
}
604
 
367 dpurdie 605
#-------------------------------------------------------------------------------
606
# Function        : GeneratePlatforms
227 dpurdie 607
#
367 dpurdie 608
# Description     : Generate all the per-taget makefiles
609
#                   Create all .mk files in the current directory
227 dpurdie 610
#
367 dpurdie 611
#                   Cleanup of unused .mk files is done when the WriteCommonInfo
612
#                   is processed. Makefiles that are no longer used will be purged
227 dpurdie 613
#
367 dpurdie 614
# Inputs          : None
615
#
616
# Returns         : exitVal
617
#
227 dpurdie 618
sub GeneratePlatforms
619
{
367 dpurdie 620
    my  $exitVal = 0;
621
    my  $exitVal2;
227 dpurdie 622
 
623
    foreach my $platform ( @::PLATFORMS )
624
    {
261 dpurdie 625
        my @CmdLine;
626
        push @CmdLine, $::GBE_PERL, $0, $::ScmRoot;
627
        push @CmdLine, $::ScmMakelib . "2";
628
        push @CmdLine, $platform;
629
        push @CmdLine, "--interface=$::ScmInterface" if ( $::ScmInterface ne "" );
227 dpurdie 630
 
631
        #
632
        #   Insert platform local arguments
633
        #
634
        if ($::PLATFORMARGS{ $platform })
635
        {
261 dpurdie 636
            foreach my $arg (split( /$;/, $::PLATFORMARGS{ $platform } )) {
637
                push @CmdLine,"--arg=$arg";
227 dpurdie 638
            }
639
        }
640
 
261 dpurdie 641
        #
642
        #   Invoke the command
643
        #   Don't use a Shell. Don't need the overhead
644
        #
645
        $exitVal2 = System( '--NoShell', @CmdLine );
227 dpurdie 646
 
261 dpurdie 647
        #
648
        #   Warn on any error
367 dpurdie 649
        #   Overall return code will be set if any platform fails, but we
650
        #   will process all of them first
261 dpurdie 651
        #
652
        if ( $exitVal2 )
653
        {
654
            Warning ("Problem generating $platform.mk in $::Cwd ($exitVal2)");
227 dpurdie 655
            $exitVal = $exitVal2;
656
        }
657
    }
658
 
659
    return $exitVal;
660
}
661
 
662
#-------------------------------------------------------------------------------
663
# Function        : GenerateMakefile
664
#
665
# Description     : Generate the non-platform specific makefile
666
#                   Once upon a time this was a real makefile
4781 dpurdie 667
#                   Now its a simple file and a database as this offers greater
227 dpurdie 668
#                   flexability.
669
#
670
#                   The file, "Makefile.gbe" contains enough info to get to the
671
#                   interface directory.
672
#
673
#                   The "database" is held in the interface directory as
674
#                       Makfile.cfg     - index to locate Makefile_nn.cfg
675
#                       Makefile_nn.cfg - data from a makefile.pl
676
#
677
# Inputs          : $noplatforms        - 1: no platform makefiles in this dir
678
#
679
# Returns         : Nothing
680
#
681
sub GenerateMakefile
682
{
683
    my( $noplatforms ) = @_;
684
    my %platform_info;
685
 
686
    #
687
    #   Determine targets that are limited to either debug or production builds
688
    #   This information may come from several places
689
    #
690
    foreach my $key ( @PLATFORMS )
691
    {
692
        my @args;
693
        UniquePush (\@args, split ( /$;/, $::PLATFORMARGS{$key} ))
694
            if ($::PLATFORMARGS{$key});
695
 
696
        UniquePush (\@args, map { s/^--//; $_} split ( /$;/, $::ScmBuildPlatforms{$key} ))
697
            if($::ScmBuildPlatforms{$key});
698
 
699
        my $hasOnlyProd  =  grep /^OnlyProd/, @args;
700
        my $hasOnlyDebug =  grep /^OnlyDebug/, @args;
701
 
702
        if ( $hasOnlyProd && $hasOnlyDebug )
703
        {
704
            Warning ("Target \"$key\" has both OnlyDebug and OnlyProd options",
705
                     "Both options ignored. Target will be built" );
706
 
707
            $hasOnlyProd = $hasOnlyDebug = 0;
708
        }
709
        $platform_info{$key}{prod}  = 1 unless $hasOnlyDebug;
710
        $platform_info{$key}{debug} = 1 unless $hasOnlyProd;
711
    }
712
 
713
    #
714
    #   Update common information in the Makefile_x.cfg file
715
    #
716
    WriteCommonInfo( \@::SUBDIRS, \%platform_info, $noplatforms, $::ROOTMAKEFILE );
717
 
718
    #
719
    #.. Maintain local information in Makefile.gbe
720
    #   This allows us to locate the interface directory
721
    #
722
    Message "[Control] $::Cwd";
723
    CreateMakeInfo();
724
}
725
 
726
1;
727