]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineMapping.java
3 * Copyright 2001-2004 The Ant-Contrib project
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package net
.sf
.antcontrib
.cpptasks
.userdefine
;
20 * Relationship between {family, command type} and flags
23 public class UserDefineMapping
{
26 * Mapping info: include path delimiter <--> family (vendor) + command type
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" } };
36 * Mapping info: output file flag <--> family (vendor) + command type
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" } };
49 * Get include delimiter with vendow and command type.
55 * @return include path delimiter
57 public static String
getIncludePathDelimiter(String vendor
,
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];
69 * Get Output Flag with vendor and command type.
75 * @return Output File Flag
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];