deprecated/buildtools/buildsystemtools/GenBuild.pm
author lorewang
Thu, 11 Nov 2010 11:26:32 +0800
changeset 677 44e49837144a
parent 655 3f65fd25dfd4
permissions -rw-r--r--
update release info
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
655
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     1
# Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     2
# All rights reserved.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     3
# This component and the accompanying materials are made available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     4
# under the terms of "Eclipse Public License v1.0"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     5
# which accompanies this distribution, and is available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     7
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     8
# Initial Contributors:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     9
# Nokia Corporation - initial contribution.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    10
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    11
# Contributors:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    12
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    13
# Description:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    14
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    15
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    16
package GenBuild;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    17
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    18
use strict;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    19
use Carp;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    20
use IO::File;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    21
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    22
# Global Variables
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    23
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    24
my @components;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    25
my $iIDCount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    26
my $iStageCount;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    27
my %arm_assplist;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    28
my $savespace="";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    29
my $keepgoing="";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    30
my $build_tools=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    31
my $build_cwtools=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    32
my $build_winc=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    33
my $build_thumb=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    34
my $build_armi=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    35
my $build_arm4=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    36
my $build_arm4t=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    37
my $build_armv5=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    38
my $build_arm3=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    39
my $epoc_only=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    40
my $build_winscw=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    41
my $build_wins=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    42
my $build_bootstrap;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    43
my $basename;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    44
my $iSourceDir;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    45
my $build_UREL=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    46
my $build_UDEB=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    47
my $build_urel_udeb="";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    48
my $build_test=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    49
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    50
my ($XMLFileH, $gLogFileH);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    51
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    52
my ($gHiResTimer) = 0; #Flag - true (1) if HiRes Timer module available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    53
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    54
# Check if HiRes Timer is available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    55
if (eval "require Time::HiRes;") {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    56
  $gHiResTimer = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    57
} else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    58
  print "Cannot load HiResTimer Module\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    59
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    60
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    61
sub Start
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    62
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    63
  my ($iDataSource, $iDataOutput, $iLogFile, $iSourceDir, $iReallyClean, $iClean) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    64
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    65
  # Copied from genbuild.pl
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    66
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    67
  # Check for EPOCROOT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    68
  # It's not used directly by GENBUILD, but this is a good early stage at which
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    69
  # to discover that it hasn't been set...
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    70
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    71
  my $epocroot = $ENV{EPOCROOT};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    72
  die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    73
  $epocroot =~ s-/-\\-go;	# for those working with UNIX shells
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    74
  die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    75
  die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    76
  die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    77
  die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    78
  die "ERROR: EPOCROOT must specify an existing directory\n" if (!-d $epocroot);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    79
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    80
  # $iSourceDir must en in a \
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    81
  # Add a \ if not present
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    82
  if ($iSourceDir !~ /\\$/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    83
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    84
    $iSourceDir .= "\\";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    85
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    86
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    87
  for(my $j = 0; $j < scalar(@$iDataSource); $j++)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    88
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    89
    $GenBuild::basename .= " " if ($j > 0);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    90
    my ($iFile) = @$iDataSource[$j] =~ m#.*([\\\/]|^)(.*?)\..*$#;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    91
    $GenBuild::basename .= @$iDataSource[$j];
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    92
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    93
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    94
  #Set the global iSourceDir
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    95
  $GenBuild::iSourceDir = $iSourceDir;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    96
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    97
  # Open Log file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    98
  $GenBuild::gLogFileH = IO::File->new("> $iLogFile")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    99
    or croak "Couldn't open $iLogFile for writing: $!\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   100
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   101
  print $GenBuild::gLogFileH "===-------------------------------------------------\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   102
  print $GenBuild::gLogFileH "=== Genxml\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   103
  print $GenBuild::gLogFileH "===-------------------------------------------------\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   104
  print $GenBuild::gLogFileH "=== Genxml started ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   105
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   106
  for(my $j = 0; $j < scalar(@$iDataSource); $j++)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   107
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   108
    # Open DataSource
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   109
    my ($iFile) = @$iDataSource[$j];
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   110
    open FILE, "< $iFile" or die "Can't read $iFile\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   111
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   112
    print $GenBuild::gLogFileH "=== Genxml == $iFile\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   113
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   114
    print $GenBuild::gLogFileH "-- Genxml\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   115
    # Add the per command start timestamp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   116
    print $GenBuild::gLogFileH "++ Started at ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   117
    # Add the per command start HiRes timestamp if available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   118
    if ($gHiResTimer == 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   119
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   120
      print $GenBuild::gLogFileH "+++ HiRes Start ".Time::HiRes::time()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   121
    } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   122
      # Add the HiRes timer missing statement
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   123
      print $GenBuild::gLogFileH "+++ HiRes Time Unavailable\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   124
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   125
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   126
    # Process the Txt file in the same manner as the old genbuild
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   127
    # Note:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   128
    # Additional options 'udeb', 'urel' and 'test' were added in response 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   129
    # to a specific request, but are not otherwise supported by Symbian.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   130
    while (<FILE>)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   131
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   132
    s/\s*#.*$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   133
    s/^\s*//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   134
    my $line = lc $_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   135
    if ($line =~ /^$/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   136
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   137
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   138
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   139
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   140
    if ($line =~ /<option (\w+)\s*(.*)>/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   141
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   142
      my $option = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   143
      my $optargs= $2;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   144
      if ($option =~ "savespace")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   145
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   146
        $GenBuild::savespace = "-savespace";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   147
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   148
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   149
      if ($option =~ "keepgoing")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   150
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   151
        $GenBuild::keepgoing = "-keepgoing";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   152
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   153
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   154
      if ($option =~ "tools")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   155
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   156
        $GenBuild::build_tools = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   157
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   158
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   159
      if ($option eq "cwtools")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   160
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   161
        $GenBuild::build_cwtools = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   162
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   163
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   164
      if ($option =~ "winc")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   165
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   166
        $GenBuild::build_winc = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   167
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   168
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   169
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   170
      # Do not build winc, wins or winscw
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   171
      if ($option =~ "epoconly")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   172
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   173
        $GenBuild::build_winc = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   174
        $GenBuild::epoc_only = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   175
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   176
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   177
      if ($option =~ "thumb")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   178
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   179
        $GenBuild::build_thumb = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   180
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   181
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   182
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   183
      # ARMI option
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   184
      if ($option =~ "armi")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   185
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   186
        $GenBuild::build_armi = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   187
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   188
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   189
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   190
      # ARM4
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   191
      if ($option eq "arm4")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   192
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   193
        $GenBuild::build_arm4 = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   194
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   195
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   196
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   197
      # ARM4T
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   198
      if ($option eq "arm4t")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   199
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   200
        $GenBuild::build_arm4t = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   201
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   202
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   203
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   204
      # ARMv5
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   205
      if ($option =~ "armv5")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   206
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   207
        $GenBuild::build_armv5 = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   208
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   209
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   210
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   211
      if ($option =~ "arm3")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   212
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   213
        $GenBuild::build_arm3 = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   214
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   215
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   216
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   217
      # Use Visual Studio
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   218
      if ($option eq "wins")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   219
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   220
        $GenBuild::build_wins = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   221
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   222
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   223
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   224
      # Use CodeWarrior
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   225
      if ($option eq "winscw")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   226
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   227
        $GenBuild::build_winscw = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   228
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   229
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   230
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   231
      if ($option eq "udeb") 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   232
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   233
        $GenBuild::build_UDEB = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   234
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   235
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   236
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   237
      if ($option eq "urel") 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   238
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   239
        $GenBuild::build_UREL = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   240
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   241
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   242
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   243
      if ($option eq "test") 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   244
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   245
        $GenBuild::build_test = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   246
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   247
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   248
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   249
      if ($option =~ "arm_assp")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   250
        {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   251
        $GenBuild::arm_assplist{$optargs} = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   252
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   253
        }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   254
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   255
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   256
      print "Option $1 not yet implemented\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   257
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   258
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   259
    if ($line =~ /^([^<]\S+)\s+(\S+)/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   260
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   261
      if (!-e "$GenBuild::iSourceDir$2\\bld.inf")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   262
      {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   263
        print $GenBuild::gLogFileH "MISSING COMPONENT $1: can't find $GenBuild::iSourceDir$2\\bld.inf\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   264
        next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   265
      }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   266
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   267
    if ($line =~ /<special bldfiles e32toolp group>/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   268
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   269
      # Handle Special
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   270
      $GenBuild::build_bootstrap = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   271
      next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   272
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   273
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   274
    push @GenBuild::components, $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   275
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   276
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   277
    close(FILE);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   278
    # Add the per command end HiRes timestamp if available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   279
    print $GenBuild::gLogFileH "+++ HiRes End ".Time::HiRes::time()."\n" if ($gHiResTimer == 1);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   280
    # Add the per command end timestamp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   281
    print $GenBuild::gLogFileH "++ Finished at ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   282
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   283
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   284
  print $GenBuild::gLogFileH "=== Genxml == Output\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   285
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   286
  print $GenBuild::gLogFileH "-- Genxml\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   287
  # Add the per command start timestamp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   288
  print $GenBuild::gLogFileH "++ Started at ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   289
  # Add the per command start HiRes timestamp if available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   290
  if ($gHiResTimer == 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   291
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   292
    print $GenBuild::gLogFileH "+++ HiRes Start ".Time::HiRes::time()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   293
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   294
    # Add the HiRes timer missing statement
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   295
    print $GenBuild::gLogFileH "+++ HiRes Missing\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   296
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   297
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   298
  &PBuildLevels($iDataOutput);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   299
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   300
  # Generate additional ReallyClean and Clean XML files if required
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   301
  &GenReallyClean($iReallyClean) if (defined $iReallyClean);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   302
  &GenClean($iClean) if (defined $iClean);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   303
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   304
  # Close file handles
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   305
  close($GenBuild::gLogFileH);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   306
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   307
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   308
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   309
# PBuildLevels
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   310
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   311
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   312
# $iDataOutput - Filename for normal build xml
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   313
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   314
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   315
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   316
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   317
# This function generates a xml file to run normal buildon all components
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   318
sub PBuildLevels
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   319
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   320
  my ($iDataOutput) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   321
  # Print the XML file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   322
  $GenBuild::XMLFileH = IO::File->new("> $iDataOutput")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   323
    or croak "Couldn't open $iDataOutput for writing: $!\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   324
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   325
  $GenBuild::iIDCount = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   326
  $GenBuild::iStageCount = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   327
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   328
  my ($epocroot) = $ENV{'EPOCROOT'};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   329
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   330
  &PrintXMLHeader($GenBuild::XMLFileH);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   331
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   332
  if (($GenBuild::build_UREL) && (!$GenBuild::build_UDEB)) 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   333
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   334
	$GenBuild::build_urel_udeb = " UREL";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   335
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   336
  elsif ((!$GenBuild::build_UREL) && ($GenBuild::build_UDEB)) 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   337
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   338
	$GenBuild::build_urel_udeb = " UDEB";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   339
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   340
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   341
  if ($GenBuild::build_bootstrap)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   342
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   343
    # Do the BootStrapping
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   344
    # Temporary workaround for non-common code between old setup and Beech
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   345
    # Defaults to old setup
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   346
    # This will be removed when final functionality is added
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   347
    if ($ENV{'Platform'} eq 'beech')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   348
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   349
      print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{beech\\generic\\tools\\e32toolp\\group" CommandLine="setupprj.bat"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   350
    } elsif ($ENV{'Platform'} eq 'cedar') {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   351
      print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{os\\buildtools\\sbsv1_os\\e32toolp\\group" CommandLine="setupprj.bat"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   352
    } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   353
      print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{tools\\e32toolp\\group" CommandLine="setupprj.bat"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   354
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   355
    $GenBuild::iIDCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   356
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   357
    # Temporary workaround for non-common code between old setup and Beech
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   358
    # Defaults to old setup
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   359
    # This will be removed when final functionality is added
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   360
    if ($ENV{'Platform'} eq 'beech')
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   361
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   362
      print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{beech\\generic\\tools\\e32toolp\\group" CommandLine="bld.bat rel"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   363
    } elsif  ($ENV{'Platform'} eq 'cedar') {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   364
      print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{os\\buildtools\\sbsv1_os\\e32toolp\\group" CommandLine="bld.bat rel"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   365
    } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   366
      print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="BootStrap" Cwd="$GenBuild::iSourceDir}.qq{tools\\e32toolp\\group" CommandLine="bld.bat rel"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   367
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   368
    $GenBuild::iIDCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   369
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   370
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   371
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   372
  &BuildLevels("0", "bldmake bldfiles $GenBuild::keepgoing");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   373
  $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   374
  &BuildLevels("0", "abld export $GenBuild::keepgoing");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   375
  &BuildLevels("0", "abld test export $GenBuild::keepgoing") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   376
  $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   377
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   378
  if ($GenBuild::build_tools)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   379
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   380
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "tools");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   381
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   382
    &BuildLevels("1", "abld library $GenBuild::keepgoing", "tools");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   383
    &BuildLevels("1", "abld target $GenBuild::keepgoing $GenBuild::savespace", "tools", "rel");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   384
    &BuildLevels("0", "abld -what build", "tools", "rel");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   385
    &BuildLevels("0", "abld -check build", "tools", "rel");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   386
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   387
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   388
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   389
  if ($GenBuild::build_cwtools)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   390
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   391
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "cwtools");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   392
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   393
    &BuildLevels("1", "abld library $GenBuild::keepgoing", "cwtools");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   394
    &BuildLevels("1", "abld target $GenBuild::keepgoing $GenBuild::savespace", "cwtools", "rel");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   395
    &BuildLevels("0", "abld -what build", "cwtools", "rel");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   396
    &BuildLevels("0", "abld -check build", "cwtools", "rel");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   397
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   398
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   399
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   400
  if ($GenBuild::build_winc)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   401
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   402
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "winc");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   403
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   404
    &BuildLevels("1", "abld library $GenBuild::keepgoing", "winc");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   405
    &BuildLevels("1", "abld target $GenBuild::keepgoing $GenBuild::savespace", "winc");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   406
    &BuildLevels("0", "abld -what build", "winc");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   407
    &BuildLevels("0", "abld -check build", "winc");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   408
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   409
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   410
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   411
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   412
  unless ($epoc_only)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   413
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   414
    # Emulator things, WINS, up to resources
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   415
    if ($GenBuild::build_wins)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   416
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   417
      &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "wins");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   418
	  &BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "wins") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   419
      $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   420
      &BuildLevels("1", "abld resource $GenBuild::keepgoing", "wins$GenBuild::build_urel_udeb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   421
	  &BuildLevels("1", "abld test resource $GenBuild::keepgoing", "wins$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   422
      &BuildLevels("1", "abld library $GenBuild::keepgoing", "wins");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   423
	  &BuildLevels("1", "abld test library $GenBuild::keepgoing", "wins") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   424
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   425
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   426
    # Emulator things, WINSCW, up to resources
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   427
    if ($GenBuild::build_winscw)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   428
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   429
      &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "winscw");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   430
	  &BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "winscw") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   431
      $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   432
      &BuildLevels("1", "abld resource $GenBuild::keepgoing", "winscw$GenBuild::build_urel_udeb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   433
	  &BuildLevels("1", "abld test resource $GenBuild::keepgoing", "winscw$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   434
      &BuildLevels("1", "abld library $GenBuild::keepgoing", "winscw");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   435
	  &BuildLevels("1", "abld test library $GenBuild::keepgoing", "winscw") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   436
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   437
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   438
  # Arm Stuff
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   439
  if ($GenBuild::build_arm4)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   440
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   441
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "arm4");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   442
	&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "arm4") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   443
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   444
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   445
  if ($GenBuild::build_arm4t)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   446
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   447
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "arm4t");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   448
	&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "arm4t") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   449
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   450
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   451
  if ($GenBuild::build_armv5)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   452
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   453
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "armv5");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   454
	&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "arm5") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   455
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   456
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   457
  if ($GenBuild::build_armi)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   458
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   459
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "armi");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   460
	&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "armi") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   461
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   462
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   463
  if ($GenBuild::build_thumb)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   464
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   465
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "thumb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   466
	&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "thumb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   467
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   468
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   469
  if ($GenBuild::build_arm3)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   470
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   471
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", "arm3");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   472
	&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", "arm3") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   473
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   474
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   475
  foreach my $iAssp (sort keys %GenBuild::arm_assplist)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   476
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   477
    &BuildLevels("0", "abld makefile $GenBuild::keepgoing $GenBuild::savespace", $iAssp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   478
	&BuildLevels("0", "abld test makefile $GenBuild::keepgoing $GenBuild::savespace", $iAssp) if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   479
    $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   480
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   481
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   482
  &BuildLevels("1", "abld resource $GenBuild::keepgoing", "arm4$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   483
  &BuildLevels("1", "abld test resource $GenBuild::keepgoing", "arm4$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   484
  &BuildLevels("1", "abld resource $GenBuild::keepgoing", "arm4t$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4t);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   485
  &BuildLevels("1", "abld test resource $GenBuild::keepgoing", "arm4t$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   486
  &BuildLevels("1", "abld resource $GenBuild::keepgoing", "armv5$GenBuild::build_urel_udeb") if ($GenBuild::build_armv5);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   487
  &BuildLevels("1", "abld test resource $GenBuild::keepgoing", "armv5$GenBuild::build_urel_udeb") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   488
  &BuildLevels("1", "abld resource $GenBuild::keepgoing", "armi$GenBuild::build_urel_udeb") if ($GenBuild::build_armi);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   489
  &BuildLevels("1", "abld test resource $GenBuild::keepgoing", "armi$GenBuild::build_urel_udeb") if (($GenBuild::build_armi) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   490
  &BuildLevels("1", "abld resource $GenBuild::keepgoing", "thumb$GenBuild::build_urel_udeb") if ($GenBuild::build_thumb);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   491
  &BuildLevels("1", "abld test resource $GenBuild::keepgoing", "thumb$GenBuild::build_urel_udeb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   492
  &BuildLevels("1", "abld resource $GenBuild::keepgoing", "arm3$GenBuild::build_urel_udeb") if ($GenBuild::build_arm3);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   493
  &BuildLevels("1", "abld test resource $GenBuild::keepgoing", "arm3$GenBuild::build_urel_udeb") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   494
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   495
  foreach my $iAssp (sort keys %GenBuild::arm_assplist)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   496
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   497
    &BuildLevels("1", "abld resource $GenBuild::keepgoing", "$iAssp$GenBuild::build_urel_udeb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   498
	&BuildLevels("1", "abld test resource $GenBuild::keepgoing", "$iAssp$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   499
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   500
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   501
  &BuildLevels("1", "abld library $GenBuild::keepgoing", "arm4") if ($GenBuild::build_arm4);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   502
  &BuildLevels("1", "abld test library $GenBuild::keepgoing", "arm4") if (($GenBuild::build_arm4) &&($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   503
  &BuildLevels("1", "abld library $GenBuild::keepgoing", "arm4t") if ($GenBuild::build_arm4t);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   504
  &BuildLevels("1", "abld test library $GenBuild::keepgoing", "arm4t") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   505
  &BuildLevels("1", "abld library $GenBuild::keepgoing", "armv5") if ($GenBuild::build_armv5);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   506
  &BuildLevels("1", "abld test library $GenBuild::keepgoing", "armv5") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   507
  &BuildLevels("1", "abld library $GenBuild::keepgoing", "armi") if ($GenBuild::build_armi);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   508
  &BuildLevels("1", "abld test library $GenBuild::keepgoing", "armi") if (($GenBuild::build_armi) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   509
  &BuildLevels("1", "abld library $GenBuild::keepgoing", "thumb") if ($GenBuild::build_thumb);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   510
  &BuildLevels("1", "abld test library $GenBuild::keepgoing", "thumb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   511
  &BuildLevels("1", "abld library $GenBuild::keepgoing", "arm3") if ($GenBuild::build_arm3);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   512
  &BuildLevels("1", "abld test library $GenBuild::keepgoing", "arm3") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   513
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   514
  foreach my $iAssp (sort keys %GenBuild::arm_assplist)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   515
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   516
    &BuildLevels("1", "abld library $GenBuild::keepgoing", $iAssp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   517
	&BuildLevels("1", "abld test library $GenBuild::keepgoing", $iAssp) if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   518
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   519
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   520
  # Build all targets
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   521
  my @iTargets;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   522
  # Push the defaults on
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   523
  push @iTargets, "wins$GenBuild::build_urel_udeb" if (($GenBuild::build_wins) && (!$GenBuild::epoc_only));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   524
  push @iTargets, "arm4$GenBuild::build_urel_udeb" if ($GenBuild::build_arm4);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   525
  push @iTargets, "arm4t$GenBuild::build_urel_udeb" if ($GenBuild::build_arm4t);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   526
  push @iTargets, "armv5$GenBuild::build_urel_udeb"  if ($GenBuild::build_armv5);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   527
  push @iTargets, "armi$GenBuild::build_urel_udeb" if ($GenBuild::build_armi);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   528
  push @iTargets, "winscw$GenBuild::build_urel_udeb" if (($GenBuild::build_winscw) && (!$GenBuild::epoc_only));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   529
  push @iTargets, "thumb$GenBuild::build_urel_udeb" if ($GenBuild::build_thumb);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   530
  push @iTargets, "arm3$GenBuild::build_urel_udeb" if ($GenBuild::build_arm3);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   531
  foreach my $iAssp (sort keys %GenBuild::arm_assplist)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   532
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   533
    push @iTargets, "$iAssp$GenBuild::build_urel_udeb";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   534
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   535
  &BuildTargets("0", "abld target $GenBuild::keepgoing $GenBuild::savespace", @iTargets);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   536
  &BuildTargets("0", "abld test target $GenBuild::keepgoing $GenBuild::savespace", @iTargets) if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   537
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   538
  unless ($epoc_only)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   539
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   540
    if ($GenBuild::build_wins)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   541
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   542
      # Final Part of WINS
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   543
      &BuildLevels("1", "abld final $GenBuild::keepgoing", "wins","$GenBuild::build_urel_udeb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   544
	  &BuildLevels("1", "abld test final $GenBuild::keepgoing", "wins","$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   545
      &BuildLevels("0", "abld -what build", "wins","$GenBuild::build_urel_udeb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   546
	  &BuildLevels("0", "abld test -what build", "wins","$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   547
      $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   548
      &BuildLevels("0", "abld -check build", "wins","$GenBuild::build_urel_udeb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   549
	  &BuildLevels("0", "abld test -check build", "wins","$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   550
      $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   551
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   552
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   553
    if ($GenBuild::build_winscw)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   554
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   555
      # Final Part of WINSCW
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   556
      &BuildLevels("1", "abld final $GenBuild::keepgoing", "winscw$GenBuild::build_urel_udeb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   557
	  &BuildLevels("1", "abld test final $GenBuild::keepgoing", "winscw$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   558
      &BuildLevels("0", "abld -what build", "winscw$GenBuild::build_urel_udeb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   559
	  &BuildLevels("0", "abld test -what build", "winscw$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   560
      $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   561
      &BuildLevels("0", "abld -check build", "winscw$GenBuild::build_urel_udeb");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   562
	  &BuildLevels("0", "abld test -check build", "winscw$GenBuild::build_urel_udeb") if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   563
      $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   564
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   565
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   566
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   567
  # Other Final Parts
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   568
  &BuildLevels("1", "abld final $GenBuild::keepgoing", "arm4$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   569
  &BuildLevels("1", "abld test final $GenBuild::keepgoing", "arm4$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   570
  &BuildLevels("1", "abld final $GenBuild::keepgoing", "arm4t$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4t);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   571
  &BuildLevels("1", "abld test final $GenBuild::keepgoing", "arm4t$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   572
  &BuildLevels("1", "abld final $GenBuild::keepgoing", "armv5$GenBuild::build_urel_udeb") if ($GenBuild::build_armv5);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   573
  &BuildLevels("1", "abld test final $GenBuild::keepgoing", "armv5$GenBuild::build_urel_udeb") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   574
  &BuildLevels("1", "abld final $GenBuild::keepgoing", "armi$GenBuild::build_urel_udeb") if ($GenBuild::build_armi);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   575
  &BuildLevels("1", "abld test final $GenBuild::keepgoing", "armi$GenBuild::build_urel_udeb") if (($GenBuild::build_armi) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   576
  &BuildLevels("1", "abld final $GenBuild::keepgoing", "thumb$GenBuild::build_urel_udeb") if ($GenBuild::build_thumb);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   577
  &BuildLevels("1", "abld test final $GenBuild::keepgoing", "thumb$GenBuild::build_urel_udeb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   578
  &BuildLevels("1", "abld final $GenBuild::keepgoing", "arm3$GenBuild::build_urel_udeb") if ($GenBuild::build_arm3);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   579
  &BuildLevels("1", "abld test final $GenBuild::keepgoing", "arm3$GenBuild::build_urel_udeb") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   580
  foreach my $iAssp (sort keys %GenBuild::arm_assplist)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   581
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   582
    &BuildLevels("1", "abld final $GenBuild::keepgoing", $iAssp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   583
	&BuildLevels("1", "abld test final $GenBuild::keepgoing", $iAssp) if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   584
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   585
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   586
  &BuildLevels("0", "abld -what build", "arm4$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   587
  &BuildLevels("0", "abld test -what build", "arm4$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   588
  &BuildLevels("0", "abld -what build", "arm4t$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4t);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   589
  &BuildLevels("0", "abld test -what build", "arm4t$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   590
  &BuildLevels("0", "abld -what build", "armv5$GenBuild::build_urel_udeb") if ($GenBuild::build_armv5);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   591
  &BuildLevels("0", "abld test -what build", "armv5$GenBuild::build_urel_udeb") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   592
  &BuildLevels("0", "abld -what build", "armi$GenBuild::build_urel_udeb") if ($GenBuild::build_armi);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   593
  &BuildLevels("0", "abld test -what build", "armi$GenBuild::build_urel_udeb") if (($GenBuild::build_armi) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   594
  &BuildLevels("0", "abld -what build", "thumb$GenBuild::build_urel_udeb") if ($GenBuild::build_thumb);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   595
  &BuildLevels("0", "abld test -what build", "thumb$GenBuild::build_urel_udeb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   596
  &BuildLevels("0", "abld -what build", "arm3$GenBuild::build_urel_udeb") if ($GenBuild::build_arm3);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   597
  &BuildLevels("0", "abld test -what build", "arm3$GenBuild::build_urel_udeb") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   598
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   599
  foreach my $iAssp (sort keys %GenBuild::arm_assplist)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   600
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   601
    &BuildLevels("0", "abld -what build", $iAssp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   602
	&BuildLevels("0", "abld test -what build", $iAssp) if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   603
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   604
  $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   605
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   606
  &BuildLevels("0", "abld -check build", "arm4$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   607
  &BuildLevels("0", "abld test -check build", "arm4$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   608
  &BuildLevels("0", "abld -check build", "arm4t$GenBuild::build_urel_udeb") if ($GenBuild::build_arm4t);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   609
  &BuildLevels("0", "abld test -check build", "arm4t$GenBuild::build_urel_udeb") if (($GenBuild::build_arm4t) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   610
  &BuildLevels("0", "abld -check build", "armv5$GenBuild::build_urel_udeb") if ($GenBuild::build_armv5);  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   611
  &BuildLevels("0", "abld test -check build", "armv5$GenBuild::build_urel_udeb") if (($GenBuild::build_armv5) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   612
  &BuildLevels("0", "abld -check build", "armi$GenBuild::build_urel_udeb") if ($GenBuild::build_armi);  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   613
  &BuildLevels("0", "abld test -check build", "armi$GenBuild::build_urel_udeb") if (($GenBuild::build_armi) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   614
  &BuildLevels("0", "abld -check build", "thumb$GenBuild::build_urel_udeb") if ($GenBuild::build_thumb);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   615
  &BuildLevels("0", "abld test -check build", "thumb$GenBuild::build_urel_udeb") if (($GenBuild::build_thumb) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   616
  &BuildLevels("0", "abld -check build", "arm3$GenBuild::build_urel_udeb") if ($GenBuild::build_arm3);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   617
  &BuildLevels("0", "abld test -check build", "arm3$GenBuild::build_urel_udeb") if (($GenBuild::build_arm3) && ($GenBuild::build_test));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   618
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   619
  foreach my $iAssp (sort keys %GenBuild::arm_assplist)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   620
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   621
    &BuildLevels("0", "abld -check build", $iAssp);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   622
	&BuildLevels("0", "abld test -check build", $iAssp) if ($GenBuild::build_test);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   623
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   624
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   625
  # Print the XML Footer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   626
  print $GenBuild::XMLFileH qq{\t</Commands>\n</Product>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   627
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   628
  # Add the per command end HiRes timestamp if available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   629
  print $GenBuild::gLogFileH "+++ HiRes End ".Time::HiRes::time()."\n" if ($gHiResTimer == 1);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   630
  # Add the per command end timestamp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   631
  print $GenBuild::gLogFileH "++ Finished at ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   632
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   633
  # Print Genxml log footer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   634
  print $GenBuild::gLogFileH "=== Genxml finished ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   635
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   636
  # Close XML File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   637
  close($GenBuild::XMLFileH);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   638
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   639
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   640
sub BuildLevels
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   641
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   642
  my ($iIncStage, $action, $arg1, $arg2, $arg3) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   643
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   644
  for(my $j = 0; $j < scalar(@GenBuild::components); $j++)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   645
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   646
    my $line = $GenBuild::components[$j];
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   647
    my @MyList;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   648
    my $tempvar;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   649
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   650
    @MyList = split(/\s+/,$line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   651
    $tempvar= lc $MyList[$#MyList];
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   652
    $tempvar =~ s/\\group//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   653
    push @MyList, $tempvar;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   654
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   655
    print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="$MyList[2]" Cwd="$GenBuild::iSourceDir$MyList[1]" CommandLine="$action $arg1 $arg2 $arg3"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   656
    $GenBuild::iIDCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   657
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   658
    if ( $iIncStage )
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   659
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   660
      $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   661
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   662
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   663
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   664
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   665
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   666
sub BuildTargets
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   667
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   668
  my ($iIncStage, $action, @iTargets) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   669
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   670
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   671
  for(my $j = 0; $j < scalar(@GenBuild::components); $j++)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   672
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   673
    my $line = $GenBuild::components[$j];
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   674
    my @MyList;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   675
    my $tempvar;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   676
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   677
    @MyList = split(/\s+/,$line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   678
    $tempvar= lc $MyList[$#MyList];
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   679
    $tempvar =~ s/\\group//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   680
    push @MyList, $tempvar;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   681
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   682
    # Process target list
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   683
    foreach my $iTarget (@iTargets)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   684
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   685
      print $GenBuild::XMLFileH qq{\t\t<Execute ID="$GenBuild::iIDCount" Stage="$GenBuild::iStageCount" Component="$MyList[2]" Cwd="$GenBuild::iSourceDir$MyList[1]" CommandLine="$action $iTarget"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   686
      $GenBuild::iIDCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   687
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   688
    if ( $iIncStage )
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   689
    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   690
      $GenBuild::iStageCount++;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   691
    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   692
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   693
  $GenBuild::iStageCount++ if (!$iIncStage);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   694
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   695
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   696
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   697
# GenReallyClean
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   698
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   699
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   700
# $iReallyClean - Filename for reallyclean xml
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   701
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   702
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   703
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   704
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   705
# This function generates a xml file to run abld reallyclean on all components
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   706
sub GenReallyClean
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   707
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   708
  my ($iReallyClean) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   709
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   710
  # Reset ID and Stage Counf for New XML File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   711
  $GenBuild::iIDCount = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   712
  $GenBuild::iStageCount = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   713
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   714
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   715
  # Add the section header
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   716
  print $GenBuild::gLogFileH "=== Genxml == ReallyClean\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   717
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   718
  print $GenBuild::gLogFileH "-- Genxml\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   719
  # Add the per command start timestamp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   720
  print $GenBuild::gLogFileH "++ Started at ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   721
  # Add the per command start HiRes timestamp if available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   722
  if ($gHiResTimer == 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   723
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   724
    print $GenBuild::gLogFileH "+++ HiRes Start ".Time::HiRes::time()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   725
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   726
    # Add the HiRes timer missing statement
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   727
    print $GenBuild::gLogFileH "+++ HiRes Missing\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   728
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   729
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   730
  # Open XML file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   731
  $GenBuild::XMLFileH = IO::File->new("> $iReallyClean")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   732
    or croak "Couldn't open $iReallyClean for writing: $!\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   733
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   734
  # Write Header
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   735
  &PrintXMLHeader($GenBuild::XMLFileH);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   736
  # Generate XML file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   737
  &BuildLevels("0", "abld reallyclean");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   738
  # Write Footer and Close XML File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   739
  print $GenBuild::XMLFileH qq{\t</Commands>\n</Product>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   740
  close($GenBuild::XMLFileH);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   741
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   742
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   743
  # Add the per command end HiRes timestamp if available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   744
  print $GenBuild::gLogFileH "+++ HiRes End ".Time::HiRes::time()."\n" if ($gHiResTimer == 1);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   745
  # Add the per command end timestamp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   746
  print $GenBuild::gLogFileH "++ Finished at ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   747
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   748
  # Print Genxml log footer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   749
  print $GenBuild::gLogFileH "=== Genxml finished ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   750
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   751
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   752
# GenClean
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   753
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   754
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   755
# $iClean - Filename for reallyclean xml
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   756
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   757
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   758
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   759
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   760
# This function generates a xml file to run abld reallyclean on all components
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   761
sub GenClean
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   762
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   763
  my ($iClean) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   764
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   765
  # Reset ID and Stage Counf for New XML File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   766
  $GenBuild::iIDCount = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   767
  $GenBuild::iStageCount = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   768
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   769
  # Add the section header
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   770
  print $GenBuild::gLogFileH "=== Genxml == Clean\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   771
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   772
  print $GenBuild::gLogFileH "-- Genxml\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   773
  # Add the per command start timestamp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   774
  print $GenBuild::gLogFileH "++ Started at ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   775
  # Add the per command start HiRes timestamp if available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   776
  if ($gHiResTimer == 1)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   777
  {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   778
    print $GenBuild::gLogFileH "+++ HiRes Start ".Time::HiRes::time()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   779
  } else {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   780
    # Add the HiRes timer missing statement
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   781
    print $GenBuild::gLogFileH "+++ HiRes Missing\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   782
  }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   783
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   784
  # Open XML file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   785
  $GenBuild::XMLFileH = IO::File->new("> $iClean")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   786
    or croak "Couldn't open $iClean for writing: $!\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   787
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   788
  # Write Header
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   789
  &PrintXMLHeader($GenBuild::XMLFileH);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   790
  # Generate XML file
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   791
  &BuildLevels("0", "abld clean");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   792
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   793
  # Write Footer and Close XML File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   794
  print $GenBuild::XMLFileH qq{\t</Commands>\n</Product>};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   795
  close($GenBuild::XMLFileH);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   796
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   797
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   798
  # Add the per command end HiRes timestamp if available
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   799
  print $GenBuild::gLogFileH "+++ HiRes End ".Time::HiRes::time()."\n" if ($gHiResTimer == 1);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   800
  # Add the per command end timestamp
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   801
  print $GenBuild::gLogFileH "++ Finished at ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   802
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   803
  # Print Genxml log footer
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   804
  print $GenBuild::gLogFileH "=== Genxml finished ".localtime()."\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   805
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   806
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   807
# PrintXMLHeader
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   808
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   809
# Inputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   810
# $iFileHandle
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   811
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   812
# Outputs
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   813
#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   814
# Description
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   815
# This function print the common start of the XML File
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   816
sub PrintXMLHeader
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   817
{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   818
  my ($iFileHandle) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   819
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   820
  my ($epocroot) = $ENV{'EPOCROOT'};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   821
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   822
  # Print the XML Header
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   823
  print $iFileHandle qq{<?xml version="1.0"?>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   824
  print $iFileHandle <<DTD_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   825
<!DOCTYPE Build  [
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   826
  <!ELEMENT Product (Commands)>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   827
  <!ATTLIST Product name CDATA #REQUIRED>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   828
  <!ELEMENT Commands (Execute+ | SetEnv*)>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   829
  <!ELEMENT Execute EMPTY>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   830
  <!ATTLIST Execute ID CDATA #REQUIRED>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   831
  <!ATTLIST Execute Stage CDATA #REQUIRED>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   832
  <!ATTLIST Execute Component CDATA #REQUIRED>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   833
  <!ATTLIST Execute Cwd CDATA #REQUIRED>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   834
  <!ATTLIST Execute CommandLine CDATA #REQUIRED>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   835
  <!ELEMENT SetEnv EMPTY>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   836
  <!ATTLIST SetEnv Order ID #REQUIRED>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   837
  <!ATTLIST SetEnv Name CDATA #REQUIRED>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   838
  <!ATTLIST SetEnv Value CDATA #REQUIRED>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   839
]>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   840
DTD_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   841
  print $iFileHandle qq{<Product Name="$GenBuild::basename">\n\t<Commands>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   842
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   843
  #Set EPOCROOT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   844
  print $iFileHandle qq{\t\t<SetEnv Order="1" Name="EPOCROOT" Value="$epocroot"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   845
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   846
  #Add Tools to the path using EPOCROOT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   847
  print $iFileHandle qq{\t\t<SetEnv Order="2" Name="PATH" Value="}.$epocroot.qq{epoc32\\gcc\\bin;}.$epocroot.qq{epoc32\\tools;%PATH%"/>\n};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   848
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   849
}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   850
1;