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