X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FAutoGen%2FIncludesAutoGen.py;fp=BaseTools%2FSource%2FPython%2FAutoGen%2FIncludesAutoGen.py;h=ca9e02d19b4afad82241abb8e15845731cabd22f;hp=1ca1798907ef9b46a17d8938bb2f673d5ade662f;hb=818283de3f6d3b288deda54f0734be5bb70ddd5a;hpb=e465aae055258457e91ce2d3fef87d25507c5b24
diff --git a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
index 1ca1798907..ca9e02d19b 100644
--- a/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/IncludesAutoGen.py
@@ -2,6 +2,7 @@
# Build cache intermediate result and state
#
# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2020, ARM Limited. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
from Common.caching import cached_property
@@ -12,20 +13,6 @@ from Common.Misc import SaveFileOnChange, PathClass
from Common.Misc import TemplateString
import sys
gIsFileMap = {}
-if sys.platform == "win32":
- _INCLUDE_DEPS_TEMPLATE = TemplateString('''
-${BEGIN}
-!IF EXIST(${deps_file})
-!INCLUDE ${deps_file}
-!ENDIF
-${END}
- ''')
-else:
- _INCLUDE_DEPS_TEMPLATE = TemplateString('''
-${BEGIN}
--include ${deps_file}
-${END}
- ''')
DEP_FILE_TAIL = "# Updated \n"
@@ -59,6 +46,25 @@ class IncludesAutoGen():
def CreateDepsInclude(self):
deps_file = {'deps_file':self.deps_files}
+
+ MakePath = self.module_autogen.BuildOption.get('MAKE', {}).get('PATH')
+ if not MakePath:
+ EdkLogger.error("build", PARAMETER_MISSING, Message="No Make path available.")
+ elif "nmake" in MakePath:
+ _INCLUDE_DEPS_TEMPLATE = TemplateString('''
+ ${BEGIN}
+ !IF EXIST(${deps_file})
+ !INCLUDE ${deps_file}
+ !ENDIF
+ ${END}
+ ''')
+ else:
+ _INCLUDE_DEPS_TEMPLATE = TemplateString('''
+ ${BEGIN}
+ -include ${deps_file}
+ ${END}
+ ''')
+
try:
deps_include_str = _INCLUDE_DEPS_TEMPLATE.Replace(deps_file)
except Exception as e: