]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineMapping.java
Adjust code format and remove unused code.
[mirror_edk2.git] / Tools / Source / Cpptasks / net / sf / antcontrib / cpptasks / userdefine / UserDefineMapping.java
1 /*
2 *
3 * Copyright 2001-2004 The Ant-Contrib project
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package net.sf.antcontrib.cpptasks.userdefine;
18
19 /**
20 * Relationship between {family, command type} and flags
21 *
22 */
23 public class UserDefineMapping {
24
25 /**
26 * Mapping info: include path delimiter <--> family (vendor) + command type
27 */
28 public static final String[][] includePathFlag = { { "MSFT_CC", "/I" },
29 { "GCC_CC", "-I" }, { "INTEL_CC", "/I" },
30 { "WINDDK_CC", "/I" }, { "MSFT_ASM", "/I" },
31 { "GCC_ASM", "-I" }, { "WINDDK_CC", "/I" },
32 { "MSFT_PP", "/I" }, { "GCC_PP", "-I" },
33 { "WINDDK_PP", "/I" } };
34
35 /**
36 * Mapping info: output file flag <--> family (vendor) + command type
37 */
38 public static final String[][] outputFileFlag = { { "MSFT_CC", "/Fo" },
39 { "GCC_CC", "-o" }, { "INTEL_CC", "/Fo" },
40 { "WINDDK_CC", "/Fo" }, { "MSFT_SLINK", "/OUT:" },
41 { "GCC_SLINK", "-cr" }, { "INTEL_SLINK", "/OUT:" },
42 { "WINDDK_SLINK", "/OUT:" }, { "MSFT_DLINK", "/OUT:" },
43 { "GCC_DLINK", "-o" }, { "INTEL_DLINK", "/OUT:" },
44 { "WINDDK_DLINK", "/OUT:" }, { "MSFT_ASM", "/Fo" },
45 { "GCC_ASM", "-o" }, { "WINDDK_ASM", "/Fo" },
46 { "WINDDK_IPF_ASM", "-o" } };
47
48 /**
49 * Get include delimiter with vendow and command type.
50 *
51 * @param vendor
52 * Vendor
53 * @param commandType
54 * Command Type
55 * @return include path delimiter
56 */
57 public static String getIncludePathDelimiter(String vendor,
58 String commandType) {
59 String key = vendor + "_" + commandType;
60 for (int i = 0; i < includePathFlag.length; i++) {
61 if (includePathFlag[i][0].equalsIgnoreCase(key)) {
62 return includePathFlag[i][1];
63 }
64 }
65 return "/I";
66 }
67
68 /**
69 * Get Output Flag with vendor and command type.
70 *
71 * @param vendor
72 * Vendor
73 * @param commandType
74 * Command Type
75 * @return Output File Flag
76 */
77 public static String getOutputFileFlag(String vendor, String commandType) {
78 String key = vendor + "_" + commandType;
79 for (int i = 0; i < outputFileFlag.length; i++) {
80 if (outputFileFlag[i][0].equalsIgnoreCase(key)) {
81 return outputFileFlag[i][1];
82 }
83 }
84 return "/Fo";
85 }
86
87 }