]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools: not include the undefined macro in response file
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / AutoGen.py
index c7aa84fb342e02e47a5694a0758e35f58ff76754..e9e46c29d73e719a221de4bc8ac48b71f254729b 100644 (file)
@@ -2378,6 +2378,7 @@ class ModuleAutoGen(AutoGen):
         self._MakeFileDir     = None\r
 \r
         self._IncludePathList = None\r
+        self._IncludePathLength = 0\r
         self._AutoGenFileList = None\r
         self._UnicodeFileList = None\r
         self._SourceFileList  = None\r
@@ -2479,6 +2480,12 @@ class ModuleAutoGen(AutoGen):
             self._Macro["DEBUG_DIR"             ] = self.DebugDir\r
             self._Macro["DEST_DIR_OUTPUT"       ] = self.OutputDir\r
             self._Macro["DEST_DIR_DEBUG"        ] = self.DebugDir\r
+            self._Macro["PLATFORM_NAME"         ] = self.PlatformInfo.Name\r
+            self._Macro["PLATFORM_GUID"         ] = self.PlatformInfo.Guid\r
+            self._Macro["PLATFORM_VERSION"      ] = self.PlatformInfo.Version\r
+            self._Macro["PLATFORM_RELATIVE_DIR" ] = self.PlatformInfo.SourceDir\r
+            self._Macro["PLATFORM_DIR"          ] = mws.join(self.WorkspaceDir, self.PlatformInfo.SourceDir)\r
+            self._Macro["PLATFORM_OUTPUT_DIR"   ] = self.PlatformInfo.OutputDir\r
         return self._Macro\r
 \r
     ## Return the module build data object\r
@@ -3224,6 +3231,13 @@ class ModuleAutoGen(AutoGen):
                         self._IncludePathList.append(str(Inc))\r
         return self._IncludePathList\r
 \r
+    def _GetIncludePathLength(self):\r
+        self._IncludePathLength = 0\r
+        if self._IncludePathList:\r
+            for inc in self._IncludePathList:\r
+                self._IncludePathLength += len(' ' + inc)\r
+        return self._IncludePathLength\r
+\r
     ## Get HII EX PCDs which maybe used by VFR\r
     #\r
     #  efivarstore used by VFR may relate with HII EX PCDs\r
@@ -3816,6 +3830,7 @@ class ModuleAutoGen(AutoGen):
     CustomMakefile  = property(_GetCustomMakefile)\r
 \r
     IncludePathList = property(_GetIncludePathList)\r
+    IncludePathLength = property(_GetIncludePathLength)\r
     AutoGenFileList = property(_GetAutoGenFileList)\r
     UnicodeFileList = property(_GetUnicodeFileList)\r
     SourceFileList  = property(_GetSourceFileList)\r