mirror of https://github.com/acidanthera/audk.git
Refactor the PeCoffLoader into a library. Add PeiRebase Tool.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@247 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
51d48c2666
commit
4df60ea54f
|
@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
Copyright (c) 2006, Intel Corporation
|
||||
-->
|
||||
<property name="ToolName" value="GenFvImage"/>
|
||||
<property name="FileSet" value="BasePeCoff.c GenFvImageLib.c GenFvImageExe.c"/>
|
||||
<property name="FileSet" value="GenFvImageLib.c GenFvImageExe.c"/>
|
||||
|
||||
<taskdef resource="cpptasks.tasks"/>
|
||||
<typedef resource="cpptasks.types"/>
|
||||
|
@ -123,7 +123,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</defineset>
|
||||
|
||||
<fileset dir="${basedir}/${ToolName}"
|
||||
includes="${FileSet} Ia32/PeCoffLoaderEx.c" />
|
||||
includes="${FileSet}"/>
|
||||
|
||||
<includepath path="${PACKAGE_DIR}/${ToolName}"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
|
@ -134,7 +134,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_Ia32"/>
|
||||
<linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>
|
||||
<syslibset dir="${syslibdirs}" libs="${syslibs}" if="gcc"/>
|
||||
<syslibset libs="RpcRT4" unless="gcc"/>
|
||||
|
@ -153,9 +153,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</defineset>
|
||||
|
||||
<fileset dir="${basedir}/${ToolName}"
|
||||
includes="${FileSet} Ia32/PeCoffLoaderEx.c"
|
||||
defaultexcludes="TRUE"
|
||||
excludes="*.xml *.inf"/>
|
||||
includes="${FileSet}"/>
|
||||
|
||||
<includepath path="${PACKAGE_DIR}/${ToolName}"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
|
@ -166,7 +164,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_Ia32"/>
|
||||
<linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>
|
||||
<syslibset dir="${syslibdirs}" libs="${syslibs}" if="gcc"/>
|
||||
<syslibset libs="RpcRT4" unless="gcc"/>
|
||||
|
@ -177,7 +175,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<cc name="${ToolChain}" objdir="${BUILD_DIR_X64}"
|
||||
outfile="${BIN_DIR}/${ToolName}_X64"
|
||||
outtype="executable"
|
||||
libtool="${haveLibtool}"
|
||||
optimize="speed">
|
||||
|
||||
<defineset>
|
||||
|
@ -186,9 +183,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</defineset>
|
||||
|
||||
<fileset dir="${basedir}/${ToolName}"
|
||||
includes="${FileSet} X64/PeCoffLoaderEx.c"
|
||||
defaultexcludes="TRUE"
|
||||
excludes="*.xml *.inf"/>
|
||||
includes="${FileSet}"/>
|
||||
|
||||
<includepath path="${PACKAGE_DIR}/${ToolName}"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
|
@ -198,7 +193,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_X64"/>
|
||||
<linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>
|
||||
<syslibset dir="${syslibdirs}" libs="${syslibs}" if="gcc"/>
|
||||
<syslibset libs="RpcRT4" unless="gcc"/>
|
||||
|
@ -209,7 +204,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<cc name="${ToolChain}" objdir="${BUILD_DIR_IPF}"
|
||||
outfile="${BIN_DIR}/${ToolName}_Ipf"
|
||||
outtype="executable"
|
||||
libtool="${haveLibtool}"
|
||||
optimize="speed">
|
||||
|
||||
<defineset>
|
||||
|
@ -218,9 +212,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</defineset>
|
||||
|
||||
<fileset dir="${basedir}/${ToolName}"
|
||||
includes="${FileSet} Ipf/PeCoffLoaderEx.c"
|
||||
defaultexcludes="TRUE"
|
||||
excludes="*.xml *.inf"/>
|
||||
includes="${FileSet}"/>
|
||||
|
||||
<includepath path="${PACKAGE_DIR}/${ToolName}"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
|
@ -230,7 +222,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_Ipf"/>
|
||||
<linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>
|
||||
<syslibset dir="${syslibdirs}" libs="${syslibs}" if="gcc"/>
|
||||
<syslibset libs="RpcRT4" unless="gcc"/>
|
||||
|
|
|
@ -0,0 +1,203 @@
|
|||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
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 default="GenTool" basedir=".">
|
||||
<!--
|
||||
EDK PeCoffLoader
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
-->
|
||||
<taskdef resource="cpptasks.tasks"/>
|
||||
<typedef resource="cpptasks.types"/>
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
|
||||
|
||||
<property name="LibName" value="PeCoffLoader"/>
|
||||
<property environment="env"/>
|
||||
|
||||
<property name="LINK_OUTPUT_TYPE" value="static"/>
|
||||
<property name="BUILD_DIR_IA32" value="${PACKAGE_DIR}/${LibName}/tmp/Ia32"/>
|
||||
<property name="BUILD_DIR_X64" value="${PACKAGE_DIR}/${LibName}/tmp/X64"/>
|
||||
<property name="BUILD_DIR_IPF" value="${PACKAGE_DIR}/${LibName}/tmp/Ipf"/>
|
||||
|
||||
<target name="GenTool" depends="init, Tool">
|
||||
<echo message="Building the EDK Tool: ${LibName}"/>
|
||||
</target>
|
||||
|
||||
<target name="init">
|
||||
<echo message="The EDK Library: ${LibName}"/>
|
||||
<mkdir dir="${BUILD_DIR_IA32}"/>
|
||||
<mkdir dir="${BUILD_DIR_X64}"/>
|
||||
<mkdir dir="${BUILD_DIR_IPF}"/>
|
||||
<if>
|
||||
<equals arg1="${GCC}" arg2="cygwin"/>
|
||||
<then>
|
||||
<echo message="Cygwin Family"/>
|
||||
<property name="ToolChain" value="gcc"/>
|
||||
</then>
|
||||
<elseif>
|
||||
<os family="dos"/>
|
||||
<then>
|
||||
<echo message="Windows Family"/>
|
||||
<property name="ToolChain" value="msvc"/>
|
||||
</then>
|
||||
</elseif>
|
||||
<elseif>
|
||||
<os family="unix"/>
|
||||
<then>
|
||||
<echo message="UNIX Family"/>
|
||||
<property name="ToolChain" value="gcc"/>
|
||||
</then>
|
||||
</elseif>
|
||||
|
||||
<else>
|
||||
<echo>
|
||||
Unsupported Operating System
|
||||
Please Contact Intel Corporation
|
||||
</echo>
|
||||
</else>
|
||||
</if>
|
||||
<property name="ToolChain" value="gcc"/>
|
||||
<if>
|
||||
<equals arg1="${ToolChain}" arg2="msvc"/>
|
||||
<then>
|
||||
<property name="ext_static" value=".lib"/>
|
||||
<property name="ext_dynamic" value=".dll"/>
|
||||
<property name="ext_exe" value=".exe"/>
|
||||
</then>
|
||||
<elseif>
|
||||
<equals arg1="${ToolChain}" arg2="gcc"/>
|
||||
<then>
|
||||
<property name="ext_static" value=".a"/>
|
||||
<property name="ext_dynamic" value=".so"/>
|
||||
<property name="ext_exe" value=""/>
|
||||
</then>
|
||||
</elseif>
|
||||
</if>
|
||||
|
||||
<condition property="syslibdirs" value="">
|
||||
<os family="mac"/>
|
||||
</condition>
|
||||
|
||||
<condition property="syslibs" value="">
|
||||
<os family="mac"/>
|
||||
</condition>
|
||||
|
||||
<condition property="syslibdirs" value="${env.CYGWIN_HOME}/lib/e2fsprogs">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
|
||||
<condition property="syslibs" value="uuid">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
|
||||
<condition property="syslibdirs" value="/usr/lib">
|
||||
<os name="Linux"/>
|
||||
</condition>
|
||||
|
||||
<condition property="syslibs" value="uuid">
|
||||
<os name="Linux"/>
|
||||
</condition>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="Tool" depends="init, PeCoffLoader_Ia32, PeCoffLoader_Ipf, PeCoffLoader_X64"/>
|
||||
|
||||
<target name="PeCoffLoader_Ia32" >
|
||||
<cc name="${ToolChain}" objdir="${BUILD_DIR_IA32}"
|
||||
outfile="${LIB_DIR}/${LibName}_Ia32"
|
||||
outtype="static"
|
||||
optimize="speed">
|
||||
|
||||
<defineset>
|
||||
<define name="BUILDING_TOOLS"/>
|
||||
<define name="TOOL_BUILD_IA32_TARGET"/>
|
||||
</defineset>
|
||||
|
||||
<fileset dir="${basedir}/${LibName}"
|
||||
includes="BasePeCoff.c Ia32/PeCoffLoaderEx.c" />
|
||||
|
||||
<includepath path="${PACKAGE_DIR}/${LibName}"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
</cc>
|
||||
</target>
|
||||
|
||||
<target name="PeCoffLoader_Ipf" >
|
||||
<cc name="${ToolChain}" objdir="${BUILD_DIR_IPF}"
|
||||
outfile="${LIB_DIR}/${LibName}_Ipf"
|
||||
outtype="static"
|
||||
optimize="speed">
|
||||
|
||||
<defineset>
|
||||
<define name="BUILDING_TOOLS"/>
|
||||
<define name="TOOL_BUILD_IPF_TARGET"/>
|
||||
</defineset>
|
||||
|
||||
<fileset dir="${basedir}/${LibName}"
|
||||
includes="BasePeCoff.c Ipf/PeCoffLoaderEx.c" />
|
||||
|
||||
<includepath path="${PACKAGE_DIR}/${LibName}"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
</cc>
|
||||
</target>
|
||||
|
||||
<target name="PeCoffLoader_X64" >
|
||||
<cc name="${ToolChain}" objdir="${BUILD_DIR_X64}"
|
||||
outfile="${LIB_DIR}/${LibName}_X64"
|
||||
outtype="static"
|
||||
optimize="speed">
|
||||
|
||||
<defineset>
|
||||
<define name="BUILDING_TOOLS"/>
|
||||
<define name="TOOL_BUILD_X64_TARGET"/>
|
||||
</defineset>
|
||||
|
||||
<fileset dir="${basedir}/${LibName}"
|
||||
includes="BasePeCoff.c X64/PeCoffLoaderEx.c" />
|
||||
|
||||
<includepath path="${PACKAGE_DIR}/${LibName}"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
</cc>
|
||||
</target>
|
||||
|
||||
|
||||
<target name="clean" depends="init">
|
||||
<echo message="Removing Intermediate Files Only"/>
|
||||
<delete>
|
||||
<fileset dir="${BUILD_DIR_IA32}" includes="*.obj"/>
|
||||
<fileset dir="${BUILD_DIR_X64}" includes="*.obj"/>
|
||||
<fileset dir="${BUILD_DIR_IPF}" includes="*.obj"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="cleanall" depends="init">
|
||||
<echo message="Removing Object Files and the Executable: ${LibName}${ext_exe}"/>
|
||||
<delete dir="${PACKAGE_DIR}/${LibName}/tmp">
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
</project>
|
|
@ -29,7 +29,6 @@ Abstract:
|
|||
#include <string.h>
|
||||
#include "CommonLib.h"
|
||||
#include "ParseInf.h"
|
||||
// #include <Guid/PeiPeCoffLoader.h>
|
||||
#include "FvLib.h"
|
||||
|
||||
#include "EfiUtilityMsgs.h"
|
||||
|
@ -38,8 +37,6 @@ Abstract:
|
|||
|
||||
#include "PeiRebaseExe.h"
|
||||
|
||||
extern PEI_PE_COFF_LOADER_PROTOCOL mPeCoffLoader;
|
||||
|
||||
EFI_STATUS
|
||||
ReadHeader (
|
||||
IN FILE *InputFile,
|
||||
|
@ -491,7 +488,7 @@ Returns:
|
|||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
|
||||
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
|
||||
UINTN MemoryImagePointer;
|
||||
UINTN MemoryImagePointerAligned;
|
||||
EFI_PHYSICAL_ADDRESS ImageAddress;
|
||||
|
@ -570,9 +567,9 @@ Returns:
|
|||
//
|
||||
memset (&ImageContext, 0, sizeof (ImageContext));
|
||||
ImageContext.Handle = (VOID *) ((UINTN) CurrentPe32Section.Pe32Section + sizeof (EFI_PE32_SECTION));
|
||||
ImageContext.ImageRead = (EFI_PEI_PE_COFF_LOADER_READ_FILE) FfsRebaseImageRead;
|
||||
ImageContext.ImageRead = (PE_COFF_LOADER_READ_FILE) FfsRebaseImageRead;
|
||||
|
||||
Status = mPeCoffLoader.GetImageInfo (&mPeCoffLoader, &ImageContext);
|
||||
Status = PeCoffLoaderGetImageInfo (&ImageContext);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
Error (NULL, 0, 0, "GetImageInfo() call failed on rebase", FileGuidString);
|
||||
|
@ -593,7 +590,7 @@ Returns:
|
|||
|
||||
ImageContext.ImageAddress = MemoryImagePointerAligned;
|
||||
|
||||
Status = mPeCoffLoader.LoadImage (&mPeCoffLoader, &ImageContext);
|
||||
Status = PeCoffLoaderLoadImage (&ImageContext);
|
||||
if (EFI_ERROR (Status)) {
|
||||
Error (NULL, 0, 0, "LoadImage() call failed on rebase", FileGuidString);
|
||||
free ((VOID *) MemoryImagePointer);
|
||||
|
@ -601,7 +598,7 @@ Returns:
|
|||
}
|
||||
|
||||
ImageContext.DestinationAddress = NewPe32BaseAddress;
|
||||
Status = mPeCoffLoader.RelocateImage (&mPeCoffLoader, &ImageContext);
|
||||
Status = PeCoffLoaderRelocateImage (&ImageContext);
|
||||
if (EFI_ERROR (Status)) {
|
||||
Error (NULL, 0, 0, "RelocateImage() call failed on rebase", FileGuidString);
|
||||
free ((VOID *) MemoryImagePointer);
|
||||
|
@ -802,9 +799,9 @@ Returns:
|
|||
//
|
||||
memset (&ImageContext, 0, sizeof (ImageContext));
|
||||
ImageContext.Handle = (VOID *) TEBuffer;
|
||||
ImageContext.ImageRead = (EFI_PEI_PE_COFF_LOADER_READ_FILE) FfsRebaseImageRead;
|
||||
ImageContext.ImageRead = (PE_COFF_LOADER_READ_FILE) FfsRebaseImageRead;
|
||||
|
||||
Status = mPeCoffLoader.GetImageInfo (&mPeCoffLoader, &ImageContext);
|
||||
Status = PeCoffLoaderGetImageInfo (&ImageContext);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
Error (NULL, 0, 0, "GetImageInfo() call failed on rebase of TE image", FileGuidString);
|
||||
|
@ -825,7 +822,7 @@ Returns:
|
|||
|
||||
|
||||
ImageContext.ImageAddress = MemoryImagePointerAligned;
|
||||
Status = mPeCoffLoader.LoadImage (&mPeCoffLoader, &ImageContext);
|
||||
Status = PeCoffLoaderLoadImage (&ImageContext);
|
||||
if (EFI_ERROR (Status)) {
|
||||
Error (NULL, 0, 0, "LoadImage() call failed on rebase of TE image", FileGuidString);
|
||||
free (TEBuffer);
|
||||
|
@ -834,7 +831,7 @@ Returns:
|
|||
}
|
||||
|
||||
ImageContext.DestinationAddress = NewPe32BaseAddress;
|
||||
Status = mPeCoffLoader.RelocateImage (&mPeCoffLoader, &ImageContext);
|
||||
Status = PeCoffLoaderRelocateImage (&ImageContext);
|
||||
if (EFI_ERROR (Status)) {
|
||||
Error (NULL, 0, 0, "RelocateImage() call failed on rebase of TE image", FileGuidString);
|
||||
free ((VOID *) MemoryImagePointer);
|
||||
|
|
|
@ -0,0 +1,155 @@
|
|||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
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 default="GenTool" basedir=".">
|
||||
<!--
|
||||
EDK PeiRebase Tool
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
-->
|
||||
<property name="ToolName" value="PeiRebase"/>
|
||||
<property name="FileSet" value="*.c"/>
|
||||
|
||||
<taskdef resource="cpptasks.tasks"/>
|
||||
<typedef resource="cpptasks.types"/>
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
|
||||
|
||||
<property environment="env"/>
|
||||
|
||||
<property name="LINK_OUTPUT_TYPE" value="static"/>
|
||||
<property name="BUILD_DIR" value="${PACKAGE_DIR}/${ToolName}/tmp"/>
|
||||
|
||||
<target name="GenTool" depends="init, Tool">
|
||||
<echo message="Building the EDK Tool: ${ToolName}"/>
|
||||
</target>
|
||||
|
||||
<target name="Tool" depends="init, PeiRebase_Ia32, PeiRebase_Ipf, PeiRebase_X64"/>
|
||||
|
||||
<target name="init">
|
||||
<echo message="The EDK Tool: ${ToolName}"/>
|
||||
<mkdir dir="${BUILD_DIR}"/>
|
||||
<if>
|
||||
<equals arg1="${GCC}" arg2="cygwin"/>
|
||||
<then>
|
||||
<echo message="Cygwin Family"/>
|
||||
<property name="ToolChain" value="gcc"/>
|
||||
</then>
|
||||
<elseif>
|
||||
<os family="dos"/>
|
||||
<then>
|
||||
<echo message="Windows Family"/>
|
||||
<property name="ToolChain" value="msvc"/>
|
||||
</then>
|
||||
</elseif>
|
||||
<elseif>
|
||||
<os family="unix"/>
|
||||
<then>
|
||||
<echo message="UNIX Family"/>
|
||||
<property name="ToolChain" value="gcc"/>
|
||||
</then>
|
||||
</elseif>
|
||||
|
||||
<else>
|
||||
<echo>
|
||||
Unsupported Operating System
|
||||
Please Contact Intel Corporation
|
||||
</echo>
|
||||
</else>
|
||||
</if>
|
||||
<if>
|
||||
<equals arg1="${ToolChain}" arg2="msvc"/>
|
||||
<then>
|
||||
<property name="ext_static" value=".lib"/>
|
||||
<property name="ext_dynamic" value=".dll"/>
|
||||
<property name="ext_exe" value=".exe"/>
|
||||
</then>
|
||||
<elseif>
|
||||
<equals arg1="${ToolChain}" arg2="gcc"/>
|
||||
<then>
|
||||
<property name="ext_static" value=".a"/>
|
||||
<property name="ext_dynamic" value=".so"/>
|
||||
<property name="ext_exe" value=""/>
|
||||
</then>
|
||||
</elseif>
|
||||
</if>
|
||||
</target>
|
||||
|
||||
<target name="PeiRebase_Ia32" depends="init">
|
||||
<cc name="${ToolChain}" objdir="${BUILD_DIR}"
|
||||
outfile="${BIN_DIR}/${ToolName}_Ia32"
|
||||
outtype="executable"
|
||||
optimize="speed">
|
||||
|
||||
<fileset dir="${basedir}/${ToolName}"
|
||||
includes="${FileSet}"/>
|
||||
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_Ia32"/>
|
||||
</cc>
|
||||
</target>
|
||||
|
||||
<target name="PeiRebase_Ipf" depends="init">
|
||||
<cc name="${ToolChain}" objdir="${BUILD_DIR}"
|
||||
outfile="${BIN_DIR}/${ToolName}_Ipf"
|
||||
outtype="executable"
|
||||
optimize="speed">
|
||||
|
||||
<fileset dir="${basedir}/${ToolName}"
|
||||
includes="${FileSet}"/>
|
||||
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_Ipf"/>
|
||||
</cc>
|
||||
</target>
|
||||
|
||||
<target name="PeiRebase_X64" depends="init">
|
||||
<cc name="${ToolChain}" objdir="${BUILD_DIR}"
|
||||
outfile="${BIN_DIR}/${ToolName}_X64"
|
||||
outtype="executable"
|
||||
optimize="speed">
|
||||
|
||||
<fileset dir="${basedir}/${ToolName}"
|
||||
includes="${FileSet}" />
|
||||
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>
|
||||
<includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>
|
||||
<includepath path="${PACKAGE_DIR}/Common"/>
|
||||
<libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_X64"/>
|
||||
</cc>
|
||||
</target>
|
||||
|
||||
<target name="clean" depends="init">
|
||||
<echo message="Removing Intermediate Files Only"/>
|
||||
<delete>
|
||||
<fileset dir="${BUILD_DIR}" includes="*.obj"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<target name="cleanall" depends="init">
|
||||
<echo message="Removing Object Files and the Executable: ${ToolName}${ext_exe}"/>
|
||||
<delete dir="${BUILD_DIR}">
|
||||
<fileset dir="${BIN_DIR}" includes="${ToolName}${ext_exe}"/>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
</project>
|
|
@ -22,6 +22,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<property name="LIB_DIR" value="${PACKAGE_DIR}/Library" />
|
||||
<property name="BIN_DIR" value="${WORKSPACE}/Tools/bin" />
|
||||
<property name="BUILD_MODE" value="PACKAGE" />
|
||||
<property name="Libs"
|
||||
value="Common/build.xml CustomizedCompress/build.xml PeCoffLoader/build.xml"/>
|
||||
|
||||
<import file="${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml" />
|
||||
|
||||
|
@ -92,14 +94,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<target name="Libraries">
|
||||
<subant target="" inheritall="true">
|
||||
<fileset dir="${PACKAGE_DIR}"
|
||||
includes="Common/build.xml CustomizedCompress/build.xml"/>
|
||||
includes="${Libs}"/>
|
||||
</subant>
|
||||
</target>
|
||||
|
||||
<target name="Tools" depends="Libraries">
|
||||
<subant target="" inheritall="true">
|
||||
<fileset dir="${PACKAGE_DIR}" includes="*/build.xml"
|
||||
excludes="Common/build.xml CustomizedCompress/build.xml"/>
|
||||
excludes="${Libs}"/>
|
||||
</subant>
|
||||
</target>
|
||||
|
||||
|
|
Loading…
Reference in New Issue