Sync EDKII BaseTools to BaseTools project r1911.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10177 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2010-03-04 05:29:52 +00:00
parent 545312ad92
commit d5d56f1bc5
28 changed files with 148 additions and 114 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -304,7 +304,7 @@
"$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff "$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) ${src} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff
# create symbol file for GDB debug # create symbol file for GDB debug
-$(DSYMUTIL) ${src} -$(DSYMUTIL) ${src}
GenFw -e $(MODULE_TYPE) -o ${dst} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff GenFw --xip -e $(MODULE_TYPE) -o ${dst} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff
$(CP) ${dst} $(OUTPUT_DIR) $(CP) ${dst} $(OUTPUT_DIR)
$(CP) ${dst} $(BIN_DIR) $(CP) ${dst} $(BIN_DIR)
-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)

View File

@ -137,8 +137,8 @@ DEFINE ICC_WIN_ASLCC_FLAGS = /Y- /TC /WX- /Od /Dmain=ReferenceAcpiTable
DEFINE ICC_WIN_ASLDLINK_FLAGS = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libmmt /NODEFAULTLIB:libirc DEFINE ICC_WIN_ASLDLINK_FLAGS = /NODEFAULTLIB /ENTRY:ReferenceAcpiTable /SUBSYSTEM:CONSOLE /NODEFAULTLIB:libmmt /NODEFAULTLIB:libirc
DEFINE IPHONE_TOOLS = /Developer/Platforms/iPhoneOS.platform/Developer DEFINE IPHONE_TOOLS = /Developer/Platforms/iPhoneOS.platform/Developer
DEFINE RVCT31_TOOLS_PATH = c:/Program Files/ARM/RVCT/Programs/3.1/569/win_32-pentium DEFINE RVCT31_TOOLS_PATH = c:/Program Files/ARM/RVCT/Programs/3.1/761/win_32-pentium
DEFINE RVCT31CYGWIN_TOOLS_PATH = /cygdrive/c/Program Files/ARM/RVCT/Programs/3.1/569/win_32-pentium DEFINE RVCT31CYGWIN_TOOLS_PATH = /cygdrive/c/Program Files/ARM/RVCT/Programs/3.1/761/win_32-pentium
# Update to the location of the gcc executables # Update to the location of the gcc executables
DEFINE ARMGCC_BIN = / DEFINE ARMGCC_BIN = /
@ -1745,6 +1745,7 @@ DEFINE GCC44_ASM_FLAGS = DEF(GCC_ASM_FLAGS)
*_CYGGCC_IA32_ASLPP_PATH = DEF(CYGWIN_BINIA32)gcc *_CYGGCC_IA32_ASLPP_PATH = DEF(CYGWIN_BINIA32)gcc
*_CYGGCC_IA32_ASLDLINK_PATH = DEF(CYGWIN_BINIA32)ld *_CYGGCC_IA32_ASLDLINK_PATH = DEF(CYGWIN_BINIA32)ld
*_CYGGCC_IA32_RC_PATH = DEF(CYGWIN_BINIA32)objcopy *_CYGGCC_IA32_RC_PATH = DEF(CYGWIN_BINIA32)objcopy
*_CYGGCC_IA32_OBJECT_PATH = DEF(CYGWIN_BINIA32)objcopy
*_CYGGCC_IA32_CC_FLAGS = DEF(GCC_IA32_CC_FLAGS) *_CYGGCC_IA32_CC_FLAGS = DEF(GCC_IA32_CC_FLAGS)
*_CYGGCC_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) *_CYGGCC_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
@ -1763,6 +1764,7 @@ DEFINE GCC44_ASM_FLAGS = DEF(GCC_ASM_FLAGS)
*_CYGGCC_X64_ASLPP_PATH = DEF(CYGWIN_BINX64)gcc *_CYGGCC_X64_ASLPP_PATH = DEF(CYGWIN_BINX64)gcc
*_CYGGCC_X64_ASLDLINK_PATH = DEF(CYGWIN_BINX64)ld *_CYGGCC_X64_ASLDLINK_PATH = DEF(CYGWIN_BINX64)ld
*_CYGGCC_X64_RC_PATH = DEF(CYGWIN_BINX64)objcopy *_CYGGCC_X64_RC_PATH = DEF(CYGWIN_BINX64)objcopy
*_CYGGCC_X64_OBJECT_PATH = DEF(CYGWIN_BINX64)objcopy
*_CYGGCC_X64_CC_FLAGS = DEF(GCC_X64_CC_FLAGS) *_CYGGCC_X64_CC_FLAGS = DEF(GCC_X64_CC_FLAGS)
*_CYGGCC_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) *_CYGGCC_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
@ -1782,6 +1784,7 @@ DEFINE GCC44_ASM_FLAGS = DEF(GCC_ASM_FLAGS)
*_CYGGCC_IPF_OBJCOPY_PATH = DEF(CYGWIN_BINIPF)objcopy *_CYGGCC_IPF_OBJCOPY_PATH = DEF(CYGWIN_BINIPF)objcopy
*_CYGGCC_IPF_SYMRENAME_PATH = DEF(CYGWIN_BINIPF)objcopy *_CYGGCC_IPF_SYMRENAME_PATH = DEF(CYGWIN_BINIPF)objcopy
*_CYGGCC_IPF_RC_PATH = DEF(CYGWIN_BINIPF)objcopy *_CYGGCC_IPF_RC_PATH = DEF(CYGWIN_BINIPF)objcopy
*_CYGGCC_IPF_OBJECT_PATH = DEF(CYGWIN_BINIPF)objcopy
*_CYGGCC_IPF_CC_FLAGS = DEF(GCC_IPF_CC_FLAGS) *_CYGGCC_IPF_CC_FLAGS = DEF(GCC_IPF_CC_FLAGS)
*_CYGGCC_IPF_DLINK_FLAGS = DEF(GCC_IPF_DLINK_FLAGS) *_CYGGCC_IPF_DLINK_FLAGS = DEF(GCC_IPF_DLINK_FLAGS)
@ -2757,8 +2760,8 @@ RELEASE_XCODE32_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mthumb-inter
# #
# Use default values, or override in DSC file # Use default values, or override in DSC file
# #
*_RVCT31_ARM_ARCHCC_FLAGS = --thumb --cpu 7-A *_RVCT31_ARM_ARCHCC_FLAGS = --thumb --cpu ARM1176JZF-S
*_RVCT31_ARM_ARCHASM_FLAGS = --cpu 7-A *_RVCT31_ARM_ARCHASM_FLAGS = --cpu ARM1176JZF-S
*_RVCT31_ARM_ARCHDLINK_FLAGS = *_RVCT31_ARM_ARCHDLINK_FLAGS =
*_RVCT31_ARM_PLATFORM_FLAGS = *_RVCT31_ARM_PLATFORM_FLAGS =
@ -2771,8 +2774,8 @@ RELEASE_RVCT31_ARM_DLINK_FLAGS = $(ARCHDLINK_FLAGS) --entry $(IMAGE_ENTRY_PO
*_RVCT31_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h *_RVCT31_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h
*_RVCT31_ARM_MAKE_PATH = nmake *_RVCT31_ARM_MAKE_PATH = nmake
*_RVCT31_ARM_SLINK_FLAGS = --partial -o *_RVCT31_ARM_SLINK_FLAGS = --partial -o
DEBUG_RVCT31_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -g -Ospace -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167 DEBUG_RVCT31_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c -g -O2 --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167
RELEASE_RVCT31_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -Ospace -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167 RELEASE_RVCT31_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --enum_is_int --preinclude AutoGen.h --diag_warning 167
################## ##################
# ARM definitions # ARM definitions
@ -2807,8 +2810,8 @@ RELEASE_RVCT31_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -Ospac
# #
# Use default values, or override in DSC file # Use default values, or override in DSC file
# #
*_RVCT31CYGWIN_ARM_ARCHCC_FLAGS = --thumb --cpu 7-A *_RVCT31CYGWIN_ARM_ARCHCC_FLAGS = --thumb --cpu ARM1176JZF-S
*_RVCT31CYGWIN_ARM_ARCHASM_FLAGS = --cpu 7-A *_RVCT31CYGWIN_ARM_ARCHASM_FLAGS = --cpu ARM1176JZF-S
*_RVCT31CYGWIN_ARM_ARCHDLINK_FLAGS = *_RVCT31CYGWIN_ARM_ARCHDLINK_FLAGS =
*_RVCT31CYGWIN_ARM_PLATFORM_FLAGS = *_RVCT31CYGWIN_ARM_PLATFORM_FLAGS =
@ -2820,8 +2823,8 @@ RELEASE_RVCT31CYGWIN_ARM_DLINK_FLAGS = "$(DLINKPATH_FLAG)" $(ARCHDLINK_FLAGS
*_RVCT31CYGWIN_ARM_VFRPP_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude `cygpath -m $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h` *_RVCT31CYGWIN_ARM_VFRPP_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -DVFRCOMPILE --preinclude `cygpath -m $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h`
*_RVCT31CYGWIN_ARM_MAKE_PATH = make *_RVCT31CYGWIN_ARM_MAKE_PATH = make
*_RVCT31CYGWIN_ARM_SLINK_FLAGS = "$(SLINKPATH_FLAG)" --partial -o *_RVCT31CYGWIN_ARM_SLINK_FLAGS = "$(SLINKPATH_FLAG)" --partial -o
DEBUG_RVCT31CYGWIN_ARM_CC_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c -g -Ospace --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167 DEBUG_RVCT31CYGWIN_ARM_CC_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c -g -O2 --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167
RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c -Ospace --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167 RELEASE_RVCT31CYGWIN_ARM_CC_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --c90 -c --no_autoinline --asm --gnu --apcs /interwork --signed_chars --no_unaligned_access --split_sections --preinclude AutoGen.h --diag_warning 167
################## ##################
# ARM definitions # ARM definitions

View File

@ -66,7 +66,7 @@ Notes:
or modules because the AutoGen.* files have been be removed. The "makefile" itself or modules because the AutoGen.* files have been be removed. The "makefile" itself
cannot generate AutoGen.* files. Only "build" command can. cannot generate AutoGen.* files. Only "build" command can.
3) All .exe binary file including C and python tools are generated from: 3) All .exe binary file including C and python tools are generated from:
r1707 <buildtools_project>\BaseTools\Source\ + r1707 VfrCompiler tool update r1911 <buildtools_project>\BaseTools\Source\.
Brief usage for Migration Tool MigrationMsa2Inf.exe: Brief usage for Migration Tool MigrationMsa2Inf.exe:
1. Command line format: 1. Command line format:
@ -125,30 +125,7 @@ Brief usage for Migration Tool MigrationMsa2Inf.exe:
f. When tool generates [LibraryClasses] section, the recommended library instances are lost. (No impact to build) f. When tool generates [LibraryClasses] section, the recommended library instances are lost. (No impact to build)
7. Pyton Source 7. Pyton Source
r682 <buildtools_project>\BaseTools\Source\Python\MigrationMsa2Inf BaseTools\Source\Python\MigrationMsa2Inf
Brief Usage for PcdSyntax Update:
Usage:
PcdSyntaxUpdate.exe <directory_name>
It searches all INF, DEC and DSC file under <directory_name> and update them with the following rules:
1. Update INF files to conform to INF spec 0.44:
a. Rename PCD section name: e.g. [PcdsFeatureFlag] -> [FeaturePcd]
b. Adjust PCD section item format: e.g. PcdDebugClearMemoryValue|gEfiMdePkgTokenSpaceGuid -> gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue
c. Update the syntax of binary INF file (not PCD related)
2. Update DEC files to confirm to DEC spec 0.36
Adjust PCD section item format: e.g. PcdWinNtPhysicalDisk|0x00001000|gEfiNt32PkgTokenSpaceGuid|VOID*|L"E:RW;245760;512"-> gEfiNt32PkgTokenSpaceGuid.PcdWinNtFlashFvRecoverySize|0x0|UINT32|0x00001011
3. Update DSC files to confirm to DSC spec
a. Adjust string/array typed PCD item format: e.g. PcdWinNtMemorySizeForSecMain|gEfiNt32PkgTokenSpaceGuid|L"64!64"|12 -> gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySizeForSecMain|L"64!64"|VOID*|12
b. Adjust non-string/array typed PCD item format: e.g. PcdWinNtBootMode|gEfiNt32PkgTokenSpaceGuid|1 -> gEfiNt32PkgTokenSpaceGuid.PcdWinNtBootMode|1
c. Update the override library class in [Components] section: e.g.
<LibraryClass> {
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
}
To
<LibraryClasses> {
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
}
Brief usage for Migration Tool Spd2Dec.exe: Brief usage for Migration Tool Spd2Dec.exe:
1. Command line format: 1. Command line format:
@ -164,7 +141,7 @@ Brief usage for Migration Tool Spd2Dec.exe:
Example a & b are equivalent to migrate Nt32 package SPD file from EDKII to EDKII' snytax. Example a & b are equivalent to migrate Nt32 package SPD file from EDKII to EDKII' snytax.
6. Pyton Source 6. Pyton Source
r777 <buildtools_project>\BaseTools\Source\Python\spd2Dec BaseTools\Source\Python\spd2dec
Brief usage for Migration Tool Fpd2Dsc.exe: Brief usage for Migration Tool Fpd2Dsc.exe:
1. Command line format: 1. Command line format:
@ -188,6 +165,6 @@ Brief usage for Migration Tool Fpd2Dsc.exe:
b. If MSA file which is corresponds to module guid could not be found in currect workspace, tool will dump the module guid. b. If MSA file which is corresponds to module guid could not be found in currect workspace, tool will dump the module guid.
7. Pyton Source 7. Pyton Source
r767 <buildtools_project>\BaseTools\Source\Python\Fpd2Dsc BaseTools\Source\Python\fpd2dsc
10-Sep-2009 4-Mar-2010

