sbsv1/abld/e32util/gendef.pl
author jjkang
Wed, 30 Jun 2010 11:35:58 +0800
changeset 607 378360dbbdba
parent 606 30b30f9da0b7
permissions -rw-r--r--
Merge missed changeset 11 (raptor v2.14 and helium 10.0)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
606
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
     1
#!/usr/bin/perl
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
     2
# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
     3
# All rights reserved.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
     4
# This component and the accompanying materials are made available
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
     5
# under the terms of "Eclipse Public License v1.0"
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
     6
# which accompanies this distribution, and is available
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
     8
#
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
     9
# Initial Contributors:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    10
# Nokia Corporation - initial contribution.
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    11
#
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    12
# Contributors:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    13
#
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    14
# Description:
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    15
# e32toolp/e32util/gendef.pl
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    16
# 
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    17
#
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    18
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    19
use FindBin;		# for FindBin::Bin
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    20
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    21
my $PerlLibPath;    # fully qualified pathname of the directory containing our Perl modules
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    22
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    23
BEGIN {
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    24
# check user has a version of perl that will cope
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    25
	require 5.005_03;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    26
}
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    27
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    28
# Version
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    29
my $MajorVersion = 1;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    30
my $MinorVersion = 1;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    31
my $PatchVersion = 0;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    32
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    33
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    34
# THE MAIN PROGRAM SECTION
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    35
##########################
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    36
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    37
unless (@ARGV>1)
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    38
{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    39
	&Usage;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    40
}
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    41
my @exports = @ARGV;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    42
my $outfile = shift @exports;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    43
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    44
open OUTFILE, ">$outfile" or die "Gendef.pl: Unable to open $outfile for writing";
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    45
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    46
print OUTFILE "EXPORTS\n";
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    47
my $exportNum = 1;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    48
foreach (@exports)
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    49
{
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    50
	print OUTFILE "\t$_ @ $exportNum NONAME\n";
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    51
	++$exportNum;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    52
}
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    53
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    54
close OUTFILE;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    55
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    56
#######################################################################
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    57
# SUBROUTINES
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    58
#######################################################################
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    59
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    60
sub Usage () {
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    61
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    62
	print(
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    63
		"\n",
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    64
		"GENDEF - Generate a DEF file from passed exports V$MajorVersion.$MinorVersion.$PatchVersion\n",
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    65
		"\n",
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    66
		"GENDEF.PL [output def file] [1st export name] ([Other export names]...)\n",
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    67
		"\n",
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    68
		"\n",
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    69
		"\n"
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    70
	);
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    71
	exit 1;
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    72
}
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    73
30b30f9da0b7 Add ..\dev\.. to path
jjkang
parents: 599
diff changeset
    74