yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame] | 1 | #!/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) 2008
|
| 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 | # Copy files listed in make\$module\$module.lis to the $TARGET.
|
| 38 |
|
| 39 | # show usage
|
| 40 |
|
| 41 | use File::Basename;
|
| 42 |
|
| 43 | sub usage
|
| 44 | {
|
| 45 | print "USAGE: perl checkObjFilePath.pl <filename of .lis>\n";
|
| 46 | exit(0);
|
| 47 | }
|
| 48 |
|
| 49 | my $LIS_FILE;
|
| 50 |
|
| 51 | $ORIGINAL = $ARGV[0];
|
| 52 | $TARGET = $ARGV[1];
|
| 53 | $LIS_FILE = $ARGV[2];
|
| 54 |
|
| 55 | $BASE = $ARGV[3];
|
| 56 | open BASE,"$BASE" or die "0 Cannot open $BASE\n";
|
| 57 | while(<BASE>) {
|
| 58 | chomp($_);
|
| 59 | $base_dir=uc($_);
|
| 60 | $${base_dir}=1;
|
| 61 | }
|
| 62 | close BASE;
|
| 63 |
|
| 64 | my @SRCModList = (defined $ARGV[4])? split(' ',$ARGV[4]) : ();
|
| 65 | foreach $src(@SRCModList) {
|
| 66 | $${src} = 1;
|
| 67 | }
|
| 68 |
|
| 69 | my @PSRCModList = (defined $ARGV[5])? split(' ',$ARGV[5]) : ();
|
| 70 | foreach $psrc(@PSRCModList) {
|
| 71 | $${psrc} = 1;
|
| 72 | }
|
| 73 |
|
| 74 | $GLOBAL_USE = 1;
|
| 75 |
|
| 76 | $EXCLUDE_FILE = $ARGV[6];
|
| 77 | open EXCLUDE_FILE,"$EXCLUDE_FILE" or die "1 Cannot open $EXCLUDE_FILE\n";
|
| 78 | while(<EXCLUDE_FILE>) {
|
| 79 | chomp($_);
|
| 80 | $_ =~ /(.+) (.+)/;
|
| 81 | $ex_file=uc($2);
|
| 82 | $${ex_file}=$1;
|
| 83 | }
|
| 84 | close EXCLUDE_FILE;
|
| 85 |
|
| 86 | $RELEASE_PACKAGE = $ARGV[7];
|
| 87 |
|
| 88 | if ($RELEASE_PACKAGE =~ /INET_MMI/i) {
|
| 89 | $INET_MMI = 1;
|
| 90 | $MMI = 1;
|
| 91 | } elsif ($RELEASE_PACKAGE =~ /MMI/i) {
|
| 92 | $MMI = 1;
|
| 93 | } elsif ($RELEASE_PACKAGE =~ /INET_L4/i) {
|
| 94 | $INET_L4 = 1;
|
| 95 | $L4 = 1;
|
| 96 | } elsif ($RELEASE_PACKAGE =~ /L4/i) {
|
| 97 | $L4 = 1;
|
| 98 | } elsif ($RELEASE_PACKAGE =~ /INET_PROTOCOL/i) {
|
| 99 | $INET_PROTOCOL = 1;
|
| 100 | $PROTOCOL = 1;
|
| 101 | } elsif ($RELEASE_PACKAGE =~ /PROTOCOL/i) {
|
| 102 | $PROTOCOL = 1;
|
| 103 | print "RELEASE_PACKAGE=$RELEASE_PACKAGE $PROTOCOL\n";
|
| 104 | } else {
|
| 105 | $OBJ = 1;
|
| 106 | }
|
| 107 |
|
| 108 | open LIS_FILE,"$LIS_FILE" or die "2 Cannot open $LIS_FILE\n";
|
| 109 |
|
| 110 | $backup = $/; undef $/;
|
| 111 | $reading = <LIS_FILE>;
|
| 112 | $/ = $backup;
|
| 113 | close LIS_FILE;
|
| 114 |
|
| 115 | @FILE = split(" ",$reading);
|
| 116 | system("perl pcore\\tools\\time.pl -n");
|
| 117 | foreach (@FILE) {
|
| 118 | $LIS= $_;
|
| 119 | open LIS,"$_" or die "2 Cannot open $_\n";
|
| 120 | while (<LIS>) {
|
| 121 | chomp($_);
|
| 122 | $file = uc($_);
|
| 123 | $file_dir = uc(dirname($file));
|
| 124 | # if (($${file_dir} == 1) && ($$${file} != 1) && ($file =~ /\.(c|cpp|s)$/i)) {
|
| 125 | # system("echo Error: The object-release $file in $LIS is under the must-be-released folder: $file_dir.>>custom_release_err.log");
|
| 126 | # print "Error: The object-release $file in $LIS is under the must-be-released folder: $file_dir.\n";
|
| 127 | # exit 1;
|
| 128 | # }
|
| 129 | # while ($file_dir =~ /\\/) {
|
| 130 | # $file_dir = uc(dirname($file_dir));
|
| 131 | # if (($${file_dir} == 1) && ($$${file} != 1) && ($file =~ /\.(c|cpp|s)$/i)) {
|
| 132 | # system("echo Error: The object-release $file in $LIS is under the must-be-released folder: $file_dir.>>custom_release_err.log");
|
| 133 | # print "Error: The object-release $file in $LIS is under the must-be-released folder: $file_dir.\n";
|
| 134 | # exit 1;
|
| 135 | # }
|
| 136 | # }
|
| 137 | if (-e "$TARGET\\$file") {
|
| 138 | if (($file =~ /\.(c|cpp|s)$/i) && ($$${file} != 1)) {
|
| 139 | system("echo Error: The object-release $file in $LIS is released to $TARGET\\$file.>>custom_release_err.log");
|
| 140 | print "Error: The object-release $file in $LIS is released to $TARGET\\$file.\n";
|
| 141 | exit 1;
|
| 142 | }
|
| 143 | }
|
| 144 | }
|
| 145 | close LIS;
|
| 146 | }
|
| 147 | system("perl pcore\\tools\\time.pl -n");
|
| 148 |
|
| 149 |
|