blob: f990fda229af6652b0f57266f6290b38236e47ea [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001#!/usr/bin/perl
2#
3# Copyright Statement:
4# --------------------
5# This software is protected by Copyright and the information contained
6# herein is confidential. The software may not be copied and the information
7# contained herein may not be used or disclosed except with the written
8# permission of MediaTek Inc. (C) 2005
9#
10# BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
11# THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
12# RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
13# AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
14# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
15# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
16# NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
17# SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
18# SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
19# THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
20# NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
21# SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
22#
23# BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
24# LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
25# AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
26# OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
27# MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
28#
29# THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
30# WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
31# LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
32# RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
33# THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
34#
35#
36#!/usr/bin/perl
37# find out required .(hpp|h|dat|c|hex) for the header sources listed in .lis and in .dep
38use File::Copy;
39use File::Path;
40use File::Basename;
41# show usage
42sub usage
43{
44 print "USAGE: perl copyLIS.pl <filename of .lis> <release dir> <MMI DIR> <MMI_VERSION>\n";
45 exit(0);
46}
47
48#
49# parsing command arguments
50#
51
52my $LIS_FILE;
53my $REL_DIR;
54my $reading;
55
56$module = uc $ARGV[0];
57$REL_DIR = $ARGV[1];
58$categorymapping = $ARGV[2];
59
60
61$path = "NONE";
62open FILE, "$categorymapping" or die "can not find $categorymapping\n";
63while (<FILE>){
64 my $line = $_;
65 if ($line =~ /^\s*${module}_MODULE_CATEGORY\s*=\s*(\S+)/){
66 $path = $1;
67 last;
68 }
69}
70close FILE;
71
72die "Can not find ${module}_MODULE_CATEGORY in ~categorymapping.mak\n" if($path eq "NONE");
73my $modulePath = lc "make/pcore//$path";
74my $moduleFile = lc "$modulePath//$module.mak";
75if(!-e "$REL_DIR//$modulePath"){
76 mkpath("$REL_DIR//$modulePath");
77}
78if(-e "$moduleFile"){
79 CopyFile("$moduleFile","$REL_DIR//$moduleFile");
80}
81else{
82 print "Can not find $moduleFile\n";
83}
84
85sub CopyFile
86{
87 my $src = shift;
88 my $target = shift;
89 my $dest = dirname($target);
90 mkpath($dest) if (! -e $dest);
91 copy($src, $target);# or die "Fail to copy $src";
92}