Subversion Repositories DevTools

Rev

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

Rev 333 Rev 341
Line 124... Line 124...
124
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
124
    EnvImportOptional ( 'GBE_DPKG_STORE','' );
125
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
125
    EnvImportOptional ( 'GBE_DPKG_CACHE','' );
126
    EnvImportOptional ( 'GBE_DPKG_LOCAL','' );
126
    EnvImportOptional ( 'GBE_DPKG_LOCAL','' );
127
    EnvImportOptional ( 'GBE_DPKG_SBOX' ,'' );
127
    EnvImportOptional ( 'GBE_DPKG_SBOX' ,'' );
128
    EnvImportOptional ( 'GBE_DPLY'      ,'' );
128
    EnvImportOptional ( 'GBE_DPLY'      ,'' );
-
 
129
    EnvImportOptional ( 'GBE_SANDBOX'   ,'' );
129
 
130
 
130
    EnvImportOptional ( 'GBE_PLATFORM' );           # optional PLATFORM filter
131
    EnvImportOptional ( 'GBE_PLATFORM' );           # optional PLATFORM filter
131
    EnvImportOptional ( 'GBE_BUILDFILTER' );        # optional BUILD filter       
132
    EnvImportOptional ( 'GBE_BUILDFILTER' );        # optional BUILD filter       
132
    EnvImportOptional ( 'GBE_ABT' );                # optional ABT flags          
133
    EnvImportOptional ( 'GBE_ABT' );                # optional ABT flags          
133
    
134
    
Line 205... Line 206...
205
            Usage( "(E) build. Unknown command \"$CmdSwitch\"" );
206
            Usage( "(E) build. Unknown command \"$CmdSwitch\"" );
206
        }
207
        }
207
    }
208
    }
208
 
209
 
209
    #
210
    #
210
    #   If in -noforce, then check to see if we really need
211
    #   If we are not performing a ForceBuild, then we don't need to continue
211
    #   to force a build. Primarily used within a sandbox to
212
    #   We have updated the interface directory with BuildPkgArchive
212
    #   see if any work needs to be done
213
    #   information.
213
    #
214
    #
214
    if ( ! $ForceBuild && !$Clobber )
215
    unless ( $::GBE_SANDBOX )
215
    {
216
    {
216
        my @build_warn;
-
 
217
        my $bstamp = -M "$Cwd/$ScmBuildSrc";
-
 
218
        my $tstamp = -M "$Cwd/Makefile.gbe";
-
 
219
 
-
 
220
        push @build_warn, "Missing: Makefile.gbe" unless ( defined $tstamp );
-
 
221
        push @build_warn, "Modified build file ($ScmBuildSrc)" if ( $tstamp && $bstamp < $tstamp );
-
 
222
 
-
 
223
        if ( @build_warn )
217
        TestForForcedBuild();
224
        {
-
 
225
            Verbose ("Forcing Build", @build_warn );
-
 
226
        }
-
 
227
        else
-
 
228
        {
-
 
229
            Verbose ("No build performed. Build files up to date");
-
 
230
            exit 0;
-
 
231
        }
-
 
232
    }
218
    }
233
 
219
 
234
    #
220
    #
235
    #   Must inform makelib that its running under buildlib
221
    #   Must inform makelib that its running under buildlib
236
    #
222
    #
Line 247... Line 233...
247
 
233
 
248
#-------------------------------------------------------------------------------
234
#-------------------------------------------------------------------------------
249
# Function        : Log
235
# Function        : Log
250
#
236
#
251
# Description     : Internal function to generate a log file of the build process
237
# Description     : Internal function to generate a log file of the build process
252
#                   The function will print its argumenst to the screen and a log file
238
#                   The function will print its arguments to the screen and a log file
253
#
239
#
254
# Inputs          : Arguments will be printed
240
# Inputs          : Arguments will be printed
255
#
241
#
256
# Returns         : Nothing
242
# Returns         : Nothing
257
#
243
#
Line 1352... Line 1338...
1352
    #
1338
    #
1353
    if (  defined($::GBE_ABT) )   # clobber mode ?
1339
    if (  defined($::GBE_ABT) )   # clobber mode ?
1354
    {
1340
    {
1355
        if ( -d "$ifdirname" )
1341
        if ( -d "$ifdirname" )
1356
        {
1342
        {
1357
            System( "$::GBE_BIN/chmod -fR +w $ifdirname" );
-
 
1358
            System( "$::GBE_BIN/rm -rf $ifdirname" );
1343
                rmtree ( $ifdirname );
1359
        }
1344
        }
1360
    }
1345
    }
1361
 
1346
 
