From: Hervé Poussineau Date: Sun, 9 Aug 2009 22:03:04 +0000 (+0000) Subject: [rbuild] Remove distinction between Iso/IsoRegTest, and LiveIso/LiveIsoRegTest module... X-Git-Tag: ReactOS-0.3.11~1267 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=10692515b0f88c5f9ed2753190c460b14351c9cb [rbuild] Remove distinction between Iso/IsoRegTest, and LiveIso/LiveIsoRegTest module types Better dependency tracking for iso module type svn path=/trunk/; revision=42575 --- diff --git a/reactos/boot/bootdata/bootcdregtest/bootcdregtest.rbuild b/reactos/boot/bootdata/bootcdregtest/bootcdregtest.rbuild index 2ca7398f23c..f3b85391618 100644 --- a/reactos/boot/bootdata/bootcdregtest/bootcdregtest.rbuild +++ b/reactos/boot/bootdata/bootcdregtest/bootcdregtest.rbuild @@ -1,5 +1,6 @@ - + isobtrt + unattend.inf diff --git a/reactos/boot/bootdata/bootdata.rbuild b/reactos/boot/bootdata/bootdata.rbuild index 732da3f8348..205bcefc192 100644 --- a/reactos/boot/bootdata/bootdata.rbuild +++ b/reactos/boot/bootdata/bootdata.rbuild @@ -11,7 +11,7 @@ hivesft_$(ARCH).inf hivesys_$(ARCH).inf txtsetup.sif - unattend.inf + unattend.inf diff --git a/reactos/boot/bootdata/livecdregtest/livecdregtest.rbuild b/reactos/boot/bootdata/livecdregtest/livecdregtest.rbuild index 9ed5e2954ba..52836fabe65 100644 --- a/reactos/boot/bootdata/livecdregtest/livecdregtest.rbuild +++ b/reactos/boot/bootdata/livecdregtest/livecdregtest.rbuild @@ -1,5 +1,5 @@ - + isobtrt \ No newline at end of file diff --git a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp index 9648bc421e8..388f78541ce 100644 --- a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp +++ b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp @@ -317,9 +317,7 @@ CBBackend::_generate_workspace ( FILE* OUT ) Module& module = *p->second; if ((module.type != Iso) && - (module.type != LiveIso) && - (module.type != IsoRegTest) && - (module.type != LiveIsoRegTest)) + (module.type != LiveIso)) { std::string Cbp_file = CbpFileName ( module ); fprintf ( OUT, "\t\t\r\n", Cbp_file.c_str()); @@ -384,8 +382,6 @@ CBBackend::_generate_cbproj ( const Module& module ) { case Iso: case LiveIso: - case IsoRegTest: - case LiveIsoRegTest: return; default: break; diff --git a/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp b/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp index df6b23afb2f..18fa279679e 100644 --- a/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp +++ b/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp @@ -98,9 +98,7 @@ DepMapBackend::_generate_depmap ( FILE* OUT ) { Module& module = *p->second; if ((module.type != Iso) && - (module.type != LiveIso) && - (module.type != IsoRegTest) && - (module.type != LiveIsoRegTest)) + (module.type != LiveIso)) { vector ifs_list; ifs_list.push_back ( &module.project.non_if_data ); diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index 255dfe12ea8..951f5170d08 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -59,8 +59,6 @@ const struct ModuleHandlerInformations ModuleHandlerInformations[] = { { HostFalse, "", "", "" }, // Win32SCR { HostFalse, "", "", "" }, // IdlHeader { HostFalse, "", "", "" }, // IdlInterface - { HostFalse, "", "", "" }, // IsoRegTest - { HostFalse, "", "", "" }, // LiveIsoRegTest { HostFalse, "", "", "" }, // EmbeddedTypeLib { HostFalse, "", "", "" }, // ElfExecutable { HostFalse, "", "", "" }, // RpcProxy @@ -544,10 +542,6 @@ MingwBackend::IncludeInAllTarget ( const Module& module ) const return false; if ( module.type == LiveIso ) return false; - if ( module.type == IsoRegTest ) - return false; - if ( module.type == LiveIsoRegTest ) - return false; if ( module.type == Test ) return false; if ( module.type == Alias ) diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index e097127f08f..b1c70eb9560 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -234,12 +234,6 @@ MingwModuleHandler::InstanciateHandler ( case LiveIso: handler = new MingwLiveIsoModuleHandler ( module ); break; - case IsoRegTest: - handler = new MingwIsoModuleHandler ( module ); - break; - case LiveIsoRegTest: - handler = new MingwLiveIsoModuleHandler ( module ); - break; case Test: handler = new MingwTestModuleHandler ( module ); break; @@ -2973,7 +2967,8 @@ MingwIsoModuleHandler::Process () void MingwIsoModuleHandler::OutputBootstrapfileCopyCommands ( - const string& bootcdDirectory ) + const string& bootcdDirectory, + vector& destinations ) { for ( std::map::const_iterator p = module.project.modules.begin (); p != module.project.modules.end (); ++ p ) { @@ -2987,14 +2982,16 @@ MingwIsoModuleHandler::OutputBootstrapfileCopyCommands ( ? bootcdDirectory + sSep + m.bootstrap->base : bootcdDirectory, m.bootstrap->nameoncd ); - OutputCopyCommand ( *m.output, targetFile ); + OutputCopyCommandSingle ( *m.output, targetFile ); + destinations.push_back ( targetFile ); } } } void MingwIsoModuleHandler::OutputCdfileCopyCommands ( - const string& bootcdDirectory ) + const string& bootcdDirectory, + std::vector& destinations ) { for ( size_t i = 0; i < module.project.cdfiles.size (); i++ ) { @@ -3004,7 +3001,19 @@ MingwIsoModuleHandler::OutputCdfileCopyCommands ( ? bootcdDirectory + sSep + cdfile.target->relative_path : bootcdDirectory, cdfile.target->name ); - OutputCopyCommand ( *cdfile.source, targetFile ); + OutputCopyCommandSingle ( *cdfile.source, targetFile ); + destinations.push_back ( targetFile ); + } + for ( size_t i = 0; i < module.cdfiles.size (); i++ ) + { + const CDFile& cdfile = *module.cdfiles[i]; + FileLocation targetFile ( OutputDirectory, + cdfile.target->relative_path.length () > 0 + ? bootcdDirectory + sSep + cdfile.target->relative_path + : bootcdDirectory, + cdfile.target->name ); + OutputCopyCommandSingle ( *cdfile.source, targetFile ); + destinations.push_back ( targetFile ); } } @@ -3092,25 +3101,13 @@ void MingwIsoModuleHandler::GenerateIsoModuleTarget () { fprintf ( fMakefile, "# ISO MODULE TARGET\n" ); - string bootcdDirectory = "cd"; + string bootcdDirectory = module.name; FileLocation bootcd ( OutputDirectory, bootcdDirectory, "" ); FileLocation bootcdReactos ( OutputDirectory, bootcdDirectory + sSep + Environment::GetCdOutputPath (), "" ); - vector vSourceFiles, vCdFiles; - vector vCdDirectories; - - // unattend.inf - FileLocation srcunattend ( SourceDirectory, - "boot" + sSep + "bootdata" + sSep + "bootcdregtest", - "unattend.inf" ); - FileLocation tarunattend ( bootcdReactos.directory, - bootcdReactos.relative_path, - "unattend.inf" ); - if (module.type == IsoRegTest) - vSourceFiles.push_back ( srcunattend ); // bootsector const Module* bootModule = module.bootSector->bootSectorModule; @@ -3124,7 +3121,6 @@ MingwIsoModuleHandler::GenerateIsoModuleTarget () } const FileLocation *isoboot = bootModule->output; - vSourceFiles.push_back ( *isoboot ); // prepare reactos.dff and reactos.inf FileLocation reactosDff ( SourceDirectory, @@ -3134,31 +3130,18 @@ MingwIsoModuleHandler::GenerateIsoModuleTarget () bootcdReactos.relative_path, "reactos.inf" ); - vSourceFiles.push_back ( reactosDff ); - /* We use only the name and not full FileLocation(ouput) because Iso/LiveIso are an exception to the general rule. Iso/LiveIso outputs are generated in code base root */ string IsoName = module.output->name; - string sourceFiles = v2s ( backend, vSourceFiles, 5 ); - - // fill cdrom - GetCdDirectories ( vCdDirectories, bootcdDirectory ); - GetCdFiles ( vCdFiles ); - string cdDirectories = "";//v2s ( vCdDirectories, 5 ); - string cdFiles = v2s ( backend, vCdFiles, 5 ); - - fprintf ( fMakefile, ".PHONY: %s\n\n", - module.name.c_str ()); - fprintf ( fMakefile, - "%s: all %s %s %s $(CABMAN_TARGET) $(CDMAKE_TARGET) %s\n", + fprintf ( fMakefile, ".PHONY: %s_CABINET\n\n", + module.name.c_str () ); + fprintf ( fMakefile, "%s_CABINET: all $(CABMAN_TARGET) %s | %s\n", module.name.c_str (), - backend->GetFullName ( *isoboot ).c_str (), - sourceFiles.c_str (), - cdFiles.c_str (), - cdDirectories.c_str () ); + backend->GetFullName ( reactosDff ).c_str (), + backend->GetFullPath ( bootcdReactos ).c_str () ); fprintf ( fMakefile, "\t$(Q)$(CABMAN_TARGET) -C %s -L %s -I -P $(OUTPUT)\n", backend->GetFullName ( reactosDff ).c_str (), @@ -3169,13 +3152,29 @@ MingwIsoModuleHandler::GenerateIsoModuleTarget () backend->GetFullName ( reactosInf ).c_str (), backend->GetFullPath ( bootcdReactos ).c_str ()); fprintf ( fMakefile, - "\t-@${rm} %s 2>$(NUL)\n", + "\t-@${rm} %s 2>$(NUL)\n\n", backend->GetFullName ( reactosInf ).c_str () ); - OutputBootstrapfileCopyCommands ( bootcdDirectory ); - OutputCdfileCopyCommands ( bootcdDirectory ); - if (module.type == IsoRegTest) - OutputCopyCommand ( srcunattend, tarunattend ); + std::vector sourceFiles; + OutputBootstrapfileCopyCommands ( bootcdDirectory, sourceFiles ); + OutputCdfileCopyCommands ( bootcdDirectory, sourceFiles ); + + fprintf( fMakefile, + "\n%s_OBJS := %s\n\n", + module.name.c_str (), + v2s ( backend, sourceFiles, 5 ).c_str () ); + + fprintf ( fMakefile, ".PHONY: %s\n\n", + module.name.c_str ()); + fprintf ( fMakefile, + "%s: $(%s_OBJS) %s_CABINET %s $(CDMAKE_TARGET) | %s\n", + module.name.c_str (), + module.name.c_str (), + module.name.c_str (), + backend->GetFullName ( *isoboot ).c_str (), + backend->GetFullPath ( FileLocation ( OutputDirectory, + bootcdDirectory, + "" ) ).c_str () ); fprintf ( fMakefile, "\t$(ECHO_CDMAKE)\n" ); fprintf ( fMakefile, diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.h b/reactos/tools/rbuild/backend/mingw/modulehandler.h index 4fe32778893..6b8e9b5a4b8 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.h +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.h @@ -323,8 +323,10 @@ private: void GetBootstrapCdFiles ( std::vector& out ) const; void GetNonModuleCdFiles ( std::vector& out ) const; void GetCdFiles ( std::vector& out ) const; - void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory ); - void OutputCdfileCopyCommands ( const std::string& bootcdDirectory ); + void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory, + std::vector& destinations ); + void OutputCdfileCopyCommands ( const std::string& bootcdDirectory, + std::vector& destinations ); }; diff --git a/reactos/tools/rbuild/backend/versionreport/versionreport.cpp b/reactos/tools/rbuild/backend/versionreport/versionreport.cpp index e61af5f1c56..fcbba1de98b 100644 --- a/reactos/tools/rbuild/backend/versionreport/versionreport.cpp +++ b/reactos/tools/rbuild/backend/versionreport/versionreport.cpp @@ -96,9 +96,7 @@ VReportBackend::GenerateReport ( FILE* OUT ) { Module& module = *p->second; if ((module.type != Iso) && - (module.type != LiveIso) && - (module.type != IsoRegTest) && - (module.type != LiveIsoRegTest)) + (module.type != LiveIso)) { Module& module = *p->second; diff --git a/reactos/tools/rbuild/bootstrap.cpp b/reactos/tools/rbuild/bootstrap.cpp index 8be6f969f30..f71e09554ff 100644 --- a/reactos/tools/rbuild/bootstrap.cpp +++ b/reactos/tools/rbuild/bootstrap.cpp @@ -63,8 +63,6 @@ Bootstrap::IsSupportedModuleType ( ModuleType type ) case ObjectLibrary: case Iso: case LiveIso: - case IsoRegTest: - case LiveIsoRegTest: case Test: case RpcServer: case RpcClient: diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index af4b2530b18..d751eb86f40 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -525,6 +525,8 @@ Module::~Module () delete linkerFlags[i]; for ( i = 0; i < stubbedComponents.size(); i++ ) delete stubbedComponents[i]; + for ( i = 0; i < cdfiles.size (); i++ ) + delete cdfiles[i]; if ( linkerScript ) delete linkerScript; if ( pch ) @@ -917,6 +919,12 @@ Module::ProcessXMLSubElement ( const XMLElement& e, autoRegister = new AutoRegister ( project, this, e ); subs_invalid = true; } + else if ( e.name == "cdfile" ) + { + CDFile* cdfile = new CDFile ( project, e, subpath ); + cdfiles.push_back ( cdfile ); + subs_invalid = true; + } if ( subs_invalid && e.subElements.size() > 0 ) { throw XMLInvalidBuildFileException ( @@ -924,6 +932,8 @@ Module::ProcessXMLSubElement ( const XMLElement& e, "<%s> cannot have sub-elements", e.name.c_str() ); } + for ( size_t i = 0; i < cdfiles.size (); i++ ) + cdfiles[i]->ProcessXML (); for ( size_t i = 0; i < e.subElements.size (); i++ ) ProcessXMLSubElement ( *e.subElements[i], subdirectory, subpath, parseContext ); parseContext.compilationUnit = pOldCompilationUnit; @@ -972,10 +982,6 @@ Module::GetModuleType ( const string& location, const XMLAttribute& attribute ) return Iso; if ( attribute.value == "liveiso" ) return LiveIso; - if ( attribute.value == "isoregtest" ) - return IsoRegTest; - if ( attribute.value == "liveisoregtest" ) - return LiveIsoRegTest; if ( attribute.value == "test" ) return Test; if ( attribute.value == "rpcserver" ) @@ -1026,8 +1032,6 @@ Module::GetTargetDirectoryTree () const case BootProgram: case Iso: case LiveIso: - case IsoRegTest: - case LiveIsoRegTest: case ElfExecutable: case Cabinet: return OutputDirectory; @@ -1089,8 +1093,6 @@ Module::GetDefaultModuleExtension () const return ".o"; case Iso: case LiveIso: - case IsoRegTest: - case LiveIsoRegTest: return ".iso"; case Test: return ".exe"; @@ -1149,8 +1151,6 @@ Module::GetDefaultModuleEntrypoint () const case BootSector: case Iso: case LiveIso: - case IsoRegTest: - case LiveIsoRegTest: case RpcServer: case RpcClient: case RpcProxy: @@ -1202,8 +1202,6 @@ Module::GetDefaultModuleBaseaddress () const case BootSector: case Iso: case LiveIso: - case IsoRegTest: - case LiveIsoRegTest: case RpcServer: case RpcClient: case RpcProxy: @@ -1259,8 +1257,6 @@ Module::GetDefaultModuleCRT () const case BootSector: case Iso: case LiveIso: - case IsoRegTest: - case LiveIsoRegTest: case RpcServer: case RpcClient: case RpcProxy: @@ -1317,8 +1313,6 @@ Module::IsDLL () const case BootProgram: case Iso: case LiveIso: - case IsoRegTest: - case LiveIsoRegTest: case RpcServer: case RpcClient: case RpcProxy: @@ -1762,9 +1756,7 @@ bool Bootsector::IsSupportedModuleType ( ModuleType type ) { if ( type == Iso || - type == LiveIso || - type == IsoRegTest || - type == LiveIsoRegTest ) + type == LiveIso ) { return true; } diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 13baa2ef651..cb7e94c5d8d 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -315,8 +315,6 @@ enum ModuleType Win32SCR, IdlHeader, IdlInterface, - IsoRegTest, - LiveIsoRegTest, EmbeddedTypeLib, ElfExecutable, RpcProxy, @@ -392,6 +390,7 @@ public: std::vector compilerFlags; std::vector linkerFlags; std::vector stubbedComponents; + std::vector cdfiles; LinkerScript* linkerScript; PchFile* pch; bool cplusplus;