- Fixed PVCS tracker 484 by merging the GenDll and GenEfi macro in BuildMacro.xml to GenEfi, moving out GenDll and GenEfi macro calling inside macro EFI_SECTION_TE and EFI_SECTION_PE32, and generating the calling of GenEfi macro according to the module type (binary or library).
- Cleaned the coding style of AutoGen.java git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2429 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -371,19 +371,24 @@ public class ModuleBuildFileGenerator {
|
||||
|
||||
FileProcess fileProcess = new FileProcess();
|
||||
fileProcess.init(project, includes, document);
|
||||
|
||||
//
|
||||
// Initialize some properties by user
|
||||
//
|
||||
Element initEle = document.createElement("Build_Init");
|
||||
Element initIncEle = document.createElement("EXTRA.INC");
|
||||
for (int i = 0; i < includes.length; i++) {
|
||||
Element includeEle = document.createElement("includepath");
|
||||
includeEle.setAttribute("path", includes[i]);
|
||||
initIncEle.appendChild(includeEle);
|
||||
|
||||
boolean isBinaryModule = fpdModuleId.getModule().isBinary();
|
||||
boolean isLibraryModule = fpdModuleId.getModule().isLibrary();
|
||||
|
||||
if (!isBinaryModule) {
|
||||
//
|
||||
// Initialize some properties by user
|
||||
//
|
||||
Element initEle = document.createElement("Build_Init");
|
||||
Element initIncEle = document.createElement("EXTRA.INC");
|
||||
for (int i = 0; i < includes.length; i++) {
|
||||
Element includeEle = document.createElement("includepath");
|
||||
includeEle.setAttribute("path", includes[i]);
|
||||
initIncEle.appendChild(includeEle);
|
||||
}
|
||||
initEle.appendChild(initIncEle);
|
||||
root.appendChild(initEle);
|
||||
}
|
||||
initEle.appendChild(initIncEle);
|
||||
root.appendChild(initEle);
|
||||
|
||||
String moduleDir = project.getProperty("MODULE_DIR");
|
||||
//
|
||||
@ -421,10 +426,9 @@ public class ModuleBuildFileGenerator {
|
||||
}
|
||||
|
||||
//
|
||||
// Parse AutoGen.c & AutoGen.h
|
||||
// Don't build AutoGen.c for library and binary module
|
||||
//
|
||||
if (!fpdModuleId.getModule().isLibrary()
|
||||
&& !fpdModuleId.getModule().isBinary()) {
|
||||
if (!isLibraryModule && !isBinaryModule) {
|
||||
fileProcess.parseFile(project.getProperty("DEST_DIR_DEBUG") + File.separatorChar + "AutoGen.c", null, root, false);
|
||||
}
|
||||
|
||||
@ -470,6 +474,18 @@ public class ModuleBuildFileGenerator {
|
||||
if (sectiontype.equalsIgnoreCase("EFI_SECTION_RAW") && project.getProperty("MODULE_TYPE").equalsIgnoreCase("SEC")) {
|
||||
sectiontype += "_SEC";
|
||||
}
|
||||
if ((sectiontype.equalsIgnoreCase("EFI_SECTION_PE32") ||
|
||||
sectiontype.equalsIgnoreCase("EFI_SECTION_TE"))
|
||||
&& !fpdModuleId.getModule().isLibrary()
|
||||
&& !fpdModuleId.getModule().isBinary()) {
|
||||
//
|
||||
// Generate code to generate efi file
|
||||
//
|
||||
Element ele = document.createElement("GenEfi");
|
||||
ele.setAttribute("FILEPATH", ".");
|
||||
ele.setAttribute("FILENAME", "${BASE_NAME}");
|
||||
root.appendChild(ele);
|
||||
}
|
||||
Element ele = document.createElement(sectiontype);
|
||||
ele.setAttribute("FILEPATH", ".");
|
||||
ele.setAttribute("FILENAME", "${BASE_NAME}");
|
||||
|
@ -1107,8 +1107,7 @@ public class AutoGen {
|
||||
fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n");
|
||||
fileBuffer.append(" ProcessLibraryDestructorList (gImageHandle, gST);\r\n");
|
||||
fileBuffer.append(" }\r\n");
|
||||
fileBuffer
|
||||
.append(" gBS->Exit (gImageHandle, Status, 0, NULL);\r\n");
|
||||
fileBuffer.append(" gBS->Exit (gImageHandle, Status, 0, NULL);\r\n");
|
||||
} else {
|
||||
fileBuffer.append(" if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");
|
||||
fileBuffer.append(" mDriverEntryPointStatus = Status;\r\n");
|
||||
@ -1591,8 +1590,7 @@ public class AutoGen {
|
||||
case CommonDefinition.ModuleTypePeiCore:
|
||||
case CommonDefinition.ModuleTypePeim:
|
||||
fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
|
||||
fileBuffer
|
||||
.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
|
||||
fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
|
||||
break;
|
||||
|
||||
case CommonDefinition.ModuleTypeDxeCore:
|
||||
|
Reference in New Issue
Block a user