View File

@ -1,7 +1,7 @@
## @file ## @file
# parse FDF file # parse FDF file
# #
# Copyright (c) 2007, Intel Corporation # Copyright (c) 2007 - 2010, Intel Corporation
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -385,6 +385,21 @@ class FdfParser(object):
Offset += 1 Offset += 1
def __GetMacroName(self):
if not self.__GetNextToken():
raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)
MacroName = self.__Token
NotFlag = False
if MacroName.startswith('!'):
NotFlag = True
MacroName = MacroName[1:].strip()
if not MacroName.startswith('$(') or not MacroName.endswith(')'):
raise Warning("Macro name expected(Please use '$(%(Token)s)' if '%(Token)s' is a macro.)" % {"Token" : MacroName},
self.FileName, self.CurrentLineNumber)
MacroName = MacroName[2:-1]
return MacroName, NotFlag
## PreprocessFile() method ## PreprocessFile() method
# #
# Preprocess file contents, replace comments with spaces. # Preprocess file contents, replace comments with spaces.
@ -554,14 +569,7 @@ class FdfParser(object):
IfList.append([IfStartPos, None, None]) IfList.append([IfStartPos, None, None])
CondLabel = self.__Token CondLabel = self.__Token
if not self.__GetNextToken(): MacroName, NotFlag = self.__GetMacroName()
raise Warning("expected Macro name At Line ", self.FileName, self.CurrentLineNumber)
MacroName = self.__Token
NotFlag = False
if MacroName.startswith('!'):
NotFlag = True
MacroName = MacroName[1:]
NotDefineFlag = False NotDefineFlag = False
if CondLabel == '!ifndef': if CondLabel == '!ifndef':
NotDefineFlag = True NotDefineFlag = True
@ -615,14 +623,7 @@ class FdfParser(object):
self.__WipeOffArea.append((IfList[-1][0], ElseStartPos)) self.__WipeOffArea.append((IfList[-1][0], ElseStartPos))
IfList[-1] = [ElseStartPos, True, IfList[-1][2]] IfList[-1] = [ElseStartPos, True, IfList[-1][2]]
if self.__Token == '!elseif': if self.__Token == '!elseif':
if not self.__GetNextToken(): MacroName, NotFlag = self.__GetMacroName()
raise Warning("expected Macro name At Line ", self.FileName, self.CurrentLineNumber)
MacroName = self.__Token
NotFlag = False
if MacroName.startswith('!'):
NotFlag = True
MacroName = MacroName[1:]
if not self.__GetNextOp(): if not self.__GetNextOp():
raise Warning("expected !endif At Line ", self.FileName, self.CurrentLineNumber) raise Warning("expected !endif At Line ", self.FileName, self.CurrentLineNumber)

View File

@ -1,7 +1,7 @@
## @file ## @file
# parse FDF file # parse FDF file
# #
# Copyright (c) 2007, Intel Corporation # Copyright (c) 2007 - 2010, Intel Corporation
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -415,6 +415,21 @@ class FdfParser:
Offset += 1 Offset += 1
def __GetMacroName(self):
if not self.__GetNextToken():
raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)
MacroName = self.__Token
NotFlag = False
if MacroName.startswith('!'):
NotFlag = True
MacroName = MacroName[1:].strip()
if not MacroName.startswith('$(') or not MacroName.endswith(')'):
raise Warning("Macro name expected(Please use '$(%(Token)s)' if '%(Token)s' is a macro.)" % {"Token" : MacroName},
self.FileName, self.CurrentLineNumber)
MacroName = MacroName[2:-1]
return MacroName, NotFlag
## PreprocessFile() method ## PreprocessFile() method
# #
# Preprocess file contents, replace comments with spaces. # Preprocess file contents, replace comments with spaces.
@ -545,6 +560,7 @@ class FdfParser:
self.Rewind() self.Rewind()
## PreprocessIncludeFile() method ## PreprocessIncludeFile() method
# #
# Preprocess file contents, replace !include statements with file contents. # Preprocess file contents, replace !include statements with file contents.
@ -584,14 +600,7 @@ class FdfParser:
IfList.append([IfStartPos, None, None]) IfList.append([IfStartPos, None, None])
CondLabel = self.__Token CondLabel = self.__Token
if not self.__GetNextToken(): MacroName, NotFlag = self.__GetMacroName()
raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)
MacroName = self.__Token
NotFlag = False
if MacroName.startswith('!'):
NotFlag = True
MacroName = MacroName[1:]
NotDefineFlag = False NotDefineFlag = False
if CondLabel == '!ifndef': if CondLabel == '!ifndef':
NotDefineFlag = True NotDefineFlag = True
@ -645,14 +654,7 @@ class FdfParser:
self.__WipeOffArea.append((IfList[-1][0], ElseStartPos)) self.__WipeOffArea.append((IfList[-1][0], ElseStartPos))
IfList[-1] = [ElseStartPos, True, IfList[-1][2]] IfList[-1] = [ElseStartPos, True, IfList[-1][2]]
if self.__Token == '!elseif': if self.__Token == '!elseif':
if not self.__GetNextToken(): MacroName, NotFlag = self.__GetMacroName()
raise Warning("expected Macro name", self.FileName, self.CurrentLineNumber)
MacroName = self.__Token
NotFlag = False
if MacroName.startswith('!'):
NotFlag = True
MacroName = MacroName[1:]
if not self.__GetNextOp(): if not self.__GetNextOp():
raise Warning("expected !endif", self.FileName, self.CurrentLineNumber) raise Warning("expected !endif", self.FileName, self.CurrentLineNumber)