1362
    if ( $ifdirname eq "local" ) {
1347
    if ( $ifdirname eq "local" ) {
1363
        System( "$::GBE_BIN/mkdir -p $ifdirname/inc" );
1348
        mkpath ( "$ifdirname/inc" );
1364
        $BUILDLOCAL = "local";
1349
        $BUILDLOCAL = "local";
1365
 
1350
 
1366
    } else {
1351
    } else {
1367
        System( "$::GBE_BIN/mkdir -p $ifdirname/include" );
1352
        mkpath ( "$ifdirname/include" );
1368
        $BUILDINTERFACE = $ifdirname;
1353
        $BUILDINTERFACE = $ifdirname;
1369
        $::ScmInterface = $ifdirname;
1354
        $::ScmInterface = $ifdirname;
1370
    }
1355
    }
1371
    System( "$::GBE_BIN/mkdir -p $ifdirname/bin" );
1356
    mkpath ( "$ifdirname/bin" );
1372
    System( "$::GBE_BIN/mkdir -p $ifdirname/lib" );
1357
    mkpath ( "$ifdirname/lib" );
1373
 
1358
 
1374
    Log( "Interface .. $ifdirname" );
1359
    Log( "Interface .. $ifdirname" );
1375
    return 1;
1360
    return 1;
1376
}
1361
}
1377
 
1362
 
Line 1395... Line 1380...
1395
    #   without the overhead of the file
1380
    #   without the overhead of the file
1396
    #
1381
    #
1397
    if ( ! $dirfile )
1382
    if ( ! $dirfile )
1398
    {
1383
    {
1399
        Log( "DirTree .... $dirhead" );
1384
        Log( "DirTree .... $dirhead" );
1400
        System( "$::GBE_BIN/mkdir -p $dirhead" );
1385
        mkpath ( $dirhead );
1401
    }
1386
    }
1402
    else
1387
    else
1403
    {
1388
    {
1404
        Log( "DirTree .... $dirfile within $dirhead" );
1389
        Log( "DirTree .... $dirfile within $dirhead" );
1405
        System( "$::GBE_BIN/mkdir -p $dirhead" );
1390
        mkpath ( $dirhead );
1406
    
1391
 
1407
        open( DIRFILE, '<' ,$dirfile ) ||
1392
        open( DIRFILE, '<' ,$dirfile ) ||
1408
            Error( "cannot open '$dirfile'" );
1393
            Error( "cannot open '$dirfile'" );
1409
 
1394
 
1410
        while( $dirname = <DIRFILE> )
1395
        while( $dirname = <DIRFILE> )
1411
        {
1396
        {
Line 1416... Line 1401...
1416
            next unless ( $c == 1 );
1401
            next unless ( $c == 1 );
1417
 
1402
 
1418
            if ( ! -d "$dirhead/$dirname" )
1403
            if ( ! -d "$dirhead/$dirname" )
1419
            {
1404
            {
1420
                Log( "Dir ........ $dirhead/$dirname" );
1405
                Log( "Dir ........ $dirhead/$dirname" );
1421
                System( "$::GBE_BIN/mkdir -p $dirhead/$dirname" );
1406
                mkpath ( "$dirhead/$dirname" );
1422
            }
1407
            }
1423
        }
1408
        }
1424
 
1409
 
1425
        close( DIRFILE );
1410
        close( DIRFILE );
1426
    }
1411
    }
Line 1582... Line 1567...
1582
    {                                           # only once
1567
    {                                           # only once
1583
        Debug( "LinkClean" );
1568
        Debug( "LinkClean" );
1584
 
1569
 
1585
        foreach my $platform ( @BUILDPLATFORMS )
1570
        foreach my $platform ( @BUILDPLATFORMS )
1586
        {                                       # remove generated images
1571
        {                                       # remove generated images
1587
            System( "$::GBE_BIN/rm -rf $BUILDINTERFACE/$platform.rul" );
1572
            rmtree( "$BUILDINTERFACE/$platform.rul" );
1588
        }
1573
        }
1589
 
1574
 
1590
        $BUILDLPA_CLEAN_DONE = 1;
1575
        $BUILDLPA_CLEAN_DONE = 1;
1591
    }
1576
    }
1592
}
1577
}
Line 2692... Line 2677...
2692
    #
2677
    #
2693
    return if ( $BUILDPHASE  );
2678
    return if ( $BUILDPHASE  );
2694
    $BUILDPHASE = 1;
2679
    $BUILDPHASE = 1;
2695
 
2680
 
2696
    #
2681
    #
-
 
2682
    #   If we are not performing a ForceBuild, then we don't need to continue
-
 
2683
    #   We have updated the interface directory with BuildPkgArchive
-
 
2684
    #   information.
-
 
2685
    #
-
 
2686
    TestForForcedBuild();
-
 
2687
 
-
 
2688
    #
2697
    #   Calcuate the aliases that are being extracted from targets
2689
    #   Calcuate the aliases that are being extracted from targets
2698
    #
2690
    #
2699
    Process_TargetAlias();
2691
    Process_TargetAlias();
2700
 
2692
 
2701
    #
2693
    #
Line 2742... Line 2734...
2742
 
2734
 
2743
    return $Srcdir;
2735
    return $Srcdir;
2744
}
2736
}
2745
 
2737
 
2746
#-------------------------------------------------------------------------------
2738
#-------------------------------------------------------------------------------
-
 
2739
# Function        : TestForForcedBuild
-
 
2740
#
-
 
2741
# Description     : If a non-forced build has been requested, then see
-
 
2742
#                   if a build is required ( ie: build.pl modified )
-
 
2743
#
-
 
2744
#
-
 
2745
# Inputs          : None
-
 
2746
#
-
 
2747
# Returns         : May not return
-
 
2748
#
-
 
2749
sub TestForForcedBuild
-
 
2750
{
-
 
2751
    #
-
 
2752
    #   Always return if in clobber mode
-
 
2753
    #
-
 
2754
    return if ( $Clobber );
-
 
2755
 
-
 
2756
    if ( ! $ForceBuild  )
-
 
2757
    {
-
 
2758
        my @build_warn;
-
 
2759
        my $bstamp = -M "$Cwd/$ScmBuildSrc";
-
 
2760
        my $tstamp = -M "$Cwd/Makefile.gbe";
-
 
2761
 
-
 
2762
        push @build_warn, "Missing: Makefile.gbe" unless ( defined $tstamp );
-
 
2763
        push @build_warn, "Modified build file ($ScmBuildSrc)" if ( $tstamp && $bstamp < $tstamp );
-
 
2764
 
-
 
2765
        if ( @build_warn )
-
 
2766
        {
-
 
2767
            Verbose ("Forcing Build", @build_warn );
-
 
2768
        }
-
 
2769
        else
-
 
2770
        {
-
 
2771
            Verbose ("No build performed. Build files up to date");
-
 
2772
            Log ("Build files up to date") if $::GBE_SANDBOX;
-
 
2773
            exit 0;
-
 
2774
        }
-
 
2775
    }
-
 
2776
}
-
 
2777
 
-
 
2778
#-------------------------------------------------------------------------------
2747
# Function        : LastBuildDirective
2779
# Function        : LastBuildDirective
2748
#
2780
#
2749
# Description     : No more build directives allowed
2781
# Description     : No more build directives allowed
2750
#
2782
#
2751
# Inputs          : 
2783
# Inputs          : 
Line 2989... Line 3021...
2989
        {
3021
        {
2990
            next if ( $dir eq '.' );
3022
            next if ( $dir eq '.' );
2991
            next if ( $dir eq '..' );
3023
            next if ( $dir eq '..' );
2992
            if ( -d $dir )
3024
            if ( -d $dir )
2993
            {
3025
            {
2994
                System( "$::GBE_BIN/chmod -fR +w $dir" );
-
 
2995
                System( "$::GBE_BIN/rm -rf $dir" );
3026
                rmtree ( $dir );
2996
            }
3027
            }
2997
        }
3028
        }
2998
 
3029
 
2999
        foreach my $file ( @CLOBBERFILES )
3030
        foreach my $file ( @CLOBBERFILES )
3000
        {
3031
        {
3001
            if ( -f $file )
3032
            if ( -f $file )
3002
            {
3033
            {
3003
                System( "$::GBE_BIN/chmod -fR +w $file" );
-
 
3004
                System( "$::GBE_BIN/rm -f $file" );
3034
                rmtree ( $file );
3005
            }
3035
            }
3006
        }
3036
        }
3007
        
3037
        
3008
        #
3038
        #
3009
        #   DPACKAGE may be a user file, Only delete it if we created it
3039
        #   DPACKAGE may be a user file, Only delete it if we created it
Line 3273... Line 3303...
3273
sub BuildIncpkg
3303
sub BuildIncpkg
3274
{
3304
{
3275
    StartBuildPhase();                          # Starting the build phase. No more data collection
3305
    StartBuildPhase();                          # Starting the build phase. No more data collection
3276
    if ( $Clobber )                             # clobber mode ?
3306
    if ( $Clobber )                             # clobber mode ?
3277
    {
3307
    {
3278
        System( "$::GBE_BIN/rm -f $Srcdir/incpkg" );
3308
        rmtree( "$Srcdir/incpkg" );
3279
        return;
3309
        return;
3280
    }
3310
    }
3281
 
3311
 
3282
    my $fh = ConfigurationFile::New( "$Srcdir/incpkg" );
3312
    my $fh = ConfigurationFile::New( "$Srcdir/incpkg" );
3283
    $fh->Header( "buildlib (Version $BuildVersion)",
3313
    $fh->Header( "buildlib (Version $BuildVersion)",