IncludePath = self._INC_FLAG_['NASM'] + self.PlaceMacro(P, self.Macros)\r
if IncludePath.endswith(os.sep):\r
IncludePath = IncludePath.rstrip(os.sep)\r
- # When compiling .nasm files, need to add a literal backslash at each path\r
- # To specify a literal backslash at the end of the line, precede it with a caret (^)\r
- if P == MyAgo.IncludePathList[-1] and os.sep == '\\':\r
+ # When compiling .nasm files, need to add a literal backslash at each path.\r
+ # In nmake makfiles, a trailing literal backslash must be escaped with a caret ('^').\r
+ # It is otherwise replaced with a space (' '). This is not necessary for GNU makfefiles.\r
+ if P == MyAgo.IncludePathList[-1] and self._Platform == WIN32_PLATFORM and self._FileType == NMAKE_FILETYPE:\r
IncludePath = ''.join([IncludePath, '^', os.sep])\r
else:\r
IncludePath = os.path.join(IncludePath, '')\r