View File

@ -196,10 +196,8 @@ def main():
if (Options.outputDir): if (Options.outputDir):
OutputDirFromCommandLine = GenFdsGlobalVariable.ReplaceWorkspaceMacro(Options.outputDir) OutputDirFromCommandLine = GenFdsGlobalVariable.ReplaceWorkspaceMacro(Options.outputDir)
if not os.path.isabs (Options.outputDir): if not os.path.isabs (OutputDirFromCommandLine):
Options.outputDir = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, Options.outputDir) OutputDirFromCommandLine = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, OutputDirFromCommandLine)
if os.path.normcase (Options.outputDir).find(Workspace) != 0:
EdkLogger.error("GenFds", FILE_NOT_FOUND, "OutputDir doesn't exist in Workspace!")
for Arch in ArchList: for Arch in ArchList:
GenFdsGlobalVariable.OutputDirDict[Arch] = OutputDirFromCommandLine GenFdsGlobalVariable.OutputDirDict[Arch] = OutputDirFromCommandLine
else: else:

View File

@ -1,7 +1,7 @@
## @file ## @file
# This file is used to parse meta files # This file is used to parse meta files
# #
# Copyright (c) 2008, Intel Corporation # Copyright (c) 2008 - 2010, Intel Corporation
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # 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 # which accompanies this distribution. The full text of the license may be found at
@ -40,6 +40,28 @@ class MetaFileParser(object):
# data type (file content) for specific file type # data type (file content) for specific file type
DataType = {} DataType = {}
# Parser objects used to implement singleton
MetaFiles = {}
## Factory method
#
# One file, one parser object. This factory method makes sure that there's
# only one object constructed for one meta file.
#
# @param Class class object of real AutoGen class
# (InfParser, DecParser or DscParser)
# @param FilePath The path of meta file
# @param *args The specific class related parameters
# @param **kwargs The specific class related dict parameters
#
def __new__(Class, FilePath, *args, **kwargs):
if FilePath in Class.MetaFiles:
return Class.MetaFiles[FilePath]
else:
ParserObject = super(MetaFileParser, Class).__new__(Class)
Class.MetaFiles[FilePath] = ParserObject
return ParserObject
## Constructor of MetaFileParser ## Constructor of MetaFileParser
# #
# Initialize object of MetaFileParser # Initialize object of MetaFileParser
@ -52,6 +74,9 @@ class MetaFileParser(object):
# @param From ID from which the data comes (for !INCLUDE directive) # @param From ID from which the data comes (for !INCLUDE directive)
# #
def __init__(self, FilePath, FileType, Table, Macros=None, Owner=-1, From=-1): def __init__(self, FilePath, FileType, Table, Macros=None, Owner=-1, From=-1):
# prevent re-initialization
if hasattr(self, "_Table"):
return
self._Table = Table self._Table = Table
self._FileType = FileType self._FileType = FileType
self.MetaFile = FilePath self.MetaFile = FilePath
@ -596,6 +621,8 @@ class DscParser(MetaFileParser):
continue continue
self._CurrentLine = Line self._CurrentLine = Line
self._LineIndex = Index self._LineIndex = Index
if self._InSubsection and self._Owner == -1:
self._Owner = self._LastItem
# section header # section header
if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END: if Line[0] == TAB_SECTION_START and Line[-1] == TAB_SECTION_END:
@ -644,8 +671,6 @@ class DscParser(MetaFileParser):
if self._InSubsection: if self._InSubsection:
SectionType = self._SubsectionType SectionType = self._SubsectionType
SectionName = self._SubsectionName SectionName = self._SubsectionName
if self._Owner == -1:
self._Owner = self._LastItem
else: else:
SectionType = self._SectionType SectionType = self._SectionType
SectionName = self._SectionName SectionName = self._SectionName
@ -774,13 +799,24 @@ class DscParser(MetaFileParser):
else: else:
self._Enabled = len(self._Eval) self._Enabled = len(self._Eval)
## Evaludate the value of expression in "if/ifdef/ifndef" directives ## Evaluate the Token for its value; for now only macros are supported.
def _EvaluateToken(self, TokenName, Expression):
if TokenName.startswith("$(") and TokenName.endswith(")"):
Name = TokenName[2:-1]
return self._Macros.get(Name)
else:
EdkLogger.error('Parser', FORMAT_INVALID, "Unknown operand '%(Token)s', "
"please use '$(%(Token)s)' if '%(Token)s' is a macro" % {"Token" : TokenName},
File=self.MetaFile, Line=self._LineIndex+1, ExtraData=Expression)
## Evaluate the value of expression in "if/ifdef/ifndef" directives
def _Evaluate(self, Expression): def _Evaluate(self, Expression):
TokenList = Expression.split() TokenList = Expression.split()
TokenNumber = len(TokenList) TokenNumber = len(TokenList)
# one operand, guess it's just a macro name # one operand, guess it's just a macro name
if TokenNumber == 1: if TokenNumber == 1:
return TokenList[0] in self._Macros TokenValue = self._EvaluateToken(TokenList[0], Expression)
return TokenValue != None
# two operands, suppose it's "!xxx" format # two operands, suppose it's "!xxx" format
elif TokenNumber == 2: elif TokenNumber == 2:
Op = TokenList[0] Op = TokenList[0]
@ -794,8 +830,8 @@ class DscParser(MetaFileParser):
return self._OP_[Op](Value) return self._OP_[Op](Value)
# three operands # three operands
elif TokenNumber == 3: elif TokenNumber == 3:
Name = TokenList[0] TokenValue = self._EvaluateToken(TokenList[0], Expression)
if Name not in self._Macros: if TokenValue == None:
return False return False
Value = TokenList[2] Value = TokenList[2]
if Value[0] in ["'", '"'] and Value[-1] in ["'", '"']: if Value[0] in ["'", '"'] and Value[-1] in ["'", '"']:
@ -804,7 +840,7 @@ class DscParser(MetaFileParser):
if Op not in self._OP_: if Op not in self._OP_:
EdkLogger.error('Parser', FORMAT_INVALID, "Unsupported operator [%s]" % Op, File=self.MetaFile, EdkLogger.error('Parser', FORMAT_INVALID, "Unsupported operator [%s]" % Op, File=self.MetaFile,
Line=self._LineIndex+1, ExtraData=Expression) Line=self._LineIndex+1, ExtraData=Expression)
return self._OP_[Op](self._Macros[Name], Value) return self._OP_[Op](TokenValue, Value)
else: else:
EdkLogger.error('Parser', FORMAT_INVALID, File=self.MetaFile, Line=self._LineIndex+1, EdkLogger.error('Parser', FORMAT_INVALID, File=self.MetaFile, Line=self._LineIndex+1,
ExtraData=Expression) ExtraData=Expression)

View File

@ -667,31 +667,31 @@ class PcdReport(object):
if DecDefaultValue == None: if DecDefaultValue == None:
DecMatch = True DecMatch = True
else: else:
DecMatch = (DecDefaultValue == PcdValue) DecMatch = (DecDefaultValue.strip() == PcdValue.strip())
if InfDefaultValue == None: if InfDefaultValue == None:
InfMatch = True InfMatch = True
else: else:
InfMatch = (InfDefaultValue == PcdValue) InfMatch = (InfDefaultValue.strip() == PcdValue.strip())
if DscDefaultValue == None: if DscDefaultValue == None:
DscMatch = True DscMatch = True
else: else:
DscMatch = (DscDefaultValue == PcdValue) DscMatch = (DscDefaultValue.strip() == PcdValue.strip())
# #
# Report PCD item according to their override relationship # Report PCD item according to their override relationship
# #
if DecMatch and InfMatch: if DecMatch and InfMatch:
FileWrite(File, ' %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue)) FileWrite(File, ' %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
else: else:
if DscMatch: if DscMatch:
if (Pcd.TokenCName, Key) in self.FdfPcdSet: if (Pcd.TokenCName, Key) in self.FdfPcdSet:
FileWrite(File, ' *F %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue)) FileWrite(File, ' *F %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
else: else:
FileWrite(File, ' *P %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue)) FileWrite(File, ' *P %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
else: else:
FileWrite(File, ' *M %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue)) FileWrite(File, ' *M %-*s: %6s %10s = %-22s' % (self.MaxLen, Pcd.TokenCName, TypeName, '('+Pcd.DatumType+')', PcdValue.strip()))
if TypeName in ('DYNHII', 'DEXHII', 'DYNVPD', 'DEXVPD'): if TypeName in ('DYNHII', 'DEXHII', 'DYNVPD', 'DEXVPD'):
for SkuInfo in Pcd.SkuInfoList.values(): for SkuInfo in Pcd.SkuInfoList.values():
@ -701,13 +701,13 @@ class PcdReport(object):
FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset)) FileWrite(File, '%*s' % (self.MaxLen + 4, SkuInfo.VpdOffset))
if not DscMatch and DscDefaultValue != None: if not DscMatch and DscDefaultValue != None:
FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'DSC DEFAULT', DscDefaultValue)) FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'DSC DEFAULT', DscDefaultValue.strip()))
if not InfMatch and InfDefaultValue != None: if not InfMatch and InfDefaultValue != None:
FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'INF DEFAULT', InfDefaultValue)) FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'INF DEFAULT', InfDefaultValue.strip()))
if not DecMatch and DecDefaultValue != None: if not DecMatch and DecDefaultValue != None:
FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'DEC DEFAULT', DecDefaultValue)) FileWrite(File, ' %*s = %s' % (self.MaxLen + 19, 'DEC DEFAULT', DecDefaultValue.strip()))
if ModulePcdSet == None: if ModulePcdSet == None:
ModuleOverride = self.ModulePcdOverride.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName), {}) ModuleOverride = self.ModulePcdOverride.get((Pcd.TokenCName, Pcd.TokenSpaceGuidCName), {})
@ -717,10 +717,10 @@ class PcdReport(object):
ModulePcdDefaultValueNumber = int(ModuleDefault.strip(), 0) ModulePcdDefaultValueNumber = int(ModuleDefault.strip(), 0)
Match = (ModulePcdDefaultValueNumber == PcdValueNumber) Match = (ModulePcdDefaultValueNumber == PcdValueNumber)
else: else:
Match = (ModuleDefault == PcdValue) Match = (ModuleDefault.strip() == PcdValue.strip())
if Match: if Match:
continue continue
FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 19, ModulePath, ModuleDefault)) FileWrite(File, ' *M %-*s = %s' % (self.MaxLen + 19, ModulePath, ModuleDefault.strip()))
if ModulePcdSet == None: if ModulePcdSet == None:
FileWrite(File, gSectionEnd) FileWrite(File, gSectionEnd)
@ -1283,8 +1283,9 @@ class PlatformReport(object):
# #
# @param self The object pointer # @param self The object pointer
# @param Wa Workspace context information # @param Wa Workspace context information
# @param MaList The list of modules in the platform build
# #
def __init__(self, Wa, ReportType): def __init__(self, Wa, MaList, ReportType):
self._WorkspaceDir = Wa.WorkspaceDir self._WorkspaceDir = Wa.WorkspaceDir
self.PlatformName = Wa.Name self.PlatformName = Wa.Name
self.PlatformDscPath = Wa.Platform self.PlatformDscPath = Wa.Platform
@ -1299,7 +1300,7 @@ class PlatformReport(object):
self.PcdReport = PcdReport(Wa) self.PcdReport = PcdReport(Wa)
self.FdReportList = [] self.FdReportList = []
if "FLASH" in ReportType and Wa.FdfProfile: if "FLASH" in ReportType and Wa.FdfProfile and MaList == None:
for Fd in Wa.FdfProfile.FdDict: for Fd in Wa.FdfProfile.FdDict:
self.FdReportList.append(FdReport(Wa.FdfProfile.FdDict[Fd], Wa)) self.FdReportList.append(FdReport(Wa.FdfProfile.FdDict[Fd], Wa))
@ -1308,6 +1309,10 @@ class PlatformReport(object):
self.PredictionReport = PredictionReport(Wa) self.PredictionReport = PredictionReport(Wa)
self.ModuleReportList = [] self.ModuleReportList = []
if MaList != None:
for Ma in MaList:
self.ModuleReportList.append(ModuleReport(Ma, ReportType))
else:
for Pa in Wa.AutoGenObjectList: for Pa in Wa.AutoGenObjectList:
for ModuleKey in Pa.Platform.Modules: for ModuleKey in Pa.Platform.Modules:
self.ModuleReportList.append(ModuleReport(Pa.Platform.Modules[ModuleKey].M, ReportType)) self.ModuleReportList.append(ModuleReport(Pa.Platform.Modules[ModuleKey].M, ReportType))
@ -1386,10 +1391,11 @@ class BuildReport(object):
# #
# @param self The object pointer # @param self The object pointer
# @param Wa Workspace context information # @param Wa Workspace context information
# @param MaList The list of modules in the platform build
# #
def AddPlatformReport(self, Wa): def AddPlatformReport(self, Wa, MaList=None):
if self.ReportFile: if self.ReportFile:
self.ReportList.append(Wa) self.ReportList.append((Wa, MaList))
## ##
# Generates the final report. # Generates the final report.
@ -1407,8 +1413,8 @@ class BuildReport(object):
except IOError: except IOError:
EdkLogger.error(None, FILE_OPEN_FAILURE, ExtraData=self.ReportFile) EdkLogger.error(None, FILE_OPEN_FAILURE, ExtraData=self.ReportFile)
try: try:
for Wa in self.ReportList: for (Wa, MaList) in self.ReportList:
PlatformReport(Wa, self.ReportType).GenerateReport(File, BuildDuration, self.ReportType) PlatformReport(Wa, MaList, self.ReportType).GenerateReport(File, BuildDuration, self.ReportType)
EdkLogger.quiet("Report successfully saved to %s" % os.path.abspath(self.ReportFile)) EdkLogger.quiet("Report successfully saved to %s" % os.path.abspath(self.ReportFile))
except IOError: except IOError:
EdkLogger.error(None, FILE_WRITE_FAILURE, ExtraData=self.ReportFile) EdkLogger.error(None, FILE_WRITE_FAILURE, ExtraData=self.ReportFile)

