deprecated/buildtools/buildsystemtools/genbuild/genbuild.pl
author Bob Rosenberg <bob.rosenberg@nokia.com>
Mon, 18 Oct 2010 10:33:54 +0100
changeset 660 66ff3e731c60
parent 655 3f65fd25dfd4
permissions -rw-r--r--
Sysdeftools additional support for merging misordered system definitions. More extensive validation. Minor bug fixes. Bash wrappers for perl scripts for unix installs.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
655
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
     1
# Copyright (c) 1999-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
# Given a baseline list of components, generate scripts to do the build
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    15
# 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    16
#
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
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    20
if (@ARGV<1 || ! -e $ARGV[0])
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    21
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    22
#........1.........2.........3.........4.........5.........6.........7.....
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    23
	print <<USAGE_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    24
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    25
Usage:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    26
  genbuild complist1 [complist2 ...]   -- generate build scripts
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    27
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    28
Given a list of components, generate the scripts necessary to
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    29
build them all using the automated build system. The scripts 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    30
will be named after the component list, so
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    31
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    32
  genbuild \\batch\\build\\somename.txt
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    33
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    34
will generate the following scripts:
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    35
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    36
  somename_bldfiles.cmd    - run "bldmake bldfiles" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    37
  somename_export.cmd      - run "abld export" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    38
  somename_makefile.cmd    - run "abld makefile" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    39
  somename_library.cmd     - run "abld library" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    40
  somename_resource.cmd    - run "abld resource" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    41
  somename_target.cmd      - run "abld target" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    42
  somename_final.cmd       - run "abld final" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    43
  somename_check.cmd       - run "abld -check build" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    44
  somename_what.cmd        - run "abld -what build" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    45
  somename_clean.cmd       - run "abld clean" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    46
  somename_reallyclean.cmd - run "abld reallyclean" on every component
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    47
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    48
  somename_build.cmd       - use appropriate combination of above scripts
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    49
  somename_pbuild.cmd      - alternative build script for multi-machine builds
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    50
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    51
The somename_build.cmd script is controlled by options specified in the
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    52
list of components, and calls the other scripts in the correct sequence.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    53
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    54
USAGE_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    55
	exit 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    56
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    57
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    58
# Check for EPOCROOT
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    59
# 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
    60
