Adjust code format and remove unused code.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1181 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
wuyizhong
2006-08-03 04:34:39 +00:00
parent a390c35d8a
commit e6225e3c73
5 changed files with 212 additions and 171 deletions

View File

@ -15,32 +15,47 @@
* limitations under the License.
*/
package net.sf.antcontrib.cpptasks.userdefine;
/**
* Relationship between {family, command type} and flags
*
*/
public class UserDefineMapping {
/**
* Mapping info: include path delimiter <--> family (vendor) + command type
*/
public static final String[][] includePathFlag = { { "MSFT_CC", "/I" },
{ "GCC_CC", "-I" }, { "INTEL_CC", "/I" },
{ "WINDDK_CC", "/I" }, { "MSFT_ASM", "/I" },
{ "GCC_ASM", "-I" }, { "WINDDK_CC", "/I" },
{ "MSFT_PP", "/I" }, { "GCC_PP", "-I" },
{ "WINDDK_PP", "/I" } };
// list of Vendor: Microsoft, Intel, Gcc
public final String[] families = { "MSFT", "INTEL", "GCC"};
/**
* Mapping info: output file flag <--> family (vendor) + command type
*/
public static final String[][] outputFileFlag = { { "MSFT_CC", "/Fo" },
{ "GCC_CC", "-o" }, { "INTEL_CC", "/Fo" },
{ "WINDDK_CC", "/Fo" }, { "MSFT_SLINK", "/OUT:" },
{ "GCC_SLINK", "-cr" }, { "INTEL_SLINK", "/OUT:" },
{ "WINDDK_SLINK", "/OUT:" }, { "MSFT_DLINK", "/OUT:" },
{ "GCC_DLINK", "-o" }, { "INTEL_DLINK", "/OUT:" },
{ "WINDDK_DLINK", "/OUT:" }, { "MSFT_ASM", "/Fo" },
{ "GCC_ASM", "-o" }, { "WINDDK_ASM", "/Fo" },
{ "WINDDK_IPF_ASM", "-o" } };
// list of Command Type: CC, SLINK, DLINK, ASL, ASM, ASMLINK, PP
public final String[] commandType = { "CC", "SLINK", "DLINK", "ASL",
"ASM", "ASMLINK", "PP" };
public final String[][] includePathFlag = { { "MSFT_CC", "/I" },
{ "GCC_CC", "-I" }, { "INTEL_CC", "/I" }, { "WINDDK_CC", "/I" },
{ "MSFT_ASM", "/I" }, { "GCC_ASM", "-I" }, { "WINDDK_CC", "/I" },
{ "MSFT_PP", "/I" }, { "GCC_PP", "-I" }, { "WINDDK_PP", "/I" } };
public final String[][] outputFileFlag = { { "MSFT_CC", "/Fo" },
{ "GCC_CC", "-o" }, { "INTEL_CC", "/Fo" }, { "WINDDK_CC", "/Fo" },
{ "MSFT_SLINK", "/OUT:" }, { "GCC_SLINK", "-cr" },
{ "INTEL_SLINK", "/OUT:" }, { "WINDDK_SLINK", "/OUT:" },
{ "MSFT_DLINK", "/OUT:" }, { "GCC_DLINK", "-o" },
{ "INTEL_DLINK", "/OUT:" }, { "WINDDK_DLINK", "/OUT:" },
{ "MSFT_ASM", "/Fo" }, { "GCC_ASM", "-o" },
{ "WINDDK_ASM", "/Fo" },{"WINDDK_IPF_ASM", "-o"} };
public String getIncludePathDelimiter(String vendor,
String commandType) {
/**
* Get include delimiter with vendow and command type.
*
* @param vendor
* Vendor
* @param commandType
* Command Type
* @return include path delimiter
*/
public static String getIncludePathDelimiter(String vendor,
String commandType) {
String key = vendor + "_" + commandType;
for (int i = 0; i < includePathFlag.length; i++) {
if (includePathFlag[i][0].equalsIgnoreCase(key)) {
@ -50,7 +65,16 @@ public class UserDefineMapping {
return "/I";
}
public String getOutputFileFlag(String vendor, String commandType) {
/**
* Get Output Flag with vendor and command type.
*
* @param vendor
* Vendor
* @param commandType
* Command Type
* @return Output File Flag
*/
public static String getOutputFileFlag(String vendor, String commandType) {
String key = vendor + "_" + commandType;
for (int i = 0; i < outputFileFlag.length; i++) {
if (outputFileFlag[i][0].equalsIgnoreCase(key)) {