View File

@ -738,6 +738,16 @@ class Build():
# parse target.txt, tools_def.txt, and platform file # parse target.txt, tools_def.txt, and platform file
#self.RestoreBuildData() #self.RestoreBuildData()
self.LoadConfiguration() self.LoadConfiguration()
#
# @attention Treat $(TARGET) in meta data files as special macro when it has only one build target.
# This is not a complete support for $(TARGET) macro as it can only support one build target in ONE
# invocation of build command. However, it should cover the frequent usage model that $(TARGET) macro
# is used in DSC files to specify different libraries & PCD setting for debug/release build.
#
if len(self.BuildTargetList) == 1:
self.Db._GlobalMacros.setdefault("TARGET", self.BuildTargetList[0])
self.InitBuild() self.InitBuild()
# print current build environment and configuration # print current build environment and configuration
@ -1336,7 +1346,6 @@ class Build():
self.FvList, self.FvList,
self.SkuId self.SkuId
) )
self.BuildReport.AddPlatformReport(Wa)
Wa.CreateMakeFile(False) Wa.CreateMakeFile(False)
self.Progress.Stop("done!") self.Progress.Stop("done!")
MaList = [] MaList = []
@ -1345,6 +1354,8 @@ class Build():
if Ma == None: continue if Ma == None: continue
MaList.append(Ma) MaList.append(Ma)
self._Build(self.Target, Ma) self._Build(self.Target, Ma)
self.BuildReport.AddPlatformReport(Wa, MaList)
if MaList == []: if MaList == []:
EdkLogger.error( EdkLogger.error(
'build', 'build',

View File

@ -225,10 +225,10 @@ class SourceFiles:
'mingw_hdr': { 'mingw_hdr': {
'url': 'http://sourceforge.net/projects/' + \ 'url': 'http://sourceforge.net/projects/' + \
'mingw-w64/files/mingw-w64/mingw-w64-snapshot/' + \ 'mingw-w64/files/mingw-w64/mingw-w64-snapshot/' + \
'mingw-w64-trunk-snapshot-$version.tar.bz2/download', 'mingw-w64-v1.0-snapshot-$version.tar.bz2/download',
'extract-dir': os.path.join('trunk', 'mingw-w64-headers'), 'extract-dir': os.path.join('mingw-w64-v1.0-$version', 'mingw-w64-headers'),
'version': '20091222', 'version': '20100223',
'md5': 'fbcf282d1a05df121088d775e02095d6', 'md5': '700b9f54e740b1b962c8a3a0f52b7c04',
}, },
} }