# to discover that it hasn't been set...
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    61
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    62
my $epocroot = $ENV{EPOCROOT};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    63
die "ERROR: Must set the EPOCROOT environment variable\n" if (!defined($epocroot));
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    64
$epocroot =~ s-/-\\-go;	# for those working with UNIX shells
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    65
die "ERROR: EPOCROOT must not include a drive letter\n" if ($epocroot =~ /^.:/);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    66
die "ERROR: EPOCROOT must be an absolute path without a drive letter\n" if ($epocroot !~ /^\\/);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    67
die "ERROR: EPOCROOT must not be a UNC path\n" if ($epocroot =~ /^\\\\/);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    68
die "ERROR: EPOCROOT must end with a backslash\n" if ($epocroot !~ /\\$/);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    69
die "ERROR: EPOCROOT must specify an existing directory\n" if (!-d $epocroot);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    70
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    71
my $basename = $ARGV[0];
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    72
if ($basename =~ /^.*\\([^\\]+)$/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    73
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    74
	$basename = $1;		# lose the leading path, if any
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    75
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    76
if ($basename =~ /^([^.]+)\..*$/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    77
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    78
	$basename = $1;		# lose the trailing extensions, if any
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    79
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    80
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    81
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    82
my @components;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    83
my %arm_assplist;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    84
my $savespace="";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    85
my $keepgoing="";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    86
my $build_tools=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    87
my $build_cwtools=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    88
my $build_winc=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    89
my $build_wins=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    90
my $build_arm4=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    91
my $build_armi=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    92
my $build_thumb=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    93
my $build_arm3=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    94
my $build_armv5=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    95
my $epoc_only=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    96
my $build_winscw=0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    97
my $backwards_compatible_defaults = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    98
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
    99
# Read from all supplied argument files, not just the first
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   100
# Supplied options apply to all components listed.
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   101
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   102
while (<>)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   103
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   104
	s/\s*#.*$//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   105
	s/^\s*//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   106
	my $line = lc $_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   107
	if ($line =~ /^$/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   108
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   109
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   110
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   111
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   112
	if ($line =~ /<option (\w+)\s*(.*)>/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   113
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   114
		my $option = $1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   115
		my $optargs= $2;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   116
		if ($option eq "savespace")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   117
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   118
			$savespace = "-savespace";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   119
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   120
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   121
		if ($option eq "keepgoing")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   122
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   123
			$keepgoing = "-keepgoing";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   124
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   125
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   126
		if ($option eq "tools")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   127
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   128
			$build_tools = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   129
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   130
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   131
		if ($option eq "cwtools")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   132
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   133
			$build_cwtools = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   134
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   135
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   136
		if ($option eq "winc")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   137
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   138
			$build_winc = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   139
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   140
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   141
		if ($option eq "wins")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   142
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   143
			$build_wins = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   144
			$backwards_compatible_defaults = 0;	# explicit <option wins>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   145
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   146
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   147
		if ($option eq "epoconly")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   148
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   149
			$build_winc = 0;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   150
			$epoc_only = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   151
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   152
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   153
		if ($option eq "arm4")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   154
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   155
			$build_arm4 = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   156
			$backwards_compatible_defaults = 0;	# explicit <option arm4>
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 "armi")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   160
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   161
			$build_armi = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   162
			$backwards_compatible_defaults = 0;	# explicit <option armi>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   163
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   164
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   165
		if ($option eq "thumb")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   166
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   167
			$build_thumb = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   168
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   169
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   170
		if ($option eq "arm3")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   171
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   172
			$build_arm3 = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   173
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   174
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   175
		if ($option eq "armv5")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   176
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   177
			$build_armv5 = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   178
			$backwards_compatible_defaults = 0;	# explicit <option armv5>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   179
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   180
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   181
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   182
		if ($option eq "winscw")  
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   183
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   184
			$build_winscw = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   185
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   186
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   187
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   188
		if ($option eq "arm_assp")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   189
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   190
			$arm_assplist{$optargs} = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   191
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   192
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   193
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   194
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   195
		print "Option $1 not yet implemented\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   196
		next;	
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   197
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   198
	if ($line =~ /^([^<]\S+)\s+(\S+)/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   199
	    {
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   200
	    if (!-e "$2\\bld.inf")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   201
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   202
		print STDERR "MISSING COMPONENT $1: can't find $2\\bld.inf\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   203
		next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   204
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   205
	    }
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   206
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   207
	push @components, $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   208
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   209
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   210
if ($backwards_compatible_defaults)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   211
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   212
	# Older versions automatically built these targets, without <option xxx>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   213
	$build_wins = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   214
	$build_arm4 = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   215
	$build_armi = 1;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   216
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   217
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   218
my %specials = (
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   219
    "bldfiles e32toolp" =>
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   220
	"cd tools\\e32toolp\\group\n".
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   221
	"call setupprj\n".
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   222
	"call bld rel\n"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   223
    );
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   224
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   225
print_batch("bldfiles",	"cd %2\n", "call bldmake bldfiles $keepgoing");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   226
print_batch("export",	"cd %2\n", "call abld export $keepgoing");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   227
print_batch("makefile",	"cd %2\n", "call abld makefile $keepgoing %arg1% %arg2% %arg3%");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   228
print_batch("library",	"cd %2\n", "call abld library  $keepgoing %arg1% %arg2% %arg3%");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   229
print_batch("resource",	"cd %2\n", "call abld resource $keepgoing %arg1% %arg2% %arg3%");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   230
print_batch("target",	"cd %2\n", "call abld target   $keepgoing $savespace %arg1% %arg2% %arg3%");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   231
print_batch("final",	"cd %2\n", "call abld final    $keepgoing %arg1% %arg2% %arg3%");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   232
print_batch("clean",	"cd %2\n", "call abld clean    $keepgoing %arg1% %arg2% %arg3%");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   233
print_batch("reallyclean",	"cd %2\n", "call abld reallyclean $keepgoing %arg1% %arg2% %arg3%");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   234
print_batch("check",	"cd %2\n", "call abld -check build %arg1% %arg2% %arg3%");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   235
print_batch("what",		"cd %2\n", "call abld -what build %arg1% %arg2% %arg3%");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   236
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   237
print_control("build");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   238
print_pcontrol("pbuild");
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   239
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   240
#--------------------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   241
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   242
sub print_batch
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   243
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   244
	my ($label, @actions) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   245
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   246
	my $scriptbase = $basename."_".$label;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   247
	open FILE, ">$scriptbase.cmd" or die "can't create $scriptbase.cmd";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   248
	print FILE <<HEAD_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   249
\@echo off
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   250
setlocal
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   251
echo ===-------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   252
echo === $scriptbase %1 %2 %3
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   253
echo ===-------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   254
perl -e "\$time=localtime; print '=== ',$label,' started ', \$time"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   255
echo .
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   256
set arg1=%1
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   257
set arg2=%2
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   258
set arg3=%3
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   259
goto :doit
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   260
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   261
:$label
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   262
echo === $label == %3
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   263
perl -e "print '===+ ',time"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   264
echo .
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   265
setlocal
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   266
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   267
@actions
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   268
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   269
endlocal
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   270
goto :EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   271
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   272
:doit
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   273
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   274
HEAD_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   275
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   276
	my $line;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   277
	foreach $line (@components)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   278
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   279
		if ($line =~ /<special (\w+)\s+(\w+)(.*)>/)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   280
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   281
			if ($1 eq $label)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   282
				{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   283
				print FILE "REM special $1 $2\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   284
				print FILE "echo === $label == $2\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   285
				print FILE "setlocal\n\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   286
				print FILE $specials{"$1 $2"};
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   287
				print FILE "\nendlocal\n\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   288
				}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   289
			next;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   290
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   291
#--------------------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   292
		my @MyList;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   293
		my $tempvar;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   294
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   295
		@MyList = split(/\s+/,$line);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   296
		$tempvar= lc $MyList[$#MyList];
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   297
		$tempvar =~ s/\\group//;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   298
		push @MyList, $tempvar;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   299
		print FILE "call :$label\t$MyList[0]\t$MyList[1]\t$MyList[2]\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   300
#--------------------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   301
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   302
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   303
	print FILE <<TAIL_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   304
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   305
perl -e "\$time=localtime; print '=== ',$label,' finished ', \$time"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   306
echo .
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   307
perl -e "print '===+ ',time"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   308
echo .
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   309
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   310
TAIL_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   311
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   312
	close FILE;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   313
	print "Created $scriptbase.cmd\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   314
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   315
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   316
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   317
#--------------------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   318
# Overall build
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   319
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   320
sub print_control
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   321
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   322
	my ($label) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   323
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   324
	my $scriptbase = $basename."_".$label;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   325
	open FILE, ">$scriptbase.cmd" or die "can't create $scriptbase.cmd";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   326
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   327
	print FILE <<HEAD_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   328
\@echo off
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   329
setlocal
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   330
perl -e "\$time=localtime; print '=== ',$scriptbase,' started ', \$time"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   331
echo .
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   332
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   333
HEAD_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   334
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   335
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   336
	# Generic stuff first
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   337
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   338
	print FILE "call ${basename}_bldfiles\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   339
	print FILE "call ${basename}_export\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   340
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   341
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   342
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   343
	# TOOLS, if any
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   344
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   345
	if ($build_tools)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   346
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   347
		print FILE "call ${basename}_makefile tools\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   348
		print FILE "call ${basename}_library  tools\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   349
		print FILE "call ${basename}_target   tools rel\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   350
		print FILE "call ${basename}_what     tools rel\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   351
		print FILE "call ${basename}_check    tools rel\n\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   352
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   353
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   354
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   355
	# CWTOOLS, if any
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   356
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   357
	if ($build_cwtools)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   358
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   359
		print FILE "call ${basename}_makefile cwtools\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   360
		print FILE "call ${basename}_library  cwtools\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   361
		print FILE "call ${basename}_target   cwtools rel\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   362
		print FILE "call ${basename}_what     cwtools rel\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   363
		print FILE "call ${basename}_check    cwtools rel\n\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   364
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   365
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   366
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   367
	# Emulator things, WINS and WINC
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   368
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   369
	unless ($epoc_only)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   370
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   371
		if ($build_winc)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   372
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   373
			print FILE "call ${basename}_makefile winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   374
			# No resource step for WINC
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   375
			print FILE "call ${basename}_library  winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   376
			print FILE "call ${basename}_target   winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   377
			print FILE "call ${basename}_what     winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   378
			print FILE "call ${basename}_check    winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   379
			print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   380
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   381
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   382
		if ($build_wins)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   383
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   384
			print FILE "call ${basename}_makefile wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   385
			print FILE "call ${basename}_resource wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   386
			print FILE "call ${basename}_library  wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   387
			print FILE "call ${basename}_target   wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   388
			print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   389
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   390
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   391
		if ($build_winscw)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   392
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   393
			print FILE "call ${basename}_makefile winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   394
			print FILE "call ${basename}_resource winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   395
			print FILE "call ${basename}_library  winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   396
			print FILE "call ${basename}_target   winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   397
			print FILE "\n";
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 ($build_wins)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   401
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   402
			print FILE "call ${basename}_final    wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   403
			print FILE "call ${basename}_what     wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   404
			print FILE "call ${basename}_check    wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   405
			print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   406
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   407
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   408
		if ($build_winscw)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   409
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   410
			print FILE "call ${basename}_final    winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   411
			print FILE "call ${basename}_what     winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   412
			print FILE "call ${basename}_check    winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   413
			print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   414
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   415
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   416
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   417
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   418
	# ARM things
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   419
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   420
	# Generic build(s) first, followed by the ASSPs (if any)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   421
	#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   422
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   423
	my $name;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   424
	my $stage;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   425
	my @armthings = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   426
	if ($build_arm4)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   427
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   428
		push @armthings, "arm4";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   429
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   430
	if ($build_armi)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   431
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   432
		push @armthings, "armi";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   433
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   434
	if ($build_thumb)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   435
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   436
		push @armthings, "thumb";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   437
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   438
	if ($build_arm3)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   439
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   440
		push @armthings, "arm3";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   441
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   442
	if ($build_armv5)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   443
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   444
		push @armthings, "armv5";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   445
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   446
	push @armthings, (sort keys %arm_assplist);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   447
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   448
	foreach $stage ("makefile", "resource", "library", "target", "final", "what", "check")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   449
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   450
		foreach $name (@armthings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   451
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   452
			printf FILE "call ${basename}_%-8s $name\n", $stage;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   453
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   454
		print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   455
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   456
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   457
	print FILE <<TAIL_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   458
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   459
perl -e "\$time=localtime; print '=== ',$scriptbase,' finished ', \$time"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   460
echo .
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   461
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   462
TAIL_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   463
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   464
	close FILE;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   465
	print "Created $scriptbase.cmd\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   466
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   467
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   468
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   469
#--------------------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   470
# Overall build, subdivided for multi-machine building
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   471
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   472
sub print_pcontrol
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   473
	{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   474
	my ($label) = @_;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   475
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   476
	my $scriptbase = $basename."_".$label;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   477
	open FILE, ">$scriptbase.cmd" or die "can't create $scriptbase.cmd";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   478
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   479
	print FILE <<HEAD_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   480
\@echo off
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   481
setlocal
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   482
perl -e "\$time=localtime; print '=== ',$scriptbase,' started ', \$time"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   483
echo .
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   484
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   485
goto build_%1
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   486
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   487
HEAD_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   488
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   489
	#========================================================
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   490
	# Getting Ready
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   491
	#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   492
	# Building tools, include files, makefiles, resources
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   493
	# and libraries
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   494
	#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   495
	 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   496
	print FILE ":build_libs\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   497
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   498
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   499
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   500
	# Generic stuff first
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   501
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   502
	print FILE "call ${basename}_bldfiles\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   503
	print FILE "call ${basename}_export\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   504
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   505
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   506
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   507
	# TOOLS, if any
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   508
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   509
	if ($build_tools)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   510
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   511
		print FILE "call ${basename}_makefile tools\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   512
		print FILE "call ${basename}_library  tools\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   513
		print FILE "call ${basename}_target   tools rel\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   514
		print FILE "call ${basename}_what     tools rel\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   515
		print FILE "call ${basename}_check    tools rel\n\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   516
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   517
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   518
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   519
	# CWTOOLS, if any
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   520
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   521
	if ($build_cwtools)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   522
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   523
		print FILE "call ${basename}_makefile cwtools\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   524
		print FILE "call ${basename}_library  cwtools\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   525
		print FILE "call ${basename}_target   cwtools rel\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   526
		print FILE "call ${basename}_what     cwtools rel\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   527
		print FILE "call ${basename}_check    cwtools rel\n\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   528
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   529
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   530
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   531
	# Emulator things, WINS and WINC, up to resources
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   532
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   533
	if ($build_winc)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   534
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   535
		print FILE "call ${basename}_makefile winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   536
		print FILE "call ${basename}_library  winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   537
		print FILE "call ${basename}_target   winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   538
		print FILE "call ${basename}_what     winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   539
		print FILE "call ${basename}_check    winc\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   540
		print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   541
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   542
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   543
	if ($build_wins)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   544
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   545
		print FILE "call ${basename}_makefile wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   546
		print FILE "call ${basename}_resource wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   547
		print FILE "call ${basename}_library  wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   548
		print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   549
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   550
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   551
	#--------------------------------------------------------
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   552
	# ARM things
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   553
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   554
	# Generic build(s) first, followed by the ASSPs (if any)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   555
	#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   556
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   557
	my $name;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   558
	my $stage;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   559
	my @epocthings = ();
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   560
	if ($build_arm4)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   561
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   562
		push @epocthings, "arm4";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   563
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   564
	if ($build_armi)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   565
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   566
		push @epocthings, "armi";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   567
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   568
	if ($build_thumb)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   569
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   570
		push @epocthings, "thumb";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   571
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   572
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   573
	if ($build_arm3)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   574
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   575
		push @epocthings, "arm3";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   576
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   577
	if ($build_armv5)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   578
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   579
		push @epocthings, "armv5";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   580
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   581
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   582
	push @epocthings, (sort keys %arm_assplist);
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   583
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   584
	# For all EPOC things...
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   585
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   586
	foreach $stage ("makefile", "resource", "library")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   587
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   588
		foreach $name (@epocthings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   589
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   590
			printf FILE "call ${basename}_%-8s $name\n", $stage;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   591
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   592
		if ($build_winscw)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   593
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   594
			printf FILE "call ${basename}_%-8s winscw\n", $stage;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   595
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   596
		print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   597
		}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   598
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   599
	print FILE "goto :EOF\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   600
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   601
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   602
	#========================================================
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   603
	# Completing the Emulator
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   604
	#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   605
	 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   606
	print FILE ":build_wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   607
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   608
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   609
	print FILE "call ${basename}_bldfiles\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   610
	print FILE "call ${basename}_target   wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   611
	print FILE "goto :EOF\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   612
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   613
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   614
	print FILE ":build_wins_final\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   615
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   616
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   617
	print FILE "call ${basename}_final    wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   618
	print FILE "call ${basename}_what     wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   619
	print FILE "call ${basename}_check    wins\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   620
	print FILE "goto :EOF\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   621
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   622
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   623
	#========================================================
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   624
	if ($build_winscw){
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   625
	# Completing the Emulator using CodeWarrior
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   626
	#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   627
	 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   628
	print FILE ":build_winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   629
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   630
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   631
	print FILE "call ${basename}_bldfiles\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   632
	print FILE "call ${basename}_target   winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   633
	print FILE "goto :EOF\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   634
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   635
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   636
	print FILE ":build_winscw_final\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   637
	print FILE "\n";
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
	print FILE "call ${basename}_final    winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   641
	print FILE "call ${basename}_what     winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   642
	print FILE "call ${basename}_check    winscw\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   643
	print FILE "goto :EOF\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   644
	print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   645
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   646
	#========================================================
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   647
	# Completing the ARM targets
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   648
	#
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   649
	 
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   650
	foreach $name (@epocthings)
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   651
		{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   652
		print FILE ":build_$name\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   653
		print FILE "\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   654
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   655
		print FILE "call ${basename}_bldfiles\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   656
		foreach $stage ("target", "final", "what", "check")
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   657
			{
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   658
			printf FILE "call ${basename}_%-8s $name\n", $stage;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   659
			}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   660
		print FILE "goto :EOF\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   661
		print FILE "\n";
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
	print FILE <<TAIL_EOF;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   665
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   666
perl -e "\$time=localtime; print '=== ',$scriptbase,' finished ', \$time"
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   667
echo .
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   668
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   669
TAIL_EOF
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   670
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   671
	close FILE;
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   672
	print "Created $scriptbase.cmd\n";
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   673
	}
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   674
3f65fd25dfd4 sync up SVN codes
kelvzhu
parents:
diff changeset
   675