mirror of https://github.com/acidanthera/audk.git
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:
parent
b991a45139
commit
a387de3b32
|
@ -29,15 +29,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</not>
|
||||
</and>
|
||||
<then>
|
||||
<if>
|
||||
<available type="file" file="${DEST_DIR_OUTPUT}/AutoGen.h.gch"/>
|
||||
<then>
|
||||
<makedeps DepsFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep">
|
||||
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
|
||||
<EXTRA.INC/>
|
||||
</makedeps>
|
||||
</then>
|
||||
</if>
|
||||
<makedeps DepsFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"
|
||||
TargetFile="${DEST_DIR_OUTPUT}/AutoGen.h.gch">
|
||||
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
|
||||
<EXTRA.INC/>
|
||||
</makedeps>
|
||||
|
||||
<OnDependency>
|
||||
<sourcefiles>
|
||||
|
@ -102,20 +98,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<var name="FILE_PATH" value="@{FILEPATH}" />
|
||||
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
|
||||
|
||||
<if>
|
||||
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
|
||||
<then>
|
||||
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
|
||||
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
|
||||
<EXTRA.INC/>
|
||||
</makedeps>
|
||||
</then>
|
||||
</if>
|
||||
<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/>
|
||||
</makedeps>
|
||||
|
||||
<OnDependency>
|
||||
<sourcefiles>
|
||||
<file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
|
||||
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
|
||||
</sourcefiles>
|
||||
<targetfiles>
|
||||
<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}" />
|
||||
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
|
||||
|
||||
<if>
|
||||
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
|
||||
<then>
|
||||
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
|
||||
<input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
|
||||
<EXTRA.INC/>
|
||||
</makedeps>
|
||||
</then>
|
||||
</if>
|
||||
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"
|
||||
TargetFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
|
||||
<input file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
<EXTRA.INC/>
|
||||
</makedeps>
|
||||
|
||||
<OnDependency>
|
||||
<sourcefiles>
|
||||
<file ListFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
|
||||
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
|
||||
</sourcefiles>
|
||||
<targetfiles>
|
||||
<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}" />
|
||||
<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>
|
||||
<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>
|
||||
<targetfiles>
|
||||
<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}" />
|
||||
<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>
|
||||
<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>
|
||||
<targetfiles>
|
||||
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
|
||||
|
@ -429,20 +431,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<sequential>
|
||||
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
|
||||
|
||||
<if>
|
||||
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
|
||||
<then>
|
||||
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
|
||||
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
|
||||
<EXTRA.INC.1/>
|
||||
</makedeps>
|
||||
</then>
|
||||
</if>
|
||||
<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>
|
||||
<sourcefiles>
|
||||
<file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
|
||||
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
|
||||
</sourcefiles>
|
||||
<targetfiles>
|
||||
<file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
|
||||
|
@ -485,6 +483,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</macrodef>
|
||||
|
||||
|
||||
<!--
|
||||
Assembly the preprocessed IPF assembly code
|
||||
-->
|
||||
<macrodef name="Build_IPF_PP_Code">
|
||||
<attribute name="FILEPATH"/>
|
||||
<attribute name="FILENAME"/>
|
||||
|
@ -515,9 +516,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</macrodef>
|
||||
|
||||
|
||||
<!--
|
||||
Library private HashMap map = new HashMap();
|
||||
-->
|
||||
<!--
|
||||
Library
|
||||
-->
|
||||
<macrodef name="Build_Library">
|
||||
<attribute name="FILENAME" />
|
||||
<attribute name="FILEEXT" default="obj"/>
|
||||
|
@ -563,10 +564,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
<sequential>
|
||||
<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>
|
||||
<sourcefiles>
|
||||
<file name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
<file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
|
||||
</sourcefiles>
|
||||
<targetfiles>
|
||||
<file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.sdb"/>
|
||||
|
@ -689,20 +695,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<sequential>
|
||||
<mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>
|
||||
|
||||
<if>
|
||||
<available type="file" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
|
||||
<then>
|
||||
<makedeps DepsFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep">
|
||||
<input file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
<input file="${DEST_DIR_DEBUG}/AutoGen.h"/>
|
||||
<EXTRA.INC/>
|
||||
</makedeps>
|
||||
</then>
|
||||
</if>
|
||||
<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/>
|
||||
</makedeps>
|
||||
|
||||
<OnDependency>
|
||||
<sourcefiles>
|
||||
<file listfile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.dep"/>
|
||||
<file ListFile="${DEST_DIR_OUTPUT}/AutoGen.h.dep"/>
|
||||
</sourcefiles>
|
||||
<targetfiles>
|
||||
<file name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
|
||||
|
@ -911,7 +913,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</macrodef>
|
||||
|
||||
<!--
|
||||
DUMMY
|
||||
DUMMY - for skipping the source file which should not be built
|
||||
-->
|
||||
<macrodef name="Build_DUMMY">
|
||||
<attribute name="FILEPATH"/>
|
||||
|
|
|
@ -14,9 +14,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
**/
|
||||
package org.tianocore.framework.tasks;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
@ -44,6 +46,7 @@ public class MakeDeps extends Task {
|
|||
//
|
||||
// private members, use set/get to access them
|
||||
//
|
||||
private String targetFile = "";
|
||||
private String depsFilePath = "";
|
||||
private IncludePath includePathList = new IncludePath();
|
||||
private Input inputFileList = new Input();
|
||||
|
@ -54,7 +57,7 @@ public class MakeDeps extends Task {
|
|||
//
|
||||
// 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() {
|
||||
|
||||
|
@ -69,6 +72,13 @@ public class MakeDeps extends Task {
|
|||
@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
|
||||
//
|
||||
|
@ -124,6 +134,14 @@ public class MakeDeps extends Task {
|
|||
FileTimeStamp.update(depsFilePath, depsFile.lastModified());
|
||||
}
|
||||
|
||||
public void setTargetFile(String name) {
|
||||
targetFile = name;
|
||||
}
|
||||
|
||||
public String getTargetFile() {
|
||||
return targetFile;
|
||||
}
|
||||
|
||||
/**
|
||||
Set method for "DepsFile" attribute
|
||||
|
||||
|
@ -280,24 +298,30 @@ public class MakeDeps extends Task {
|
|||
if (!srcFile.exists()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// try cache first
|
||||
//
|
||||
Set<String> incFiles = includesCache.get(src);
|
||||
if (incFiles == null) {
|
||||
incFiles = new HashSet<String>();
|
||||
FileReader fileReader = null;
|
||||
BufferedReader bufReader = null;
|
||||
FileInputStream fileReader = null;
|
||||
BufferedInputStream bufReader = null;
|
||||
String fileContent = "";
|
||||
int fileLength = (int)srcFile.length();
|
||||
|
||||
try {
|
||||
fileReader = new FileReader(srcFile);
|
||||
bufReader = new BufferedReader(fileReader);
|
||||
char[] buf = new char[fileLength];
|
||||
fileReader = new FileInputStream(srcFile);
|
||||
bufReader = new BufferedInputStream(fileReader);
|
||||
byte[] buf = new byte[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);
|
||||
} catch (IOException e) {
|
||||
throw new BuildException(e.getMessage());
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue