NewRespStr = ' '.join(NewStr)\r
SaveFileOnChange(RespFile, NewRespStr, False)\r
ToolsDef.append("%s = %s" % (Resp, UnexpandMacroStr + ' @' + RespFile))\r
- RespFileListContent += '@' + RespFile + os.linesep\r
- RespFileListContent += NewRespStr + os.linesep\r
+ RespFileListContent += '@' + RespFile + TAB_LINE_BREAK\r
+ RespFileListContent += NewRespStr + TAB_LINE_BREAK\r
SaveFileOnChange(RespFileList, RespFileListContent, False)\r
else:\r
if os.path.exists(RespFileList):\r
"separator" : Separator,\r
"module_tool_definitions" : ToolsDef,\r
\r
- "shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),\r
- "shell_command" : self._SHELL_CMD_[self._FileType].values(),\r
+ "shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),\r
+ "shell_command" : list(self._SHELL_CMD_[self._FileType].values()),\r
\r
"module_entry_point" : ModuleEntryPoint,\r
"image_entry_point" : ImageEntryPoint,\r
NewFile = self.PlaceMacro(str(F), self.Macros)\r
# In order to use file list macro as dependency\r
if T.GenListFile:\r
- # gnu tools need forward slash path separater, even on Windows\r
+ # gnu tools need forward slash path separator, even on Windows\r
self.ListFileMacros[T.ListFileMacro].append(str(F).replace ('\\', '/'))\r
self.FileListMacros[T.FileListMacro].append(NewFile)\r
elif T.GenFileListMacro:\r
## Find dependencies for one source file\r
#\r
# By searching recursively "#include" directive in file, find out all the\r
- # files needed by given source file. The dependecies will be only searched\r
+ # files needed by given source file. The dependencies will be only searched\r
# in given search path list.\r
#\r
# @param File The source file\r
CurrentFileDependencyList = DepDb[F]\r
else:\r
try:\r
- Fd = open(F.Path, 'r')\r
+ Fd = open(F.Path, 'rb')\r
+ FileContent = Fd.read()\r
+ Fd.close()\r
except BaseException as X:\r
EdkLogger.error("build", FILE_OPEN_FAILURE, ExtraData=F.Path + "\n\t" + str(X))\r
-\r
- FileContent = Fd.read()\r
- Fd.close()\r
if len(FileContent) == 0:\r
continue\r
\r
if FileContent[0] == 0xff or FileContent[0] == 0xfe:\r
- FileContent = unicode(FileContent, "utf-16")\r
+ FileContent = FileContent.decode('utf-16')\r
+ else:\r
+ try:\r
+ FileContent = str(FileContent)\r
+ except:\r
+ pass\r
IncludedFileList = gIncludePattern.findall(FileContent)\r
\r
for Inc in IncludedFileList:\r
"separator" : Separator,\r
"module_tool_definitions" : ToolsDef,\r
\r
- "shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),\r
- "shell_command" : self._SHELL_CMD_[self._FileType].values(),\r
+ "shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),\r
+ "shell_command" : list(self._SHELL_CMD_[self._FileType].values()),\r
\r
"create_directory_command" : self.GetCreateDirectoryCommand(self.IntermediateDirectoryList),\r
"custom_makefile_content" : CustomMakefile\r
\r
"toolchain_tag" : MyAgo.ToolChain,\r
"build_target" : MyAgo.BuildTarget,\r
- "shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),\r
- "shell_command" : self._SHELL_CMD_[self._FileType].values(),\r
+ "shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),\r
+ "shell_command" : list(self._SHELL_CMD_[self._FileType].values()),\r
"build_architecture_list" : MyAgo.Arch,\r
"architecture" : MyAgo.Arch,\r
"separator" : Separator,\r
\r
"toolchain_tag" : MyAgo.ToolChain,\r
"build_target" : MyAgo.BuildTarget,\r
- "shell_command_code" : self._SHELL_CMD_[self._FileType].keys(),\r
- "shell_command" : self._SHELL_CMD_[self._FileType].values(),\r
+ "shell_command_code" : list(self._SHELL_CMD_[self._FileType].keys()),\r
+ "shell_command" : list(self._SHELL_CMD_[self._FileType].values()),\r
'arch' : list(MyAgo.ArchList),\r
"build_architecture_list" : ','.join(MyAgo.ArchList),\r
"separator" : Separator,\r