\r
using std::string;\r
using std::vector;\r
-using std::map;\r
-using std::set;\r
-\r
-typedef set<string> set_string;\r
\r
#define CLEAN_FILE(f) clean_files.push_back ( f ); /*if ( module.name == "crt" ) printf ( "%s(%i): clean: %s\n", __FILE__, __LINE__, f.c_str() )*/\r
\r
-map<ModuleType,MingwModuleHandler*>*\r
-MingwModuleHandler::handler_map = NULL;\r
-set_string\r
-MingwModuleHandler::directory_set;\r
-int\r
-MingwModuleHandler::ref = 0;\r
-\r
FILE*\r
MingwModuleHandler::fMakefile = NULL;\r
bool\r
return s;\r
}\r
\r
-MingwModuleHandler::MingwModuleHandler ( ModuleType moduletype )\r
+MingwModuleHandler::MingwModuleHandler ( ModuleType moduletype,\r
+ MingwBackend* backend_ )\r
+ : backend ( backend_ )\r
{\r
- if ( !ref++ )\r
- handler_map = new map<ModuleType,MingwModuleHandler*>;\r
- (*handler_map)[moduletype] = this;\r
}\r
\r
MingwModuleHandler::~MingwModuleHandler()\r
{\r
- if ( !--ref )\r
- {\r
- delete handler_map;\r
- handler_map = NULL;\r
- }\r
}\r
\r
const string &\r
-MingwModuleHandler::PassThruCacheDirectory ( const string &file ) const \r
+MingwModuleHandler::PassThruCacheDirectory ( const string &file )\r
{\r
- directory_set.insert ( GetDirectory ( file ) );\r
+ backend->CreateDirectoryTargetIfNotYetCreated ( GetDirectory ( file ) );\r
return file;\r
}\r
\r
+const string\r
+MingwModuleHandler::GetDirectoryDependency ( const string& file )\r
+{\r
+ return backend->GetDirectoryDependency ( GetDirectory ( file ) );\r
+}\r
+\r
void\r
MingwModuleHandler::SetMakefile ( FILE* f )\r
{\r
}\r
\r
MingwModuleHandler*\r
-MingwModuleHandler::LookupHandler ( const string& location,\r
- ModuleType moduletype )\r
-{\r
- if ( !handler_map )\r
- throw Exception ( "internal tool error: no registered module handlers" );\r
- MingwModuleHandler* h = (*handler_map)[moduletype];\r
- if ( !h )\r
- {\r
- throw UnknownModuleTypeException ( location, moduletype );\r
- return NULL;\r
- }\r
- return h;\r
+MingwModuleHandler::InstanciateHandler ( const string& location,\r
+ ModuleType moduletype,\r
+ MingwBackend* backend )\r
+{\r
+ MingwModuleHandler* handler;\r
+ switch ( moduletype )\r
+ {\r
+ case BuildTool:\r
+ handler = new MingwBuildToolModuleHandler ( backend );\r
+ break;\r
+ case StaticLibrary:\r
+ handler = new MingwStaticLibraryModuleHandler ( backend );\r
+ break;\r
+ case ObjectLibrary:\r
+ handler = new MingwObjectLibraryModuleHandler ( backend );\r
+ break;\r
+ case Kernel:\r
+ handler = new MingwKernelModuleHandler ( backend );\r
+ break;\r
+ case NativeCUI:\r
+ handler = new MingwNativeCUIModuleHandler ( backend );\r
+ break;\r
+ case Win32CUI:\r
+ handler = new MingwWin32CUIModuleHandler ( backend );\r
+ break;\r
+ case Win32GUI:\r
+ handler = new MingwWin32GUIModuleHandler ( backend );\r
+ break;\r
+ case KernelModeDLL:\r
+ handler = new MingwKernelModeDLLModuleHandler ( backend );\r
+ break;\r
+ case NativeDLL:\r
+ handler = new MingwNativeDLLModuleHandler ( backend );\r
+ break;\r
+ case Win32DLL:\r
+ handler = new MingwWin32DLLModuleHandler ( backend );\r
+ break;\r
+ case KernelModeDriver:\r
+ handler = new MingwKernelModeDriverModuleHandler ( backend );\r
+ break;\r
+ case BootLoader:\r
+ handler = new MingwBootLoaderModuleHandler ( backend );\r
+ break;\r
+ case BootSector:\r
+ handler = new MingwBootSectorModuleHandler ( backend );\r
+ break;\r
+ case Iso:\r
+ handler = new MingwIsoModuleHandler ( backend );\r
+ break;\r
+ }\r
+ return handler;\r
}\r
\r
string\r
}\r
\r
string\r
-MingwModuleHandler::GetImportLibraryDependency ( const Module& importedModule ) const\r
+MingwModuleHandler::GetImportLibraryDependency ( const Module& importedModule )\r
{\r
if ( importedModule.type == ObjectLibrary )\r
return GetObjectsMacro ( importedModule );\r
}\r
\r
string\r
-MingwModuleHandler::GetModuleDependencies ( const Module& module ) const\r
+MingwModuleHandler::GetModuleDependencies ( const Module& module )\r
{\r
if ( module.dependencies.size () == 0 )\r
return "";\r
}\r
\r
string\r
-MingwModuleHandler::GetObjectFilenames ( const Module& module ) const\r
+MingwModuleHandler::GetObjectFilenames ( const Module& module )\r
{\r
const vector<File*>& files = module.non_if_data.files;\r
if ( files.size () == 0 )\r
return objectFilenames;\r
}\r
\r
-bool\r
-MingwModuleHandler::IncludeDirectoryTarget ( const string& directory ) const\r
-{\r
- if ( directory == "$(ROS_INTERMEDIATE)." SSEP "tools")\r
- return false;\r
- else\r
- return true;\r
-}\r
-\r
-void\r
-MingwModuleHandler::GenerateDirectoryTargets () const\r
-{\r
- if ( directory_set.size () == 0 )\r
- return;\r
- \r
- set_string::iterator it;\r
- size_t wrap_count = 0;\r
-\r
- fprintf ( fMakefile, "ifneq ($(ROS_INTERMEDIATE),)\n" );\r
- fprintf ( fMakefile, "directories::" );\r
-\r
- for ( it = directory_set.begin ();\r
- it != directory_set.end ();\r
- it++ )\r
- {\r
- if ( IncludeDirectoryTarget ( *it ) )\r
- {\r
- if ( wrap_count++ == 5 )\r
- fprintf ( fMakefile, " \\\n\t\t" ), wrap_count = 0;\r
- fprintf ( fMakefile,\r
- " %s",\r
- it->c_str () );\r
- }\r
- }\r
-\r
- fprintf ( fMakefile, "\n\n" );\r
- wrap_count = 0;\r
-\r
- for ( it = directory_set.begin ();\r
- it != directory_set.end ();\r
- it++ )\r
- {\r
- if ( IncludeDirectoryTarget ( *it ) )\r
- {\r
- if ( wrap_count++ == 5 )\r
- fprintf ( fMakefile, " \\\n\t\t" ), wrap_count = 0;\r
- fprintf ( fMakefile,\r
- "%s ",\r
- it->c_str () );\r
- }\r
- }\r
-\r
- fprintf ( fMakefile, \r
- "::\n\t${mkdir} $@\n" );\r
- fprintf ( fMakefile, "endif\n\n" );\r
-\r
- directory_set.clear ();\r
-}\r
-\r
string\r
MingwModuleHandler::GenerateGccDefineParametersFromVector ( const vector<Define*>& defines ) const\r
{\r
\r
string\r
MingwModuleHandler::GenerateImportLibraryDependenciesFromVector (\r
- const vector<Library*>& libraries ) const\r
+ const vector<Library*>& libraries )\r
{\r
string dependencies ( "" );\r
int wrap_count = 0;\r
const char* assignmentOperation,\r
const string& macro,\r
const IfableData& data,\r
- const vector<CompilerFlag*>* compilerFlags ) const\r
+ const vector<CompilerFlag*>* compilerFlags )\r
{\r
size_t i;\r
\r
const string& linkerflags_macro,\r
const string& objs_macro,\r
const string& libs_macro,\r
- const string& linkdeps_macro ) const\r
+ const string& linkdeps_macro )\r
{\r
size_t i;\r
\r
const string& linkerflags_macro,\r
const string& objs_macro,\r
const string& libs_macro,\r
- const string& linkdeps_macro ) const\r
+ const string& linkdeps_macro )\r
{\r
GenerateMacros (\r
module,\r
MingwModuleHandler::GenerateGccCommand ( const Module& module,\r
const string& sourceFilename,\r
const string& cc,\r
- const string& cflagsMacro ) const\r
+ const string& cflagsMacro )\r
{\r
string deps = sourceFilename;\r
if ( module.pch && use_pch )\r
string objectFilename = PassThruCacheDirectory (\r
GetObjectFilename ( module, sourceFilename ) );\r
fprintf ( fMakefile,\r
- "%s: %s\n",\r
+ "%s: %s %s\n",\r
objectFilename.c_str (),\r
+ GetDirectoryDependency ( objectFilename ).c_str (),\r
deps.c_str () );\r
fprintf ( fMakefile, "\t$(ECHO_CC)\n" );\r
fprintf ( fMakefile,\r
MingwModuleHandler::GenerateGccAssemblerCommand ( const Module& module,\r
const string& sourceFilename,\r
const string& cc,\r
- const string& cflagsMacro ) const\r
+ const string& cflagsMacro )\r
{\r
string objectFilename = PassThruCacheDirectory (\r
GetObjectFilename ( module, sourceFilename ) );\r
fprintf ( fMakefile,\r
- "%s: %s\n",\r
+ "%s: %s %s\n",\r
objectFilename.c_str (),\r
+ GetDirectoryDependency ( objectFilename ).c_str (),\r
sourceFilename.c_str () );\r
fprintf ( fMakefile, "\t$(ECHO_GAS)\n" );\r
fprintf ( fMakefile,\r
void\r
MingwModuleHandler::GenerateNasmCommand ( const Module& module,\r
const string& sourceFilename,\r
- const string& nasmflagsMacro ) const\r
+ const string& nasmflagsMacro )\r
{\r
string objectFilename = PassThruCacheDirectory (\r
GetObjectFilename ( module, sourceFilename ) );\r
fprintf ( fMakefile,\r
- "%s: %s\n",\r
+ "%s: %s %s\n",\r
objectFilename.c_str (),\r
+ GetDirectoryDependency ( objectFilename ).c_str (),\r
sourceFilename.c_str () );\r
fprintf ( fMakefile, "\t$(ECHO_NASM)\n" );\r
fprintf ( fMakefile,\r
void\r
MingwModuleHandler::GenerateWindresCommand ( const Module& module,\r
const string& sourceFilename,\r
- const string& windresflagsMacro ) const\r
+ const string& windresflagsMacro )\r
{\r
string objectFilename = PassThruCacheDirectory ( \r
GetObjectFilename ( module, sourceFilename ) );\r
string resFilename = ReplaceExtension ( sourceFilename,\r
".res" );\r
fprintf ( fMakefile,\r
- "%s: %s $(WRC_TARGET)\n",\r
+ "%s: %s %s $(WRC_TARGET)\n",\r
objectFilename.c_str (),\r
+ GetDirectoryDependency ( objectFilename ).c_str (),\r
sourceFilename.c_str () );\r
fprintf ( fMakefile, "\t$(ECHO_WRC)\n" );\r
fprintf ( fMakefile,\r
const string& cflagsMacro,\r
const string& nasmflagsMacro,\r
const string& windresflagsMacro,\r
- string_list& clean_files ) const\r
+ string_list& clean_files )\r
{\r
CLEAN_FILE ( GetObjectFilename(module,sourceFilename) );\r
string extension = GetExtension ( sourceFilename );\r
const string& cflagsMacro,\r
const string& nasmflagsMacro,\r
const string& windresflagsMacro,\r
- string_list& clean_files ) const\r
+ string_list& clean_files )\r
{\r
size_t i;\r
\r
const string& cflagsMacro,\r
const string& nasmflagsMacro,\r
const string& windresflagsMacro,\r
- string_list& clean_files ) const\r
+ string_list& clean_files )\r
{\r
if ( module.pch )\r
{\r
const Module& module,\r
const string* cflags,\r
const string* nasmflags,\r
- string_list& clean_files ) const\r
+ string_list& clean_files )\r
{\r
string cc = ( module.host == HostTrue ? "${host_gcc}" : "${gcc}" );\r
string cppc = ( module.host == HostTrue ? "${host_gpp}" : "${gpp}" );\r
string linkDepsMacro = ssprintf ("%s_LINKDEPS", module.name.c_str ());\r
\r
GenerateMacros ( module,\r
- cflagsMacro,\r
- nasmflagsMacro,\r
- windresflagsMacro,\r
- linkerFlagsMacro,\r
- objectsMacro,\r
- libsMacro,\r
- linkDepsMacro );\r
+ cflagsMacro,\r
+ nasmflagsMacro,\r
+ windresflagsMacro,\r
+ linkerFlagsMacro,\r
+ objectsMacro,\r
+ libsMacro,\r
+ linkDepsMacro );\r
\r
if ( cflags != NULL )\r
{\r
}\r
\r
string\r
-MingwModuleHandler::GetInvocationDependencies ( const Module& module ) const\r
+MingwModuleHandler::GetInvocationDependencies ( const Module& module )\r
{\r
string dependencies;\r
for ( size_t i = 0; i < module.invocations.size (); i++ )\r
if ( module.type == BuildTool\r
|| module.name == "zlib"\r
|| module.name == "hostzlib" )\r
- return "$(ROS_INTERMEDIATE)." SSEP "tools $(ROS_INTERMEDIATE)." SSEP "lib" SSEP "zlib";\r
+ return "";\r
else\r
return "$(INIT)";\r
}\r
\r
void\r
-MingwModuleHandler::GeneratePreconditionDependencies ( const Module& module ) const\r
+MingwModuleHandler::GeneratePreconditionDependencies ( const Module& module )\r
{\r
string preconditionDependenciesName = GetPreconditionDependenciesName ( module );\r
string sourceFilenames = GetSourceFilenamesWithoutGeneratedFiles ( module );\r
void\r
MingwModuleHandler::GenerateImportLibraryTargetIfNeeded (\r
const Module& module,\r
- string_list& clean_files ) const\r
+ string_list& clean_files )\r
{\r
if ( module.importLibrary != NULL )\r
{\r
- string library_target = FixupTargetFilename( module.GetDependencyPath () ).c_str ();\r
+ string library_target = PassThruCacheDirectory ( FixupTargetFilename ( module.GetDependencyPath () ) ).c_str ();\r
CLEAN_FILE ( library_target );\r
\r
string definitionDependencies = GetDefinitionDependencies ( module );\r
- fprintf ( fMakefile, "%s: %s\n",\r
+ fprintf ( fMakefile, "%s: %s %s\n",\r
library_target.c_str (),\r
+ GetDirectoryDependency ( library_target ).c_str (),\r
definitionDependencies.c_str () );\r
\r
fprintf ( fMakefile, "\t$(ECHO_DLLTOOL)\n" );\r
}\r
\r
string\r
-MingwModuleHandler::GetDefinitionDependencies ( const Module& module ) const\r
+MingwModuleHandler::GetDefinitionDependencies ( const Module& module )\r
{\r
string dependencies;\r
string dkNkmLibNoFixup = "dk/nkm/lib";\r
}\r
\r
bool\r
-MingwModuleHandler::IsCPlusPlusModule ( const Module& module ) const\r
+MingwModuleHandler::IsCPlusPlusModule ( const Module& module )\r
{\r
return module.cplusplus;\r
}\r
\r
\r
-static MingwBuildToolModuleHandler buildtool_handler;\r
-\r
-MingwBuildToolModuleHandler::MingwBuildToolModuleHandler()\r
- : MingwModuleHandler ( BuildTool )\r
+MingwBuildToolModuleHandler::MingwBuildToolModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( BuildTool,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwKernelModuleHandler kernelmodule_handler;\r
-\r
-MingwKernelModuleHandler::MingwKernelModuleHandler ()\r
- : MingwModuleHandler ( Kernel )\r
+MingwKernelModuleHandler::MingwKernelModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( Kernel,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwStaticLibraryModuleHandler staticlibrary_handler;\r
-\r
-MingwStaticLibraryModuleHandler::MingwStaticLibraryModuleHandler ()\r
- : MingwModuleHandler ( StaticLibrary )\r
+MingwStaticLibraryModuleHandler::MingwStaticLibraryModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( StaticLibrary,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwObjectLibraryModuleHandler objectlibrary_handler;\r
-\r
-MingwObjectLibraryModuleHandler::MingwObjectLibraryModuleHandler ()\r
- : MingwModuleHandler ( ObjectLibrary )\r
+MingwObjectLibraryModuleHandler::MingwObjectLibraryModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( ObjectLibrary,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwKernelModeDLLModuleHandler kernelmodedll_handler;\r
-\r
-MingwKernelModeDLLModuleHandler::MingwKernelModeDLLModuleHandler ()\r
- : MingwModuleHandler ( KernelModeDLL )\r
+MingwKernelModeDLLModuleHandler::MingwKernelModeDLLModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( KernelModeDLL,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwKernelModeDriverModuleHandler kernelmodedriver_handler;\r
-\r
-MingwKernelModeDriverModuleHandler::MingwKernelModeDriverModuleHandler ()\r
- : MingwModuleHandler ( KernelModeDriver )\r
+MingwKernelModeDriverModuleHandler::MingwKernelModeDriverModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( KernelModeDriver,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwNativeDLLModuleHandler nativedll_handler;\r
-\r
-MingwNativeDLLModuleHandler::MingwNativeDLLModuleHandler ()\r
- : MingwModuleHandler ( NativeDLL )\r
+MingwNativeDLLModuleHandler::MingwNativeDLLModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( NativeDLL,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwNativeCUIModuleHandler nativecui_handler;\r
-\r
-MingwNativeCUIModuleHandler::MingwNativeCUIModuleHandler ()\r
- : MingwModuleHandler ( NativeCUI )\r
+MingwNativeCUIModuleHandler::MingwNativeCUIModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( NativeCUI,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwWin32DLLModuleHandler win32dll_handler;\r
-\r
-MingwWin32DLLModuleHandler::MingwWin32DLLModuleHandler ()\r
- : MingwModuleHandler ( Win32DLL )\r
+MingwWin32DLLModuleHandler::MingwWin32DLLModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( Win32DLL,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwWin32CUIModuleHandler win32cui_handler;\r
-\r
-MingwWin32CUIModuleHandler::MingwWin32CUIModuleHandler ()\r
- : MingwModuleHandler ( Win32CUI )\r
+MingwWin32CUIModuleHandler::MingwWin32CUIModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( Win32CUI,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwWin32GUIModuleHandler win32gui_handler;\r
-\r
-MingwWin32GUIModuleHandler::MingwWin32GUIModuleHandler ()\r
- : MingwModuleHandler ( Win32GUI )\r
+MingwWin32GUIModuleHandler::MingwWin32GUIModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( Win32GUI,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwBootLoaderModuleHandler bootloadermodule_handler;\r
-\r
-MingwBootLoaderModuleHandler::MingwBootLoaderModuleHandler ()\r
- : MingwModuleHandler ( BootLoader )\r
+MingwBootLoaderModuleHandler::MingwBootLoaderModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( BootLoader,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwBootSectorModuleHandler bootsectormodule_handler;\r
-\r
-MingwBootSectorModuleHandler::MingwBootSectorModuleHandler ()\r
- : MingwModuleHandler ( BootSector )\r
+MingwBootSectorModuleHandler::MingwBootSectorModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( BootSector,\r
+ backend )\r
{\r
}\r
\r
}\r
\r
\r
-static MingwIsoModuleHandler isomodule_handler;\r
-\r
-MingwIsoModuleHandler::MingwIsoModuleHandler ()\r
- : MingwModuleHandler ( Iso )\r
+MingwIsoModuleHandler::MingwIsoModuleHandler ( MingwBackend* backend )\r
+ : MingwModuleHandler ( Iso,\r
+ backend )\r
{\r
}\r
\r
\r
void\r
MingwIsoModuleHandler::OutputBootstrapfileCopyCommands ( const string& bootcdDirectory,\r
- const Module& module ) const\r
+ const Module& module )\r
{\r
for ( size_t i = 0; i < module.project.modules.size (); i++ )\r
{\r
\r
void\r
MingwIsoModuleHandler::OutputCdfileCopyCommands ( const string& bootcdDirectory,\r
- const Module& module ) const\r
+ const Module& module )\r
{\r
for ( size_t i = 0; i < module.project.cdfiles.size (); i++ )\r
{\r
\r
string\r
MingwIsoModuleHandler::GetBootstrapCdDirectories ( const string& bootcdDirectory,\r
- const Module& module ) const\r
+ const Module& module )\r
{\r
string directories;\r
for ( size_t i = 0; i < module.project.modules.size (); i++ )\r
string targetDirecctory = bootcdDirectory + SSEP + m.bootstrap->base;\r
if ( directories.size () > 0 )\r
directories += " ";\r
- directories += FixupTargetFilename ( targetDirecctory );\r
+ directories += GetDirectoryDependency ( PassThruCacheDirectory ( FixupTargetFilename ( targetDirecctory ) ) );\r
}\r
}\r
return directories;\r
\r
string\r
MingwIsoModuleHandler::GetNonModuleCdDirectories ( const string& bootcdDirectory,\r
- const Module& module ) const\r
+ const Module& module )\r
{\r
string directories;\r
for ( size_t i = 0; i < module.project.cdfiles.size (); i++ )\r
string targetDirecctory = bootcdDirectory + SSEP + cdfile.base;\r
if ( directories.size () > 0 )\r
directories += " ";\r
- directories += FixupTargetFilename ( targetDirecctory );\r
+ directories += GetDirectoryDependency ( PassThruCacheDirectory ( FixupTargetFilename ( targetDirecctory ) ) );\r
}\r
return directories;\r
}\r
\r
string\r
MingwIsoModuleHandler::GetCdDirectories ( const string& bootcdDirectory,\r
- const Module& module ) const\r
+ const Module& module )\r
{\r
string directories = GetBootstrapCdDirectories ( bootcdDirectory,\r
module );\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
+ string cdDirectories = GetCdDirectories ( bootcdDirectory,\r
module );\r
vector<string> vCdFiles;\r
GetCdFiles ( vCdFiles, module );\r
fprintf ( fMakefile, ".PHONY: %s\n\n",\r
module.name.c_str ());\r
fprintf ( fMakefile,\r
- "%s: all %s %s %s ${CABMAN_TARGET} ${CDMAKE_TARGET}\n",\r
+ "%s: all %s %s %s %s ${CABMAN_TARGET} ${CDMAKE_TARGET}\n",\r
module.name.c_str (),\r
isoboot.c_str (),\r
+ GetDirectoryDependency ( PassThruCacheDirectory ( bootcdReactos ) ).c_str (),\r
cdDirectories.c_str (),\r
cdFiles.c_str () );\r
fprintf ( fMakefile, "\t$(ECHO_CABMAN)\n" );\r
reactosDff.c_str (),\r
bootcdReactos.c_str () );\r
fprintf ( fMakefile,\r
- "\t${cabman} -C %s -RC %s -L %s -N\n",\r
+ "\t${cabman} -C %s -RC %s -L %s -N -P $(OUTPUT)\n",\r
reactosDff.c_str (),\r
reactosInf.c_str (),\r
- bootcdReactos.c_str () );\r
+ bootcdReactos.c_str ());\r
fprintf ( fMakefile,\r
"\t-@${rm} %s\n",\r
reactosInf.c_str () );\r
#define MINGW_MODULEHANDLER_H\r
\r
#include "../backend.h"\r
+#include "mingw.h"\r
\r
+class MingwBackend;\r
+ \r
extern std::string\r
ReplaceExtension ( const std::string& filename,\r
const std::string& newExtension );\r
{\r
public:\r
typedef std::vector<std::string> string_list;\r
-\r
- static std::map<ModuleType,MingwModuleHandler*>* handler_map;\r
- static int ref;\r
-\r
- MingwModuleHandler ( ModuleType moduletype );\r
+ MingwModuleHandler ( ModuleType moduletype,\r
+ MingwBackend* backend_ );\r
virtual ~MingwModuleHandler();\r
\r
static void SetMakefile ( FILE* f );\r
+ static MingwModuleHandler* InstanciateHandler ( const std::string& location,\r
+ ModuleType moduletype_,\r
+ MingwBackend* backend_ );\r
static void SetUsePch ( bool use_pch );\r
static MingwModuleHandler* LookupHandler ( const std::string& location,\r
ModuleType moduletype_ );\r
virtual HostType DefaultHost() = 0;\r
virtual void Process ( const Module& module, string_list& clean_files ) = 0;\r
- bool IncludeDirectoryTarget ( const std::string& directory ) const;\r
- void GenerateDirectoryTargets () const;\r
void GenerateCleanTarget ( const Module& module,\r
const string_list& clean_files ) const;\r
protected:\r
- const std::string &PassThruCacheDirectory ( const std::string &f ) const;\r
+ const std::string &PassThruCacheDirectory ( const std::string &f );\r
+ const std::string GetDirectoryDependency ( const std::string& file );\r
std::string GetWorkingDirectory () const;\r
std::string GetBasename ( const std::string& filename ) const;\r
std::string GetActualSourceFilename ( const std::string& filename ) const;\r
std::string GetModuleArchiveFilename ( const Module& module ) const;\r
bool IsGeneratedFile ( const File& file ) const;\r
- std::string GetImportLibraryDependency ( const Module& importedModule ) const;\r
- std::string GetModuleDependencies ( const Module& module ) const;\r
+ std::string GetImportLibraryDependency ( const Module& importedModule );\r
+ std::string GetModuleDependencies ( const Module& module );\r
std::string GetAllDependencies ( const Module& module ) const;\r
std::string GetSourceFilenames ( const Module& module,\r
bool includeGeneratedFiles ) const;\r
std::string GetSourceFilenames ( const Module& module ) const;\r
std::string GetSourceFilenamesWithoutGeneratedFiles ( const Module& module ) const;\r
\r
- std::string GetObjectFilenames ( const Module& module ) const;\r
- std::string GetInvocationDependencies ( const Module& module ) const;\r
+ std::string GetObjectFilenames ( const Module& module );\r
void GenerateInvocations ( const Module& module ) const;\r
\r
std::string GetPreconditionDependenciesName ( const Module& module ) const;\r
- void GeneratePreconditionDependencies ( const Module& module ) const;\r
+ void GeneratePreconditionDependencies ( const Module& module );\r
std::string GetCFlagsMacro ( const Module& module ) const;\r
std::string GetObjectsMacro ( const Module& module ) const;\r
std::string GetLinkingDependenciesMacro ( const Module& module ) const;\r
void GenerateMacrosAndTargets ( const Module& module,\r
const std::string* clags,\r
const std::string* nasmflags,\r
- string_list& clean_files ) const;\r
- void GenerateImportLibraryTargetIfNeeded ( const Module& module, string_list& clean_files ) const;\r
- std::string GetDefinitionDependencies ( const Module& module ) const;\r
+ string_list& clean_files );\r
+ void GenerateImportLibraryTargetIfNeeded ( const Module& module, string_list& clean_files );\r
+ std::string GetDefinitionDependencies ( const Module& module );\r
std::string GetLinkingDependencies ( const Module& module ) const;\r
- bool IsCPlusPlusModule ( const Module& module ) const;\r
- static FILE* fMakefile;\r
+ bool IsCPlusPlusModule ( const Module& module );\r
+ static FILE* fMakefile;\r
static bool use_pch;\r
- static std::set<std::string> directory_set;\r
private:\r
std::string ConcatenatePaths ( const std::string& path1,\r
const std::string& path2 ) const;\r
std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes ) const;\r
std::string GenerateCompilerParametersFromVector ( const std::vector<CompilerFlag*>& compilerFlags ) const;\r
std::string GenerateLinkerParametersFromVector ( const std::vector<LinkerFlag*>& linkerFlags ) const;\r
- std::string GenerateImportLibraryDependenciesFromVector ( const std::vector<Library*>& libraries ) const;\r
+ std::string GenerateImportLibraryDependenciesFromVector ( const std::vector<Library*>& libraries );\r
std::string GenerateLinkerParameters ( const Module& module ) const;\r
void GenerateMacro ( const char* assignmentOperation,\r
const std::string& macro,\r
const IfableData& data,\r
- const std::vector<CompilerFlag*>* compilerFlags ) const;\r
+ const std::vector<CompilerFlag*>* compilerFlags );\r
void GenerateMacros (\r
const Module& module,\r
const char* op,\r
const std::string& linkerflags_macro,\r
const std::string& objs_macro,\r
const std::string& libs_macro,\r
- const std::string& linkdeps_macro ) const;\r
+ const std::string& linkdeps_macro );\r
void GenerateMacros ( const Module& module,\r
const std::string& cflags_macro,\r
const std::string& nasmflags_macro,\r
const std::string& linkerflags_macro,\r
const std::string& objs_macro,\r
const std::string& libs_macro,\r
- const std::string& linkDepsMacro ) const;\r
+ const std::string& linkDepsMacro );\r
std::string GenerateGccIncludeParameters ( const Module& module ) const;\r
std::string GenerateGccParameters ( const Module& module ) const;\r
std::string GenerateNasmParameters ( const Module& module ) const;\r
void GenerateGccCommand ( const Module& module,\r
const std::string& sourceFilename,\r
const std::string& cc,\r
- const std::string& cflagsMacro ) const;\r
+ const std::string& cflagsMacro );\r
void GenerateGccAssemblerCommand ( const Module& module,\r
const std::string& sourceFilename,\r
const std::string& cc,\r
- const std::string& cflagsMacro ) const;\r
+ const std::string& cflagsMacro );\r
void GenerateNasmCommand ( const Module& module,\r
const std::string& sourceFilename,\r
- const std::string& nasmflagsMacro ) const;\r
+ const std::string& nasmflagsMacro );\r
void GenerateWindresCommand ( const Module& module,\r
const std::string& sourceFilename,\r
- const std::string& windresflagsMacro ) const;\r
+ const std::string& windresflagsMacro );\r
void GenerateWinebuildCommands ( const Module& module,\r
const std::string& sourceFilename,\r
string_list& clean_files ) const;\r
const std::string& cflagsMacro,\r
const std::string& nasmflagsMacro,\r
const std::string& windresflagsMacro,\r
- string_list& clean_files ) const;\r
+ string_list& clean_files );\r
void GenerateObjectFileTargets ( const Module& module,\r
const IfableData& data,\r
const std::string& cc,\r
const std::string& cflagsMacro,\r
const std::string& nasmflagsMacro,\r
const std::string& windresflagsMacro,\r
- string_list& clean_files ) const;\r
+ string_list& clean_files );\r
void GenerateObjectFileTargets ( const Module& module,\r
const std::string& cc,\r
const std::string& cppc,\r
const std::string& cflagsMacro,\r
const std::string& nasmflagsMacro,\r
const std::string& windresflagsMacro,\r
- string_list& clean_files ) const;\r
+ string_list& clean_files );\r
std::string GenerateArchiveTarget ( const Module& module,\r
const std::string& ar,\r
const std::string& objs_macro ) const;\r
std::string GetSpecObjectDependencies ( const std::string& filename ) const;\r
std::string GetDefaultDependencies ( const Module& module ) const;\r
+ std::string GetInvocationDependencies ( const Module& module );\r
+ MingwBackend* backend;\r
};\r
\r
\r
class MingwBuildToolModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwBuildToolModuleHandler ();\r
+ MingwBuildToolModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostTrue; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwKernelModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwKernelModuleHandler ();\r
+ MingwKernelModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwStaticLibraryModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwStaticLibraryModuleHandler ();\r
+ MingwStaticLibraryModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwObjectLibraryModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwObjectLibraryModuleHandler ();\r
+ MingwObjectLibraryModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwKernelModeDLLModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwKernelModeDLLModuleHandler ();\r
+ MingwKernelModeDLLModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwKernelModeDriverModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwKernelModeDriverModuleHandler ();\r
+ MingwKernelModeDriverModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwNativeDLLModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwNativeDLLModuleHandler ();\r
+ MingwNativeDLLModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwNativeCUIModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwNativeCUIModuleHandler ();\r
+ MingwNativeCUIModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwWin32DLLModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwWin32DLLModuleHandler ();\r
+ MingwWin32DLLModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwWin32CUIModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwWin32CUIModuleHandler ();\r
+ MingwWin32CUIModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwWin32GUIModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwWin32GUIModuleHandler ();\r
+ MingwWin32GUIModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwBootLoaderModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwBootLoaderModuleHandler ();\r
+ MingwBootLoaderModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwBootSectorModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwBootSectorModuleHandler ();\r
+ MingwBootSectorModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
class MingwIsoModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwIsoModuleHandler ();\r
+ MingwIsoModuleHandler ( MingwBackend* backend );\r
virtual HostType DefaultHost() { return HostFalse; }\r
virtual void Process ( const Module& module, string_list& clean_files );\r
private:\r
void GenerateIsoModuleTarget ( const Module& module, string_list& clean_files );\r
std::string GetBootstrapCdDirectories ( const std::string& bootcdDirectory,\r
- const Module& module ) const;\r
+ const Module& module );\r
std::string GetNonModuleCdDirectories ( const std::string& bootcdDirectory,\r
- const Module& module ) const;\r
+ const Module& module );\r
std::string GetCdDirectories ( const std::string& bootcdDirectory,\r
- const Module& module ) const;\r
+ const Module& module );\r
void GetBootstrapCdFiles ( std::vector<std::string>& out,\r
const Module& module ) const;\r
void GetNonModuleCdFiles ( std::vector<std::string>& out,\r
void GetCdFiles ( std::vector<std::string>& out,\r
const Module& module ) const;\r
void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory,\r
- const Module& module ) const;\r
+ const Module& module );\r
void OutputCdfileCopyCommands ( const std::string& bootcdDirectory,\r
- const Module& module ) const;\r
+ const Module& module );\r
};\r
\r
#endif /* MINGW_MODULEHANDLER_H */\r