mirror of https://github.com/acidanthera/audk.git
Added a new source file type "x86_asm_autogen" to allow assembly source to use macros defined in AutoGen.h
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@483 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6ff7a41cb8
commit
0fd9e1370f
|
@ -245,6 +245,90 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<!--
|
||||
Build x86 assembly with C preprocessing on AutoGen.h
|
||||
-->
|
||||
<macrodef name="Build_x86_asm_autogen">
|
||||
<attribute name="FILEPATH"/>
|
||||
<attribute name="FILENAME"/>
|
||||
<attribute name="FILEEXT" default="asm"/>
|
||||
|
||||
<element name="EXTRA.INC" optional="yes"/>
|
||||
<element name="EXTRA.ARG" optional="yes"/>
|
||||
|
||||
<sequential>
|
||||
<mkdir dir="${DEST_DIR_DEBUG}/@{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}/AutoGen.h"/>
|
||||
<includepath path="${WORKSPACE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}/${ARCH}"/>
|
||||
<EXTRA.INC/>
|
||||
</makedeps>
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<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}.obj"/>
|
||||
</targetfiles>
|
||||
|
||||
<sequential>
|
||||
<cc userdefine="on">
|
||||
<command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">
|
||||
<includepath path="${WORKSPACE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}/${ARCH}"/>
|
||||
<EXTRA.INC/>
|
||||
<argument value="${PP_FLAGS}"/>
|
||||
<argument value="/FI${DEST_DIR_DEBUG}/AutoGen.h"/>
|
||||
<fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
</command>
|
||||
</cc>
|
||||
<replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"
|
||||
match="^(#line\ +1\ +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}").+\1"
|
||||
replace="; Source: ${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
|
||||
flags="gs"/>
|
||||
<replaceregexp file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"
|
||||
match="([^_a-zA-Z])0x([0-9a-fA-F]+)"
|
||||
replace="\10\2h"
|
||||
flags="g"
|
||||
byline="true"/>
|
||||
<move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"
|
||||
tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
<cc userdefine="on">
|
||||
<command type="ASM">
|
||||
<includepath path="${WORKSPACE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}/${ARCH}"/>
|
||||
<EXTRA.INC/>
|
||||
|
||||
<argument value="${ASM_FLAGS}"/>
|
||||
<EXTRA.ARG/>
|
||||
<argument value="/Fl${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.lst"/>
|
||||
<OutputFile value="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
|
||||
|
||||
<fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
</command>
|
||||
</cc>
|
||||
</sequential>
|
||||
</OnDependency>
|
||||
<!--
|
||||
for library generation later
|
||||
-->
|
||||
<bl NAME="OBJECTS" VALUE="${OBJECTS} ${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<!--
|
||||
Library private HashMap map = new HashMap();
|
||||
-->
|
||||
|
@ -352,6 +436,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
<element name="EXTRA.ARG" optional="yes"/>
|
||||
|
||||
<sequential>
|
||||
<mkdir dir="${DEST_DIR_DEBUG}/@{FILEPATH}"/>
|
||||
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
|
||||
|
||||
<if>
|
||||
|
@ -376,21 +461,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
</targetfiles>
|
||||
|
||||
<sequential>
|
||||
<copy file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"
|
||||
tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.c"/>
|
||||
<cc userdefine="on">
|
||||
<command type="CC" workdir=".">
|
||||
<command type="CC" workdir="${DEST_DIR_DEBUG}/@{FILEPATH}">
|
||||
<includepath path="${WORKSPACE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}"/>
|
||||
<includepath path="${MODULE_DIR}/${ARCH}"/>
|
||||
<EXTRA.INC/>
|
||||
<argument value="${PP_FLAGS}"/>
|
||||
<fileset casesensitive="off" file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}.c"/>
|
||||
<fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
|
||||
</command>
|
||||
</cc>
|
||||
<move file="@{FILENAME}.@{FILEEXT}.i"
|
||||
<move file="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.i"
|
||||
tofile="${DEST_DIR_DEBUG}/@{FILEPATH}/@{FILENAME}.pro"/>
|
||||
|
||||
<cc userdefine="on">
|
||||
<command type="ASM" includepathDelimiter="-I">
|
||||
<includepath path="${WORKSPACE_DIR}"/>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
ASL = "/nologo"
|
||||
|
||||
IA32_CC = "/nologo", "/W3", "/WX", "/GX", "/Gy", "/Gs-", "/c", "/D EFI32", "/D UNICODE"
|
||||
IA32_CC = "/nologo", "/W3", "/WX", "/GX", "/Gy", "/O1i", "/GL", "/Gs-", "/c", "/D EFI32", "/D UNICODE"
|
||||
IA32_LIB = "/NOLOGO"
|
||||
IA32_LINK = "/NOLOGO", "/SUBSYSTEM:CONSOLE", "/NODEFAULTLIB", "/IGNORE:4086", "/MAP", "/OPT:REF", "/MACHINE:I386", "/ALIGN:32", "/DLL", "/LTCG"
|
||||
IA32_ASM = "/nologo", "/W3", "/WX", "/c", "/coff", "/DEFI32"
|
||||
IA32_ASMLINK =
|
||||
IA32_PP = "/P"
|
||||
IA32_PP = "/nologo", "/P", "/TC"
|
||||
|
|
|
@ -2,18 +2,18 @@ IA32_CC = "/nologo", "/X", "/W4", "/WX", "/GX", "/Gy", "/GS-", "/c", "/D EFI32"
|
|||
IA32_LIB = "/NOLOGO"
|
||||
IA32_LINK = "/NOLOGO", "/SUBSYSTEM:CONSOLE", "/NODEFAULTLIB", "/IGNORE:4086", "/MAP", "/OPT:REF", "/MACHINE:I386", "/ALIGN:32", "/DLL"
|
||||
IA32_ASM = "/nologo", "/W3", "/WX", "/c", "/coff", "/DEFI32"
|
||||
IA32_PP = "/P"
|
||||
IA32_PP = "/nologo", "/P", "/TC"
|
||||
|
||||
x64_CC = "/nologo", "/X", "/W4", "/WX", "/Gy", "/c", "/Gs8192", "/GS-", "/D EFIx64"
|
||||
x64_CC = "/nologo", "/X", "/W4", "/WX", "/Gy", "/c", "/Gs8192", "/GS-", "/D EFIx64", "/O1i"
|
||||
x64_LIB = "/NOLOGO"
|
||||
x64_LINK = "/NOLOGO", "/Machine:AMD64", "/ALIGN:32", "/DLL", "/NODEFAULTLIB", "/OPT:REF"
|
||||
x64_ASM = "/nologo", "/W3", "/WX", "/c", "/DEFI32"
|
||||
x64_ASMLINK =
|
||||
x64_PP = "/P"
|
||||
x64_PP = "/nologo", "/P", "/TC"
|
||||
|
||||
IPF_CC = "/nologo", "/W4", "/WX", "/EHsc", "/Gy", "/c", "/GS-", "/D EFI64"
|
||||
IPF_CC = "/nologo", "/W4", "/WX", "/EHsc", "/Gy", "/c", "/GS-", "/D EFI64", "/O1i"
|
||||
IPF_PP = "/nologo", "/W4", "/WX", "/EHsc", "/Gy", "/c", "/GS-", "-P", "-C", "/D EFI_MONOSHELL", "/D EFI64"
|
||||
IPF_LIB = "/NOLOGO"
|
||||
IPF_LINK = "/NOLOGO", "/SUBSYSTEM:CONSOLE", "/NODEFAULTLIB", "/IGNORE:4086", "/MAP", "/OPT:REF", "/MACHINE:IA64"
|
||||
IPF_ASM = "-N us", "-X explicit", "-M ilp64", "-N so", "-W4"
|
||||
IPF_PP = "/P"
|
||||
IPF_PP = "/nologo", "/P", "/TC"
|
||||
|
|
Loading…
Reference in New Issue