Fixed the GCC assembler issue. Now we can use full GCC tools to build our package.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@795 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jwang36
2006-07-06 10:31:48 +00:00
parent 450d3b106f
commit df569f61e3
11 changed files with 225 additions and 30 deletions

View File

@@ -134,16 +134,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</targetfiles>
<sequential>
<cc userdefine="on">
<command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}" family="${PP_FAMILY}">
<command type="CC" cmd="${CC}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${CC_FAMILY}"
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i">
<EXTRA.INC/>
<argument value="${PP_FLAGS}"/>
<fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
</command>
</cc>
<gendepex inputFile="${DEST_DIR_OUTPUT}/@{FILENAME}.i" outputFile="${DEST_DIR_OUTPUT}/${BASE_NAME}.depex"/>
<gendepex inputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i" outputFile="${DEST_DIR_OUTPUT}/${BASE_NAME}.depex"/>
</sequential>
</OnDependency>
</sequential>
@@ -158,20 +158,27 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<element name="EXTRA.ARG" optional="yes"/>
<!-- Dispath ASM file, there are three type.
asm,s - Build_Assembly
S - Build_Ipf_Assembly -->
asm - Build_Assembly
S - Build_Gcc_Assembly
s - Build_Ipf_Assembly -->
<sequential>
<if>
<or>
<equals arg1="@{FILEEXT}" arg2="asm" />
<equals arg1="@{FILEEXT}" arg2="S" />
</or>
<equals arg1="@{FILEEXT}" arg2="asm" />
<then>
<Build_Assembly FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">
<EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>
<EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>
</Build_Assembly>
</then>
<elseif>
<equals arg1="@{FILEEXT}" arg2="S" />
<then>
<Build_Gcc_Assembly FILEPATH="@{FILEPATH}" FILENAME="@{FILENAME}" FILEEXT="@{FILEEXT}">
<EXTRA.INC.1><EXTRA.INC /></EXTRA.INC.1>
<EXTRA.ARG.1><EXTRA.ARG /></EXTRA.ARG.1>
</Build_Gcc_Assembly>
</then>
</elseif>
<elseif>
<equals arg1="@{FILEEXT}" arg2="s" />
<then>
@@ -249,6 +256,67 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</sequential>
</macrodef>
<!--
Build GCC assembly code
-->
<macrodef name="Build_Gcc_Assembly">
<attribute name="FILEPATH"/>
<attribute name="FILENAME"/>
<attribute name="FILEEXT" default="asm"/>
<element name="EXTRA.INC.1" optional="yes"/>
<element name="EXTRA.ARG.1" optional="yes"/>
<sequential>
<var name="FILE_BASENAME" value="@{FILENAME}" />
<var name="FILE_PATH" value="@{FILEPATH}" />
<mkdir dir="${DEST_DIR_OUTPUT}/@{FILEPATH}"/>
<OnDependency>
<sourcefiles>
<file Name="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
</sourcefiles>
<targetfiles>
<file Name="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj"/>
</targetfiles>
<sequential>
<cc userdefine="on">
<command type="PP" cmd="${PP}" workdir="${DEST_DIR_OUTPUT}/@{FILEPATH}" family="${PP_FAMILY}"
outputDelimiter="-o"
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i">
<EXTRA.INC.1/>
<argument value="${PP_FLAGS}"/>
<fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/>
</command>
</cc>
<replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"
match="^(#[^ ]* +1 +.*@{FILEPATH}/@{FILENAME}\.@{FILEEXT}&quot;).+\1"
replace="#"
flags="gs"/>
<replaceregexp file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"
match="^(#[^ ]* .*)$"
replace="# \1"
byline="true"/>
<cc userdefine="on">
<command type="ASM" cmd="${ASM}" workdir="${DEST_DIR_OUTPUT}" family="${ASM_FAMILY}"
outputFile="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.obj">
<EXTRA.INC.1/>
<argument value="${ASM_FLAGS}"/>
<EXTRA.ARG.1/>
<!-- fileset casesensitive="off" file="${MODULE_DIR}/@{FILEPATH}/@{FILENAME}.@{FILEEXT}"/ -->
<fileset casesensitive="off" file="${DEST_DIR_OUTPUT}/@{FILEPATH}/@{FILENAME}.i"/>
</command>
</cc>
</sequential>
</OnDependency>
</sequential>
</macrodef>
<!--
IPF Assembly
-->

View File

@@ -6,6 +6,6 @@ TOOLS_DEFINITION_FILE = Tools/Conf/tools_def.txt
# Separate multiple targets with space, not not use comma
TARGET =
TARGET_ARCH =
TAGNAME =
TARGET_ARCH = IA32
TAGNAME = MSFT

View File

@@ -23,7 +23,7 @@
*_MSFT_IA32_ASMLINK_PATH = C:\WINDDK\3790.1830\Bin\Bin16\
*_MSFT_IA32_ASL_PATH = C:\TianoTools\Bin
*_MSFT_IA32_*_DPATH = C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE
#*_MSFT_IA32_ASM_EXT = .asm
*_MSFT_IA32_ASM_EXT = .asm
# x64 definitions
*_MSFT_X64_*_PATH = C:\WINDDK\3790.1830\bin\win64\x86\amd64
@@ -35,6 +35,7 @@
# IPF definitions
*_MSFT_IPF_*_PATH = C:\WINDDK\3790.1830\bin\win64\x86
*_MSFT_IPF_ASM_NAME = ias.exe
*_MSFT_IPF_ASM_EXT = .s
# EBC definitions
*_MSFT_EBC_*_FAMILY = INTEL
@@ -45,18 +46,13 @@
*_MSFT_EBC_PP_NAME = iec.exe
# GCC definitions
#*_GCC_*_*_FAMILY = GCC
#*_GCC_*_CC_NAME = gcc
#*_GCC_*_SLINK_NAME = ar
#*_GCC_*_DLINK_NAME = ld
*_GCC_IA32_*_FAMILY = GCC
*_GCC_IA32_CC_NAME = gcc
*_GCC_IA32_SLINK_NAME = ar
*_GCC_IA32_DLINK_NAME = ld
*_GCC_IA32_ASM_NAME = as
*_GCC_IA32_PP_NAME = gcc
# GCC, IA32
#*_GCC_IA32_*_PATH = C:\cygwin\opt\tiano\i386-tiano-pe\i386-tiano-pe\bin
#*_GCC_IA32_ASM_FAMILY = MSFT
#*_GCC_IA32_ASM_NAME = ml.exe
#*_GCC_IA32_ASM_PATH = C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin
#*_GCC_IA32_ASM_DPATH = C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE
#*_GCC_IA32_PP_FAMILY = MSFT
#*_GCC_IA32_PP_NAME = cl.exe
#*_GCC_IA32_PP_PATH = C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin
#*_GCC_IA32_PP_DPATH = C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE
*_GCC_IA32_*_PATH = C:\cygwin\opt\tiano\i386-tiano-pe\i386-tiano-pe\bin
*_GCC_IA32_ASM_EXT = .S