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