Fix a bug on GenBuild and have a minor update on BuildMacro.xml

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@35 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
wuyizhong 2006-04-26 02:44:39 +00:00
parent 6cfb0c24a8
commit 61746a87be
4 changed files with 17 additions and 31 deletions

View File

@ -616,32 +616,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</targetfiles> </targetfiles>
<sequential> <sequential>
<!-- <echo>re-generate dll</echo> -->
<cc userdefine="on">
<command type="LIB">
<argument value="${LIB_FLAGS}"/>
<FileList dir="" files="${OBJECTS}"/>
<LIB.ARG/>
<!-- <argument value="/OUT:${DEST_DIR_OUTPUT}\@{FILEPATH}\@{FILENAME}Local.lib"/> -->
<OutputFile value="${DEST_DIR_OUTPUT}\@{FILEPATH}\@{FILENAME}Local.lib"/>
</command>
</cc>
<cc userdefine="on"> <cc userdefine="on">
<command type="LINK"> <command type="LINK">
<argument value="${LINK_FLAGS}"/> <argument value="${LINK_FLAGS}"/>
<!-- <argument value="${DEST_DIR_OUTPUT}\@{FILEPATH}\@{FILENAME}Local.lib"/> --> <libset libs="${LIBS}"/>
<!--<argument value="${LIBS}"/>-->
<libSet libs="${LIBS} ${DEST_DIR_OUTPUT}\@{FILEPATH}\@{FILENAME}Local.lib"/>
<LINK.ARG/> <LINK.ARG/>
<!-- <argument value="/ENTRY:_ModuleEntryPoint"/> -->
<EntryPoint value="_ModuleEntryPoint"/> <EntryPoint value="_ModuleEntryPoint"/>
<!-- <argument value="/MAP:${DEST_DIR_OUTPUT}\@{FILEPATH}\@{FILENAME}.map"/> -->
<map value="${DEST_DIR_OUTPUT}\@{FILEPATH}\@{FILENAME}.map"/> <map value="${DEST_DIR_OUTPUT}\@{FILEPATH}\@{FILENAME}.map"/>
<!-- <argument value="/PDB:${DEST_DIR_DEBUG}\@{FILEPATH}\@{FILENAME}.pdb"/> -->
<pdb value="${DEST_DIR_DEBUG}\@{FILEPATH}\@{FILENAME}.pdb"/> <pdb value="${DEST_DIR_DEBUG}\@{FILEPATH}\@{FILENAME}.pdb"/>
<!-- <argument value="/OUT:${DEST_DIR_DEBUG}\@{FILEPATH}\@{FILENAME}.dll"/> -->
<OutputFile value="${DEST_DIR_DEBUG}\@{FILEPATH}\@{FILENAME}.dll"/> <OutputFile value="${DEST_DIR_DEBUG}\@{FILEPATH}\@{FILENAME}.dll"/>
<FileList dir="" files="${OBJECTS}"/>
</command> </command>
</cc> </cc>
</sequential> </sequential>

View File

@ -40,11 +40,13 @@ public class ExpandTask extends Task {
Set <code>LIBS</code> for further build usage. Set <code>LIBS</code> for further build usage.
**/ **/
public void execute() throws BuildException { public void execute() throws BuildException {
String basename = getProject().getProperty("BASE_NAME");
String[] libraries = GlobalData.getModuleLibrary(getProject().getProperty("BASE_NAME")); String arch = getProject().getProperty("ARCH");
arch = arch.toUpperCase();
String[] libraries = GlobalData.getModuleLibrary(basename, arch);
String str = ""; String str = "";
for (int i = 0; i < libraries.length; i ++){ for (int i = 0; i < libraries.length; i ++){
str += " " + GlobalData.getLibrary(libraries[i]); str += " " + GlobalData.getLibrary(libraries[i], arch);
} }
getProject().setProperty("LIBS", str); getProject().setProperty("LIBS", str);

View File

@ -237,8 +237,8 @@ public class GenBuildTask extends Task {
// Update flags like CC_FLAGS, LIB_FLAGS etc. // Update flags like CC_FLAGS, LIB_FLAGS etc.
// //
flagsSetup(); flagsSetup();
GlobalData.addLibrary(baseName, getProject().getProperty("BIN_DIR") + File.separatorChar + baseName + ".lib"); GlobalData.addLibrary(baseName, arch, getProject().getProperty("BIN_DIR") + File.separatorChar + baseName + ".lib");
GlobalData.addModuleLibrary(baseName, libraries); GlobalData.addModuleLibrary(baseName, arch, libraries);
// //
// If ComponentType is USER_DEFINED, // If ComponentType is USER_DEFINED,
// then call the exist BaseName_build.xml directly. // then call the exist BaseName_build.xml directly.

View File

@ -326,8 +326,8 @@ public class GlobalData {
@param moduleName the base name of the module @param moduleName the base name of the module
@return the libraries which the module depends on @return the libraries which the module depends on
**/ **/
public synchronized static String[] getModuleLibrary(String moduleName) { public synchronized static String[] getModuleLibrary(String moduleName, String arch) {
Set<String> set = moduleLibraryMap.get(moduleName); Set<String> set = moduleLibraryMap.get(moduleName + "-" + arch);
return set.toArray(new String[set.size()]); return set.toArray(new String[set.size()]);
} }
@ -337,8 +337,8 @@ public class GlobalData {
@param moduleName the base name of the module @param moduleName the base name of the module
@param libraryList the libraries which the module depends on @param libraryList the libraries which the module depends on
**/ **/
public synchronized static void addModuleLibrary(String moduleName, Set<String> libraryList) { public synchronized static void addModuleLibrary(String moduleName, String arch, Set<String> libraryList) {
moduleLibraryMap.put(moduleName, libraryList); moduleLibraryMap.put(moduleName + "-" + arch, libraryList);
} }
/** /**
@ -347,8 +347,8 @@ public class GlobalData {
@param library the base name of the library @param library the base name of the library
@return the library absolute file name @return the library absolute file name
**/ **/
public synchronized static String getLibrary(String library) { public synchronized static String getLibrary(String library, String arch) {
return libraries.get(library); return libraries.get(library + "-" + arch);
} }
/** /**
@ -357,8 +357,8 @@ public class GlobalData {
@param library the base name of the library @param library the base name of the library
@param resultPath the library absolute file name @param resultPath the library absolute file name
**/ **/
public synchronized static void addLibrary(String library, String resultPath) { public synchronized static void addLibrary(String library, String arch, String resultPath) {
libraries.put(library, resultPath); libraries.put(library + "-" + arch, resultPath);
} }
/** /**