From 07b8564b113431f70ef4fcc469a42be5e4700263 Mon Sep 17 00:00:00 2001 From: Yingke Liu Date: Thu, 21 Aug 2014 07:12:33 +0000 Subject: [PATCH] AutoGen.c can only be generated if the module has intermediate object files generated or links other libraries. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15864 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 6 +++++- BaseTools/Source/Python/Common/DataType.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 6c9a4ffd2f..5dc2cfd7bd 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -2607,7 +2607,11 @@ class ModuleAutoGen(AutoGen): AutoGenH = TemplateString() StringH = TemplateString() GenC.CreateCode(self, AutoGenC, AutoGenH, StringH, UniStringAutoGenC, UniStringBinBuffer) - if str(AutoGenC) != "": + # + # AutoGen.c is generated if there are library classes in inf, or there are object files + # + if str(AutoGenC) != "" and (len(self.Module.LibraryClasses) > 0 + or TAB_OBJECT_FILE in self.FileTypes): AutoFile = PathClass(gAutoGenCodeFileName, self.DebugDir) self._AutoGenFileList[AutoFile] = str(AutoGenC) self._ApplyBuildRule(AutoFile, TAB_UNKNOWN_FILE) diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/Python/Common/DataType.py index cd420d168f..f1408569e0 100644 --- a/BaseTools/Source/Python/Common/DataType.py +++ b/BaseTools/Source/Python/Common/DataType.py @@ -468,6 +468,7 @@ TAB_UNICODE_FILE = "UNICODE-TEXT-FILE" TAB_DEPENDENCY_EXPRESSION_FILE = "DEPENDENCY-EXPRESSION-FILE" TAB_UNKNOWN_FILE = "UNKNOWN-TYPE-FILE" TAB_DEFAULT_BINARY_FILE = "_BINARY_FILE_" +TAB_OBJECT_FILE = "OBJECT-FILE" # used by BRG TAB_BRG_PCD = 'PCD' -- 2.39.2