mirror of https://github.com/acidanthera/audk.git
Added copyright&license header.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@973 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
a45e9a400d
commit
5f42a4bada
|
@ -1,3 +1,16 @@
|
|||
/** @file
|
||||
This file is to define Identification class.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
package org.tianocore.build.id;
|
||||
|
||||
import org.tianocore.build.global.GlobalData;
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
/** @file
|
||||
This file is to define ModuleIdentification class.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
package org.tianocore.build.id;
|
||||
|
||||
import java.io.File;
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
/** @file
|
||||
This file is to define PackageIdentification class.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
package org.tianocore.build.id;
|
||||
import java.io.File;
|
||||
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
/** @file
|
||||
This file is to define PlatformIdentification class.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
package org.tianocore.build.id;
|
||||
import java.io.File;
|
||||
|
||||
|
|
|
@ -1,13 +1,30 @@
|
|||
/** @file
|
||||
This file is to define ToolChainAttribute class.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
package org.tianocore.build.toolchain;
|
||||
|
||||
/**
|
||||
* TODO: Add class description
|
||||
*
|
||||
* @author jwang36
|
||||
*/
|
||||
|
||||
ToolChainAttribute is used to define the enumeration value for the attributes
|
||||
used in tool chain definition file.
|
||||
|
||||
**/
|
||||
public class ToolChainAttribute {
|
||||
private static int nextValue = 0;
|
||||
|
||||
//"NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"
|
||||
//
|
||||
// "NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"
|
||||
//
|
||||
public final static ToolChainAttribute NAME = new ToolChainAttribute("NAME");
|
||||
public final static ToolChainAttribute PATH = new ToolChainAttribute("PATH");
|
||||
public final static ToolChainAttribute DPATH = new ToolChainAttribute("DPATH");
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/** @file
|
||||
ToolChainFactory class.
|
||||
ToolChainConfig class.
|
||||
|
||||
ToolChainFactory class parse all config files and get STD_FLAGS, GLOBAL_FLAGS,
|
||||
and also command path + name.
|
||||
ToolChainFactory class parse all config files and get tool chain information.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
|
@ -27,38 +26,30 @@ import java.util.Set;
|
|||
|
||||
|
||||
/**
|
||||
This class parse all config files and get STD_FLAGS, GLOBAL_FLAGS, and also
|
||||
command path + name.
|
||||
|
||||
ToolChainFactory class parse all config files and get tool chain information.
|
||||
|
||||
@since GenBuild 1.0
|
||||
**/
|
||||
**/
|
||||
public class ToolChainConfig {
|
||||
///
|
||||
/// list of attributes
|
||||
///
|
||||
private final static String[] attributes = {"NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"};
|
||||
///
|
||||
/// elements which are used to define one type of tool
|
||||
///
|
||||
private final static String[] elements = {"TARGET", "TOOLCHAIN", "ARCH", "CMD", "ATTRIBUTE" };
|
||||
|
||||
///
|
||||
/// tool chain definitions
|
||||
///
|
||||
private ToolChainMap config = null;
|
||||
///
|
||||
/// tool chain information (how many targets, archs, etc.)
|
||||
///
|
||||
private ToolChainInfo info = new ToolChainInfo();
|
||||
|
||||
/**
|
||||
Public construct method.
|
||||
**/
|
||||
**/
|
||||
public ToolChainConfig () {
|
||||
}
|
||||
|
||||
/**
|
||||
Public construct method.
|
||||
|
||||
@param confPath the path of config files
|
||||
@param toolChainTag TOOL_CHAIN name
|
||||
@param toolChainFile File object representing the tool chain configuration file
|
||||
**/
|
||||
public ToolChainConfig (File toolChainFile) {
|
||||
try {
|
||||
|
@ -70,10 +61,13 @@ public class ToolChainConfig {
|
|||
}
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
///
|
||||
public void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {
|
||||
/**
|
||||
Collect target, tool chain tag, arch and command information from key part
|
||||
of configuration
|
||||
|
||||
@param toolChainDefKey The set of keys in tool chain configuration
|
||||
**/
|
||||
private void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {
|
||||
Iterator it = toolChainDefKey.iterator();
|
||||
while (it.hasNext()) {
|
||||
ToolChainKey key = (ToolChainKey)it.next();
|
||||
|
@ -85,47 +79,29 @@ public class ToolChainConfig {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
public Set<String> getTargets() {
|
||||
return info.getTargets();
|
||||
}
|
||||
|
||||
public Set<String> getTagnames() {
|
||||
return info.getTagnames();
|
||||
}
|
||||
|
||||
public Set<String> getArchs() {
|
||||
return info.getArchs();
|
||||
}
|
||||
|
||||
public Set<String> getCommands() {
|
||||
return info.getCommands();
|
||||
}
|
||||
|
||||
public String getValue(String key) {
|
||||
return config.get(key);
|
||||
}
|
||||
|
||||
public String getValue(String[] keySet) {
|
||||
return config.get(keySet);
|
||||
}
|
||||
|
||||
public String getValue(ToolChainKey key) {
|
||||
return config.get(key);
|
||||
}
|
||||
**/
|
||||
|
||||
/**
|
||||
Return the tool chain configuration information in a Map form
|
||||
|
||||
@return ToolChainMap Tool chain configurations in a ToolChainMap
|
||||
**/
|
||||
public ToolChainMap getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
Return the tool chain's target, arch, tag and commands information
|
||||
|
||||
@return ToolChainInfo
|
||||
**/
|
||||
public ToolChainInfo getConfigInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
///
|
||||
/// override toString()
|
||||
///
|
||||
/**
|
||||
override toString()
|
||||
|
||||
@return String The converted configuration string in name=value form
|
||||
**/
|
||||
public String toString() {
|
||||
StringBuffer ts = new StringBuffer(10240);
|
||||
|
||||
|
@ -133,7 +109,7 @@ public class ToolChainConfig {
|
|||
while (it.hasNext()) {
|
||||
ToolChainKey key = (ToolChainKey)it.next();
|
||||
ts.append(key.toString() + " = ");
|
||||
// ts.append(config.get(key) + "\n");
|
||||
ts.append(config.get(key) + "\n");
|
||||
}
|
||||
|
||||
return ts.toString();
|
||||
|
|
|
@ -1,13 +1,30 @@
|
|||
/** @file
|
||||
This file is to define ToolChainElement class.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
package org.tianocore.build.toolchain;
|
||||
|
||||
/**
|
||||
* TODO: Add class description
|
||||
*
|
||||
* @author jwang36
|
||||
*/
|
||||
|
||||
This class is an enumeration definition for key elements in tool chain definition
|
||||
file.
|
||||
|
||||
**/
|
||||
public class ToolChainElement {
|
||||
private static int nextValue = 0;
|
||||
|
||||
//"NAME", "PATH", "DPATH", "SPATH", "EXT", "FAMILY", "FLAGS"
|
||||
//
|
||||
// "TARGET", "TOOLCHAIN", "ARCH", "TOOLCODE", "ATTRIBUTE"
|
||||
//
|
||||
public final static ToolChainElement TARGET = new ToolChainElement("TARGET");
|
||||
public final static ToolChainElement TOOLCHAIN = new ToolChainElement("TOOLCHAIN");
|
||||
public final static ToolChainElement ARCH = new ToolChainElement("ARCH");
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
/** @file
|
||||
This file is to define ToolChainInfo class.
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
package org.tianocore.build.toolchain;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -6,17 +19,31 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
public class ToolChainInfo {
|
||||
|
||||
//
|
||||
// build target set
|
||||
//
|
||||
private Set<String> targets = new LinkedHashSet<String>();
|
||||
|
||||
//
|
||||
// tool chain tag name set
|
||||
//
|
||||
private Set<String> tagnames = new LinkedHashSet<String>();
|
||||
|
||||
//
|
||||
// build archs set
|
||||
//
|
||||
private Set<String> archs = new LinkedHashSet<String>();
|
||||
|
||||
//
|
||||
// build commands set
|
||||
//
|
||||
private Set<String> commands = new LinkedHashSet<String>();
|
||||
|
||||
//
|
||||
// build commands for specific tool chain
|
||||
//
|
||||
private Map<String, Set<String>> commandMap = new HashMap<String, Set<String>>();
|
||||
|
||||
/**
|
||||
Add a list of targets in the form of string separated by space
|
||||
|
||||
@param targetList target list string
|
||||
**/
|
||||
public void addTargets(String targetList) {
|
||||
//
|
||||
// targetList some targets separated by space " "
|
||||
|
@ -27,7 +54,11 @@ public class ToolChainInfo {
|
|||
}
|
||||
addTargets(targetList.split(" "));
|
||||
}
|
||||
|
||||
/**
|
||||
Add a list of targets in the form of string array
|
||||
|
||||
@param targetArray target string array
|
||||
**/
|
||||
public void addTargets(String[] targetArray) {
|
||||
if (targetArray == null ) {
|
||||
return ;
|
||||
|
@ -36,11 +67,19 @@ public class ToolChainInfo {
|
|||
targets.add(targetArray[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Add a list of target in the form of set
|
||||
|
||||
@param targetSet target string set
|
||||
**/
|
||||
public void addTargets(Set<String> targetSet) {
|
||||
targets.addAll(targetSet);
|
||||
}
|
||||
|
||||
/**
|
||||
Add a list of tool chain tag name in the form of string separated by space
|
||||
|
||||
@param tagnameList
|
||||
**/
|
||||
public void addTagnames(String tagnameList) {
|
||||
//
|
||||
// tagnameList some tagnames separated by space " "
|
||||
|
@ -142,18 +181,14 @@ public class ToolChainInfo {
|
|||
result.addTargets(union(this.targets, info.targets));
|
||||
result.addTagnames(union(this.tagnames, info.tagnames));
|
||||
result.addArchs(union(this.archs, info.archs));
|
||||
//result.addCommands(union(this.getCommands(), info.getCommands()));
|
||||
return result;
|
||||
}
|
||||
|
||||
public ToolChainInfo intersection(ToolChainInfo info) {
|
||||
// System.out.println(this + "\n" + info);
|
||||
ToolChainInfo result = new ToolChainInfo();
|
||||
result.addTargets(intersection(this.targets, info.targets));
|
||||
result.addTagnames(intersection(this.tagnames, info.tagnames));
|
||||
result.addArchs(intersection(this.archs, info.archs));
|
||||
// result.addCommands(union(this.commands, info.commands));
|
||||
// System.out.println("result: " + result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -182,7 +217,6 @@ public class ToolChainInfo {
|
|||
result.retainAll(set2);
|
||||
}
|
||||
|
||||
// result.remove("*");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,11 +9,6 @@ http://opensource.org/licenses/bsd-license.php
|
|||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
ToolChainKey.java
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
package org.tianocore.build.toolchain;
|
||||
|
|
|
@ -9,11 +9,6 @@ http://opensource.org/licenses/bsd-license.php
|
|||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
ToolChainMap.java
|
||||
|
||||
Abstract:
|
||||
|
||||
--*/
|
||||
|
||||
package org.tianocore.build.toolchain;
|
||||
|
|
|
@ -50,8 +50,6 @@ public class ToolChainTask extends Task{
|
|||
**/
|
||||
public void execute() throws BuildException {
|
||||
String toolChain = getProject().getProperty(toolsEnv);
|
||||
// ToolChainConfig toolchain = new ToolChainConfig(new File(confPath + File.separatorChar + toolChain));
|
||||
//getProject().setProperty("TARGET", toolchain.getCurrentTarget());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue