Using ${OBJECTS} instead of fileset to trace all obj files. Add a new Macro named Build_Init to provide a way to initial some properties for user.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1252 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
wuyizhong 2006-08-14 07:00:48 +00:00
parent 7b086bab60
commit 88f858a135
3 changed files with 28 additions and 11 deletions

View File

@ -10,6 +10,17 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-->
<project name="common">
<!--
Macro for intialize some properties. This Macro build will be called before source file build.
-->
<macrodef name="Build_Init">
<sequential>
<var name="OBJECTS" value="" />
<var name="SDB_FILES" value="" />
</sequential>
</macrodef>
<!--
macro definitions for building files with different types
-->
@ -60,6 +71,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</cc>
</sequential>
</OnDependency>
<var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />
</sequential>
</macrodef>
@ -108,6 +120,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</cc>
</sequential>
</OnDependency>
<var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />
</sequential>
</macrodef>
@ -252,6 +265,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</cc>
</sequential>
</OnDependency>
<var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />
</sequential>
</macrodef>
@ -293,6 +307,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</cc>
</sequential>
</OnDependency>
<var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />
</sequential>
</macrodef>
@ -349,6 +364,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</cc>
</sequential>
</OnDependency>
<var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />
</sequential>
</macrodef>
@ -396,7 +412,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<OnDependency>
<sourcefiles>
<fileset casesensitive="on" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>
<file list="${OBJECTS}" />
</sourcefiles>
<targetfiles>
<file name="${BIN_DIR}/@{FILENAME}.lib"/>
@ -408,7 +424,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
outputFile="${BIN_DIR}/@{FILENAME}.lib">
<argument value="${SLINK_FLAGS}"/>
<fileset casesensitive="on" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>
<argument value="${OBJECTS}"/>
</command>
</cc>
</sequential>
@ -525,7 +541,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</cc>
</sequential>
</OnDependency>
<var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Strings.obj" />
</sequential>
</macrodef>
@ -579,6 +595,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<delete file="${PLATFORM_DIR}/@{FILENAME}.i" />
</sequential>
</OnDependency>
<var name="OBJECTS" value="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj" />
</sequential>
</macrodef>
@ -618,7 +635,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<OnDependency>
<sourcefiles>
<file list="${LIBS}"/>
<fileset casesensitive="on" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>
<file list="${OBJECTS}"/>
</sourcefiles>
<targetfiles>
<file name="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.dll"/>
@ -630,7 +647,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}Local.lib">
<argument value="${SLINK_FLAGS}"/>
<fileset casesensitive="on" dir="${DEST_DIR_OUTPUT}" includes="**/*.obj"/>
<argument value="${OBJECTS}"/>
</command>
</cc>
<cc userdefine="on">

View File

@ -285,7 +285,6 @@ public class GenBuildTask extends Ant {
// MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE
// MODULE_DIR, MODULE_RELATIVE_DIR
// SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH
// LIBS, OBJECTS, SDB_FILES
//
setModuleCommonProperties(archList[k]);
@ -429,12 +428,7 @@ public class GenBuildTask extends Ant {
getProject().setProperty("ENTRYPOINT", "_ModuleEntryPoint");
}
//
// LIBS, OBJECTS, SDB_FILES
//
getProject().setProperty("OBJECTS", "");
getProject().setProperty("SDB_FILES", "");
getProject().setProperty("LIBS", "");
}
private void getCompilerFlags(String target, String toolchain, FpdModuleIdentification fpdModuleId) throws EdkException {

View File

@ -414,6 +414,12 @@ public class ModuleBuildFileGenerator {
FileProcess fileProcess = new FileProcess();
fileProcess.init(project, includes, document);
//
// Initialize some properties by user
//
Element initEle = document.createElement("Build_Init");
root.appendChild(initEle);
String moduleDir = project.getProperty("MODULE_DIR");
//