Fixed EDKT498(enchance makedep tool to support asm file), EDKT500(dep file needs to be created for uni file) and tracker ID 454(report real driver entrypoint address through debug output) in PVCS.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2246 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jwang36 2007-01-15 01:59:23 +00:00
parent b991a45139
commit a387de3b32
3 changed files with 568 additions and 579 deletions

View File

@ -29,15 +29,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</not> </not>
</and> </and>
<then> <then>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.gch"/> TargetFile="${DEST_DIR_OUTPUT}/AutoGen.h.gch">
<then> <input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"> <EXTRA.INC/>
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/> </makedeps>
<EXTRA.INC/>
</makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
@ -102,20 +98,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<var name="FILE_PATH" value="@{FILEPATH}" /> <var name="FILE_PATH" value="@{FILEPATH}" />
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<then> <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"> <EXTRA.INC/>
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> </makedeps>
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<EXTRA.INC/>
</makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/> <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -161,20 +153,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<var name="FILE_PATH" value="@{FILEPATH}" /> <var name="FILE_PATH" value="@{FILEPATH}" />
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<then> <input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"> <EXTRA.INC/>
<input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> </makedeps>
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<EXTRA.INC/>
</makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/> <file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -304,9 +292,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<var name="FILE_PATH" value="@{FILEPATH}" /> <var name="FILE_PATH" value="@{FILEPATH}" />
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<EXTRA.INC.1/>
</makedeps>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <file Listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -379,9 +374,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<var name="FILE_PATH" value="@{FILEPATH}" /> <var name="FILE_PATH" value="@{FILEPATH}" />
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<EXTRA.INC.1/>
</makedeps>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <file Listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -429,20 +431,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<sequential> <sequential>
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<then> <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"> <EXTRA.INC.1/>
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> </makedeps>
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<EXTRA.INC.1/>
</makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/> <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -485,6 +483,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</macrodef> </macrodef>
<!--
Assembly the preprocessed IPF assembly code
-->
<macrodef name="Build_IPF_PP_Code"> <macrodef name="Build_IPF_PP_Code">
<attribute name="FILEPATH"/> <attribute name="FILEPATH"/>
<attribute name="FILENAME"/> <attribute name="FILENAME"/>
@ -515,9 +516,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</macrodef> </macrodef>
<!-- <!--
Library private HashMap map = new HashMap(); Library
--> -->
<macrodef name="Build_Library"> <macrodef name="Build_Library">
<attribute name="FILENAME" /> <attribute name="FILENAME" />
<attribute name="FILEEXT" default="obj"/> <attribute name="FILEEXT" default="obj"/>
@ -563,10 +564,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<sequential> <sequential>
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb">
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<EXTRA.INC/>
</makedeps>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/> <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
@ -689,20 +695,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<sequential> <sequential>
<mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/> <mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>
<if> <makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<then> <input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"> <EXTRA.INC/>
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/> </makedeps>
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
<EXTRA.INC/>
</makedeps>
</then>
</if>
<OnDependency> <OnDependency>
<sourcefiles> <sourcefiles>
<file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/> <file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
</sourcefiles> </sourcefiles>
<targetfiles> <targetfiles>
<file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/> <file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
@ -911,7 +913,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</macrodef> </macrodef>
<!-- <!--
DUMMY DUMMY - for skipping the source file which should not be built
--> -->
<macrodef name="Build_DUMMY"> <macrodef name="Build_DUMMY">
<attribute name="FILEPATH"/> <attribute name="FILEPATH"/>

View File

@ -14,9 +14,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
package org.tianocore.framework.tasks; package org.tianocore.framework.tasks;
import java.io.BufferedInputStream;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader; import java.io.FileReader;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
@ -44,6 +46,7 @@ public class MakeDeps extends Task {
// //
// private members, use set/get to access them // private members, use set/get to access them
// //
private String targetFile = "";
private String depsFilePath = ""; private String depsFilePath = "";
private IncludePath includePathList = new IncludePath(); private IncludePath includePathList = new IncludePath();
private Input inputFileList = new Input(); private Input inputFileList = new Input();
@ -54,7 +57,7 @@ public class MakeDeps extends Task {
// //
// regular expression for "#include ..." directive // regular expression for "#include ..." directive
// //
private static final Pattern incPattern = Pattern.compile("[\n\r \t]*#[ \t]*include[ \t\"<]+([^\n\r\"<>]+)"); private static final Pattern incPattern = Pattern.compile("[\n\r]+[ \t#]*[ \t]*include[ \t]+[\"<]*([^\n\r\"<>]+)[>\"]*[\n\r]+");
public MakeDeps() { public MakeDeps() {
@ -69,6 +72,13 @@ public class MakeDeps extends Task {
@throws BuildException @throws BuildException
**/ **/
public void execute() throws BuildException { public void execute() throws BuildException {
//
// if target file is specified and it hasn't been generated, don't generate
// dep file
//
if (targetFile.length() != 0 && (new File(targetFile)).exists() == false) {
return;
}
// //
// check if the dependency list file is uptodate or not // check if the dependency list file is uptodate or not
// //
@ -124,6 +134,14 @@ public class MakeDeps extends Task {
FileTimeStamp.update(depsFilePath, depsFile.lastModified()); FileTimeStamp.update(depsFilePath, depsFile.lastModified());
} }
public void setTargetFile(String name) {
targetFile = name;
}
public String getTargetFile() {
return targetFile;
}
/** /**
Set method for "DepsFile" attribute Set method for "DepsFile" attribute
@ -280,24 +298,30 @@ public class MakeDeps extends Task {
if (!srcFile.exists()) { if (!srcFile.exists()) {
continue; continue;
} }
// //
// try cache first // try cache first
// //
Set<String> incFiles = includesCache.get(src); Set<String> incFiles = includesCache.get(src);
if (incFiles == null) { if (incFiles == null) {
incFiles = new HashSet<String>(); incFiles = new HashSet<String>();
FileReader fileReader = null; FileInputStream fileReader = null;
BufferedReader bufReader = null; BufferedInputStream bufReader = null;
String fileContent = ""; String fileContent = "";
int fileLength = (int)srcFile.length(); int fileLength = (int)srcFile.length();
try { try {
fileReader = new FileReader(srcFile); fileReader = new FileInputStream(srcFile);
bufReader = new BufferedReader(fileReader); bufReader = new BufferedInputStream(fileReader);
char[] buf = new char[fileLength]; byte[] buf = new byte[fileLength];
bufReader.read(buf, 0, fileLength); bufReader.read(buf, 0, fileLength);
//
// check if the file is utf-16 encoded
//
if (buf[0] == (byte)0xff || buf[0] == (byte)0xfe) {
fileContent = new String(buf, "UTF-16");
buf = fileContent.getBytes("UTF-8");
}
fileContent = new String(buf); fileContent = new String(buf);
} catch (IOException e) { } catch (IOException e) {
throw new BuildException(e.getMessage()); throw new BuildException(e.getMessage());