diff options
author | Yingke Liu <yingke.d.liu@intel.com> | 2015-06-10 07:50:59 +0000 |
---|---|---|
committer | yingke <yingke@Edk2> | 2015-06-10 07:50:59 +0000 |
commit | 867d1cd4cd7d2b4242a227067b3fce69546f0528 (patch) | |
tree | c2aff0a521aef5c19169e377141e0980261d838c /BaseTools/Source/Python/AutoGen | |
parent | 684fec3c964dd125160d47992413b3c95170f885 (diff) | |
download | edk2-platforms-867d1cd4cd7d2b4242a227067b3fce69546f0528.tar.xz |
BaseTools: Append FILE_GUID to BaseName.
This patch makes sure the EFI file in $(BIN_DIR) is unique. If there are modules with same BaseName, the FILE_GUID is appended.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yingke Liu <yingke.d.liu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17608 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/AutoGen')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/AutoGen.py | 15 | ||||
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenMake.py | 4 |
2 files changed, 19 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index b2d9f6a8ef..d1ed0a65ab 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -17,6 +17,7 @@ import Common.LongFilePathOs as os import re
import os.path as path
import copy
+import uuid
import GenC
import GenMake
@@ -2285,12 +2286,26 @@ class ModuleAutoGen(AutoGen): return self._FixedAtBuildPcds
+ def _GetUniqueBaseName(self):
+ BaseName = self.Name
+ for Module in self.PlatformInfo.ModuleAutoGenList:
+ if Module.MetaFile == self.MetaFile:
+ continue
+ if Module.Name == self.Name:
+ EdkLogger.warn('build', 'Modules have same BaseName:\n %s\n %s' % (Module.MetaFile, self.MetaFile))
+ if uuid.UUID(Module.Guid) == uuid.UUID(self.Guid):
+ EdkLogger.error("build", FILE_DUPLICATED, 'Modules have same BaseName and FILE_GUID:\n'
+ ' %s\n %s' % (Module.MetaFile, self.MetaFile))
+ BaseName = '%s_%s' % (self.Name, self.Guid)
+ return BaseName
+
# Macros could be used in build_rule.txt (also Makefile)
def _GetMacros(self):
if self._Macro == None:
self._Macro = sdict()
self._Macro["WORKSPACE" ] = self.WorkspaceDir
self._Macro["MODULE_NAME" ] = self.Name
+ self._Macro["MODULE_NAME_GUID" ] = self._GetUniqueBaseName()
self._Macro["MODULE_GUID" ] = self.Guid
self._Macro["MODULE_VERSION" ] = self.Version
self._Macro["MODULE_TYPE" ] = self.ModuleType
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index edbf243987..1d49a0316d 100644 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -241,6 +241,7 @@ PLATFORM_OUTPUT_DIR = ${platform_output_directory} #
MODULE_NAME = ${module_name}
MODULE_GUID = ${module_guid}
+MODULE_NAME_GUID = ${module_name_guid}
MODULE_VERSION = ${module_version}
MODULE_TYPE = ${module_type}
MODULE_FILE = ${module_file}
@@ -569,6 +570,7 @@ cleanlib: "module_name" : self._AutoGenObject.Name,
"module_guid" : self._AutoGenObject.Guid,
+ "module_name_guid" : self._AutoGenObject._GetUniqueBaseName(),
"module_version" : self._AutoGenObject.Version,
"module_type" : self._AutoGenObject.ModuleType,
"module_file" : self._AutoGenObject.MetaFile.Name,
@@ -846,6 +848,7 @@ PLATFORM_OUTPUT_DIR = ${platform_output_directory} #
MODULE_NAME = ${module_name}
MODULE_GUID = ${module_guid}
+MODULE_NAME_GUID = ${module_name_guid}
MODULE_VERSION = ${module_version}
MODULE_TYPE = ${module_type}
MODULE_FILE = ${module_file}
@@ -970,6 +973,7 @@ ${BEGIN}\t-@${create_directory_command}\n${END}\ "module_name" : self._AutoGenObject.Name,
"module_guid" : self._AutoGenObject.Guid,
+ "module_name_guid" : self._AutoGenObject._GetUniqueBaseName(),
"module_version" : self._AutoGenObject.Version,
"module_type" : self._AutoGenObject.ModuleType,
"module_file" : self._AutoGenObject.MetaFile,
|