[rbuild] Remove distinction between Iso/IsoRegTest, and LiveIso/LiveIsoRegTest module types

Better dependency tracking for iso module type

svn path=/trunk/; revision=42575
This commit is contained in:
Hervé Poussineau 2009-08-09 22:03:04 +00:00
parent 17db8cf603
commit 10692515b0
12 changed files with 69 additions and 92 deletions

View file

@ -1,5 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="bootcdregtest" type="isoregtest" output="ReactOS-RegTest.iso">
<module name="bootcdregtest" type="iso" output="ReactOS-RegTest.iso">
<bootsector>isobtrt</bootsector>
<cdfile installbase="$(CDOUTPUT)">unattend.inf</cdfile>
</module>

View file

@ -11,7 +11,7 @@
<cdfile installbase="$(CDOUTPUT)" nameoncd="hivesft.inf">hivesft_$(ARCH).inf</cdfile>
<cdfile installbase="$(CDOUTPUT)" nameoncd="hivesys.inf">hivesys_$(ARCH).inf</cdfile>
<cdfile installbase="$(CDOUTPUT)">txtsetup.sif</cdfile>
<cdfile installbase="$(CDOUTPUT)">unattend.inf</cdfile>
<cdfile installbase="$(CDOUTPUT)" nameoncd="unattend.inf.sample">unattend.inf</cdfile>
<directory name="bootcd">
<xi:include href="bootcd/bootcd.rbuild" />

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="livecdregtest" type="liveisoregtest" output="ReactOS-LiveCD-RegTest.iso">
<module name="livecdregtest" type="liveiso" output="ReactOS-LiveCD-RegTest.iso">
<bootsector>isobtrt</bootsector>
</module>

View file

@ -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<Project filename=\"%s\">\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;

View file

@ -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<const IfableData*> ifs_list;
ifs_list.push_back ( &module.project.non_if_data );

View file

@ -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 )

View file

@ -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<FileLocation>& destinations )
{
for ( std::map<std::string, Module*>::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<FileLocation>& 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<FileLocation> vSourceFiles, vCdFiles;
vector<FileLocation> 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<FileLocation> 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,

View file

@ -323,8 +323,10 @@ private:
void GetBootstrapCdFiles ( std::vector<FileLocation>& out ) const;
void GetNonModuleCdFiles ( std::vector<FileLocation>& out ) const;
void GetCdFiles ( std::vector<FileLocation>& out ) const;
void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory );
void OutputCdfileCopyCommands ( const std::string& bootcdDirectory );
void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory,
std::vector<FileLocation>& destinations );
void OutputCdfileCopyCommands ( const std::string& bootcdDirectory,
std::vector<FileLocation>& destinations );
};

View file

@ -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;

View file

@ -63,8 +63,6 @@ Bootstrap::IsSupportedModuleType ( ModuleType type )
case ObjectLibrary:
case Iso:
case LiveIso:
case IsoRegTest:
case LiveIsoRegTest:
case Test:
case RpcServer:
case RpcClient:

View file

@ -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;
}

View file

@ -315,8 +315,6 @@ enum ModuleType
Win32SCR,
IdlHeader,
IdlInterface,
IsoRegTest,
LiveIsoRegTest,
EmbeddedTypeLib,
ElfExecutable,
RpcProxy,
@ -392,6 +390,7 @@ public:
std::vector<CompilerFlag*> compilerFlags;
std::vector<LinkerFlag*> linkerFlags;
std::vector<StubbedComponent*> stubbedComponents;
std::vector<CDFile*> cdfiles;
LinkerScript* linkerScript;
PchFile* pch;
bool cplusplus;