{\r
static string ros_junk ( "$(ROS_TEMPORARY)" );\r
string targetName ( module.GetTargetName () );\r
- string target ( FixupTargetFilename (module.GetPath ()) );\r
+ string target ( FixupTargetFilename ( module.GetPath () ) );\r
string workingDirectory = GetWorkingDirectory ();\r
string junk_tmp = ros_junk + module.name + ".junk.tmp";\r
string objectsMacro = GetObjectsMacro ( module );\r
GenerateInvocations ( module );\r
}\r
\r
+void\r
+MingwIsoModuleHandler::OutputBootstrapfileCopyCommands ( const string bootcdDirectory,\r
+ const Module& module ) const\r
+{\r
+ for ( size_t i = 0; i < module.project.modules.size (); i++ )\r
+ {\r
+ const Module& m = *module.project.modules[i];\r
+ if ( m.bootstrap != NULL )\r
+ {\r
+ string targetFilenameNoFixup = bootcdDirectory + SSEP + m.bootstrap->base + SSEP + m.bootstrap->nameoncd;\r
+ string targetFilename = PassThruCacheDirectory ( FixupTargetFilename ( targetFilenameNoFixup ) );\r
+ fprintf ( fMakefile,\r
+ "\t${cp} %s %s\n",\r
+ m.GetPath ().c_str (),\r
+ targetFilename.c_str () );\r
+ }\r
+ }\r
+}\r
+\r
+string\r
+MingwIsoModuleHandler::GetCdDirectories ( const string bootcdDirectory,\r
+ const Module& module ) const\r
+{\r
+ string directories;\r
+ for ( size_t i = 0; i < module.project.modules.size (); i++ )\r
+ {\r
+ const Module& m = *module.project.modules[i];\r
+ if ( m.bootstrap != NULL )\r
+ {\r
+ string targetDirecctory = bootcdDirectory + SSEP + m.bootstrap->base;\r
+ if ( directories.size () > 0 )\r
+ directories += " ";\r
+ directories += FixupTargetFilename ( targetDirecctory );\r
+ }\r
+ }\r
+ return directories;\r
+}\r
+\r
void\r
MingwIsoModuleHandler::GenerateIsoModuleTarget ( const Module& module )\r
{\r
PassThruCacheDirectory ( bootcdReactos + SSEP );\r
string reactosInf = FixupTargetFilename ( bootcdReactosNoFixup + "/reactos.inf" );\r
string reactosDff = NormalizeFilename ( "bootdata/packages/reactos.dff" );\r
+ string cdDirectories = bootcdReactos + " " + GetCdDirectories ( bootcdDirectory,\r
+ module );\r
\r
fprintf ( fMakefile, ".PHONY: %s\n\n",\r
module.name.c_str ());\r
"%s: all %s %s\n",\r
module.name.c_str (),\r
isoboot.c_str (),\r
- bootcdReactos.c_str () );\r
+ cdDirectories.c_str () );\r
fprintf ( fMakefile,\r
"\t${cabman} /C %s /L %s /I\n",\r
reactosDff.c_str (),\r
fprintf ( fMakefile,\r
"\t- ${rm} %s\n",\r
reactosInf.c_str () );\r
+ OutputBootstrapfileCopyCommands ( bootcdDirectory,\r
+ module );\r
fprintf ( fMakefile,\r
"\t${cdmake} -v -m -b %s %s REACTOS ReactOS.iso\n",\r
isoboot.c_str (),\r
virtual void Process ( const Module& module );\r
private:\r
void GenerateIsoModuleTarget ( const Module& module );\r
+ std::string GetCdDirectories ( const std::string bootcdDirectory,\r
+ const Module& module ) const;\r
+ void OutputBootstrapfileCopyCommands ( const std::string bootcdDirectory,\r
+ const Module& module ) const;\r
};\r
\r
#endif /* MINGW_MODULEHANDLER_H */\r
--- /dev/null
+#include "pch.h"\r
+#include <assert.h>\r
+\r
+#include "rbuild.h"\r
+\r
+using std::string;\r
+\r
+Bootstrap::Bootstrap ( const Project& project_,\r
+ const Module* module_,\r
+ const XMLElement& bootstrapNode )\r
+ : project(project_),\r
+ module(module_),\r
+ node(bootstrapNode)\r
+{\r
+ Initialize();\r
+}\r
+\r
+Bootstrap::~Bootstrap ()\r
+{\r
+}\r
+\r
+bool\r
+Bootstrap::IsSupportedModuleType ( ModuleType type )\r
+{\r
+ switch ( type )\r
+ {\r
+ case Kernel:\r
+ case KernelModeDLL:\r
+ case NativeDLL:\r
+ case NativeCUI:\r
+ case Win32DLL:\r
+ case Win32CUI:\r
+ case Win32GUI:\r
+ case KernelModeDriver:\r
+ return true;\r
+ case BuildTool:\r
+ case StaticLibrary:\r
+ case ObjectLibrary:\r
+ case BootLoader:\r
+ case BootSector:\r
+ case Iso:\r
+ return false;\r
+ }\r
+ throw InvalidOperationException ( __FILE__,\r
+ __LINE__ );\r
+}\r
+\r
+void\r
+Bootstrap::Initialize ()\r
+{\r
+ if ( !IsSupportedModuleType ( module->type ) )\r
+ {\r
+ throw InvalidBuildFileException (\r
+ node.location,\r
+ "<bootstrap> is not applicable for this module type." );\r
+ }\r
+\r
+ const XMLAttribute* att = node.GetAttribute ( "base", false );\r
+ if ( att != NULL )\r
+ base = att->value;\r
+ else\r
+ base = "";\r
+\r
+ att = node.GetAttribute ( "nameoncd", false );\r
+ if ( att != NULL )\r
+ nameoncd = att->value;\r
+ else\r
+ nameoncd = module->GetTargetName ();\r
+}\r
+\r
+void\r
+Bootstrap::ProcessXML()\r
+{\r
+}\r
}\r
\r
void\r
-LinkerFlag::Initialize()\r
+LinkerFlag::Initialize ()\r
{\r
}\r
\r
void\r
-LinkerFlag::ProcessXML()\r
+LinkerFlag::ProcessXML ()\r
{\r
- if (node.value.size () == 0)\r
+ if ( node.value.size () == 0 )\r
{\r
throw InvalidBuildFileException (\r
node.location,\r
RBUILD_BASE_SOURCES = \\r
$(RBUILD_BACKEND_BASE_SOURCES) \\r
automaticdependency.cpp \\r
+ bootstrap.cpp \\r
compilerflag.cpp \\r
define.cpp \\r
exception.cpp \\r
const string& modulePath )\r
: project (project),\r
node (moduleNode),\r
- importLibrary (NULL)\r
+ importLibrary (NULL),\r
+ bootstrap (NULL)\r
{\r
if ( node.name != "module" )\r
throw Exception ( "internal tool error: Module created with non-<module> node" );\r
e.location,\r
"<property> is not a valid sub-element of <module>" );\r
}\r
+ else if ( e.name == "bootstrap" )\r
+ {\r
+ bootstrap = new Bootstrap ( project, this, e );\r
+ subs_invalid = true;\r
+ }\r
if ( subs_invalid && e.subElements.size() > 0 )\r
throw InvalidBuildFileException (\r
e.location,\r
class LinkerFlag;\r
class Property;\r
class AutomaticDependency;\r
+class Bootstrap;\r
\r
class SourceFileTest;\r
\r
ModuleType type;\r
ImportLibrary* importLibrary;\r
bool mangledSymbols;\r
+ Bootstrap* bootstrap;\r
std::vector<File*> files;\r
std::vector<Library*> libraries;\r
std::vector<Include*> includes;\r
};\r
\r
\r
+class Bootstrap\r
+{\r
+public:\r
+ const Project& project;\r
+ const Module* module;\r
+ const XMLElement& node;\r
+ std::string base;\r
+ std::string nameoncd;\r
+\r
+ Bootstrap ( const Project& project,\r
+ const Module* module,\r
+ const XMLElement& bootstrapNode );\r
+ ~Bootstrap ();\r
+ void ProcessXML();\r
+private:\r
+ bool IsSupportedModuleType ( ModuleType type );\r
+ void Initialize();\r
+};\r
+\r
+\r
extern std::string\r
FixSeparator ( const std::string& s );\r
\r
None.\r
\r
Elements:\r
- define, dependency, directory, file, if, importlibrary, include, invoke, library, property.\r
+ bootstrap, define, dependency, directory, file, if, importlibrary, include, invoke, library, property.\r
\r
\r
Module types\r
iso - Builds a bootable CD. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type.\r
\r
\r
+Bootstrap element\r
+-----------------\r
+A bootstrap element specifies that the generated file should be put on the bootable CD as a bootstrap file.\r
+\r
+Syntax:\r
+ <bootstrap base="reactos" nameoncd="halmp.dll" />\r
+\r
+Attributes:\r
+ base - Put file in this directory on the bootable CD. This attribute is optional.\r
+ nameoncd - Name of file on the bootable CD. This attribute is optional.\r
+\r
+Value:\r
+ None.\r
+\r
+Elements:\r
+ None.\r
+\r
+\r
Define element\r
--------------\r
A define element specifies the name and (optionally) value of a define for the C/C++ compiler and resource compiler.\r