?.dll\r
\r
<OutputFile>\r
- $(DEBUG_DIR)(+)$(MODULE_NAME).efi\r
+ $(OUTPUT_DIR)(+)$(MODULE_NAME).efi\r
\r
<Command.MSFT, Command.INTEL, Command.RVCT>\r
"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)\r
- $(CP) ${dst} $(OUTPUT_DIR)\r
+ $(CP) ${dst} $(DEBUG_DIR)\r
$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi\r
-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)\r
-$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR) \r
-$(CP) $(DEBUG_DIR)(+)$(MODULE_NAME).debug $(BIN_DIR)(+)$(MODULE_NAME_GUID).debug\r
\r
"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} ${src} $(GENFW_FLAGS)\r
- $(CP) ${dst} $(OUTPUT_DIR)\r
+ $(CP) ${dst} $(DEBUG_DIR)\r
$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi\r
-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)\r
\r
# create symbol file for GDB debug\r
-$(DSYMUTIL) ${src}\r
"$(GENFW)" -e $(MODULE_TYPE) -o ${dst} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff $(GENFW_FLAGS)\r
- $(CP) ${dst} $(OUTPUT_DIR)\r
+ $(CP) ${dst} $(DEBUG_DIR)\r
$(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi\r
-$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR)\r
\r
#include <sys/stat.h>\r
#endif\r
\r
+#ifdef __GNUC__\r
+#include <unistd.h>\r
+#endif\r
+\r
#include <stdio.h>\r
#include <stdlib.h>\r
#include <string.h>\r
128K,256K,512K,1M,2M,4M,8M,16M\n");\r
fprintf (stdout, " -i SectionFile, --sectionfile SectionFile\n\\r
Section file will be contained in this FFS file.\n");\r
+ fprintf (stdout, " -oi SectionFile, --optionalsectionfile SectionFile\n\\r
+ If the Section file exists, it will be contained in this FFS file, otherwise, it will be ignored.\n");\r
fprintf (stdout, " -n SectionAlign, --sectionalign SectionAlign\n\\r
SectionAlign points to section alignment, which support\n\\r
the alignment scope 0~16M. If SectionAlign is specified\n\\r
continue;\r
}\r
\r
- if ((stricmp (argv[0], "-i") == 0) || (stricmp (argv[0], "--sectionfile") == 0)) {\r
+ if ((stricmp (argv[0], "-oi") == 0) || (stricmp (argv[0], "--optionalsectionfile") == 0) || (stricmp (argv[0], "-i") == 0) || (stricmp (argv[0], "--sectionfile") == 0)) {\r
//\r
// Get Input file name and its alignment\r
//\r
Error (NULL, 0, 1003, "Invalid option value", "input section file is missing for -i option");\r
goto Finish;\r
}\r
-\r
+ if ((stricmp (argv[0], "-oi") == 0) || (stricmp (argv[0], "--optionalsectionfile") == 0) ){\r
+ if (-1 == access(argv[1] , 0)){\r
+ Warning(NULL, 0, 0001, "File is not found.", argv[1]);\r
+ argc -= 2;\r
+ argv += 2;\r
+ continue;\r
+ }\r
+ }\r
//\r
// Allocate Input file name buffer and its alignment buffer.\r
//\r
for index, Str in enumerate(FfsCmdList):\r
if '-o' == Str:\r
OutputFile = FfsCmdList[index + 1]\r
- if '-i' == Str:\r
+ if '-i' == Str or "-oi" == Str:\r
if DepsFileList == []:\r
DepsFileList = [FfsCmdList[index + 1]]\r
else:\r
from Common.Misc import PathClass\r
from Common.LongFilePathSupport import OpenLongFilePath as open\r
from Common.MultipleWorkspace import MultipleWorkspace as mws\r
+import Common.GlobalData as GlobalData\r
\r
## Global variables\r
#\r
\r
SaveFileOnChange(CommandFile, ' '.join(Cmd), False)\r
if IsMakefile:\r
+ if GlobalData.gGlobalDefines.get("FAMILY") == "MSFT":\r
+ Cmd = ['if', 'exist', Input[0]] + Cmd\r
+ else:\r
+ Cmd = ['test', '-e', Input[0], "&&"] + Cmd\r
if ' '.join(Cmd).strip() not in GenFdsGlobalVariable.SecCmdList:\r
GenFdsGlobalVariable.SecCmdList.append(' '.join(Cmd).strip())\r
elif GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]):\r
\r
Cmd += ("-o", Output)\r
for I in range(0, len(Input)):\r
- Cmd += ("-i", Input[I])\r
+ if MakefilePath:\r
+ Cmd += ("-oi", Input[I])\r
+ else:\r
+ Cmd += ("-i", Input[I])\r
if SectionAlign and SectionAlign[I]:\r
Cmd += ("-n", SectionAlign[I])\r
\r
@property\r
def Arch(self):\r
return self._Arch\r
+ @property\r
+ def Dir(self):\r
+ return self.MetaFile.Dir\r
\r
## Retrieve all information in [Defines] section\r
#\r
# Add ffs build to makefile\r
CmdListDict = {}\r
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:\r
- CmdListDict = self._GenFfsCmd()\r
+ CmdListDict = self._GenFfsCmd(Wa.ArchList)\r
\r
for Arch in Wa.ArchList:\r
GlobalData.gGlobalDefines['ARCH'] = Arch\r
# Add ffs build to makefile\r
CmdListDict = None\r
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:\r
- CmdListDict = self._GenFfsCmd()\r
+ CmdListDict = self._GenFfsCmd(Wa.ArchList)\r
self.Progress.Stop("done!")\r
MaList = []\r
ExitFlag = threading.Event()\r
#\r
self._SaveMapFile (MapBuffer, Wa)\r
\r
- def _GenFfsCmd(self):\r
+ def _GenFfsCmd(self,ArchList):\r
# convert dictionary of Cmd:(Inf,Arch)\r
# to a new dictionary of (Inf,Arch):Cmd,Cmd,Cmd...\r
CmdSetDict = defaultdict(set)\r
- GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, self.ArchList, GlobalData)\r
+ GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, ArchList, GlobalData)\r
for Cmd in GenFfsDict:\r
tmpInf, tmpArch = GenFfsDict[Cmd]\r
CmdSetDict[tmpInf, tmpArch].add(Cmd)\r
# Add ffs build to makefile\r
CmdListDict = None\r
if GlobalData.gEnableGenfdsMultiThread and self.Fdf:\r
- CmdListDict = self._GenFfsCmd()\r
+ CmdListDict = self._GenFfsCmd(Wa.ArchList)\r
\r
# multi-thread exit flag\r
ExitFlag = threading.Event()\r