Some rbuild cleanup:

- Move AutoRegister class to its own file
- Add an enum to replace strings "$(OUTPUT)", "$(INTERMEDIATE)"..., except when writing them to makefile.auto
- Add the FileLocation class to identify a file (root dir, relative path and name)
- Use it to simplify CDFile and InstallFile classes
- Use the FileLocation class when possible
This leads also to good things which were unexpected, like not creating unneeded directories in output directory, removal of some hardcoded strings and a few fixusp in the generated makefile.auto

svn path=/trunk/; revision=28924
This commit is contained in:
Hervé Poussineau 2007-09-07 14:59:23 +00:00
parent 51a42b98f3
commit b1a07a3e6b
17 changed files with 1070 additions and 897 deletions

View file

@ -320,7 +320,10 @@ AutomaticDependency::GetModuleFiles ( const Module& module,
/* FIXME: Collect files in IFs here */ /* FIXME: Collect files in IFs here */
if ( module.pch != NULL ) if ( module.pch != NULL )
files.push_back ( &module.pch->file ); {
File *file = new File ( module.pch->file.relative_path + sSep + module.pch->file.name , false, "", true );
files.push_back ( file );
}
} }
void void

View file

@ -0,0 +1,88 @@
/*
* Copyright (C) 2005 Casper S. Hornstrup
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "pch.h"
#include "rbuild.h"
using std::string;
AutoRegister::AutoRegister ( const Project& project_,
const Module* module_,
const XMLElement& node_ )
: XmlNode(project_, node_),
module(module_)
{
Initialize();
}
bool
AutoRegister::IsSupportedModuleType ( ModuleType type )
{
if ( type == Win32DLL ||
type == Win32OCX )
{
return true;
}
else
{
return false;
}
}
AutoRegisterType
AutoRegister::GetAutoRegisterType( const string& type )
{
if ( type == "DllRegisterServer" )
return DllRegisterServer;
if ( type == "DllInstall" )
return DllInstall;
if ( type == "Both" )
return Both;
throw XMLInvalidBuildFileException (
node.location,
"<autoregister> type attribute must be DllRegisterServer, DllInstall or Both." );
}
void
AutoRegister::Initialize ()
{
if ( !IsSupportedModuleType ( module->type ) )
{
throw XMLInvalidBuildFileException (
node.location,
"<autoregister> is not applicable for this module type." );
}
const XMLAttribute* att = node.GetAttribute ( "infsection", true );
if ( !att )
{
throw XMLInvalidBuildFileException (
node.location,
"<autoregister> must have a 'infsection' attribute." );
}
infSection = att->value;
att = node.GetAttribute ( "type", true );
if ( !att )
{
throw XMLInvalidBuildFileException (
node.location,
"<autoregister> must have a 'type' attribute." );
}
type = GetAutoRegisterType ( att->value );
}

View file

@ -34,6 +34,104 @@ using std::map;
typedef set<string> set_string; typedef set<string> set_string;
string
strDirectory ( const FileLocation *file )
{
MingwModuleHandler::PassThruCacheDirectory ( file );
string directory;
switch ( file->directory )
{
case SourceDirectory:
directory = "";
break;
case IntermediateDirectory:
directory = "$(INTERMEDIATE)";
break;
case OutputDirectory:
directory = "$(OUTPUT)";
break;
case InstallDirectory:
directory = "$(INSTALL)";
break;
case TemporaryDirectory:
directory = "$(TEMPORARY)";
break;
default:
throw InvalidOperationException ( __FILE__,
__LINE__,
"Invalid directory." );
}
if ( file->relative_path.length () > 0 )
{
if ( directory.length () > 0 )
directory += sSep;
directory += file->relative_path;
}
return directory;
}
string
strFile ( const FileLocation *file )
{
string directory;
switch ( file->directory )
{
case SourceDirectory:
directory = "";
break;
case IntermediateDirectory:
directory = "$(INTERMEDIATE)";
break;
case OutputDirectory:
directory = "$(OUTPUT)";
break;
case InstallDirectory:
directory = "$(INSTALL)";
break;
case TemporaryDirectory:
directory = "$(TEMPORARY)";
break;
default:
throw InvalidOperationException ( __FILE__,
__LINE__,
"Invalid directory." );
}
if ( file->relative_path.length () > 0 )
{
if ( directory.length () > 0 )
directory += sSep;
directory += file->relative_path;
}
if ( directory.length () > 0 )
directory += sSep;
return directory + file->name;
}
string
v2s ( const vector<FileLocation>& files, int wrap_at )
{
if ( !files.size() )
return "";
string s;
int wrap_count = 0;
for ( size_t i = 0; i < files.size(); i++ )
{
const FileLocation& file = files[i];
if ( wrap_at > 0 && wrap_count++ == wrap_at )
s += " \\\n\t\t";
else if ( s.size() )
s += " ";
s += strFile ( &file );
}
return s;
}
string string
v2s ( const string_list& v, int wrap_at ) v2s ( const string_list& v, int wrap_at )
@ -1049,22 +1147,18 @@ MingwBackend::DetectPCHSupport ()
void void
MingwBackend::GetNonModuleInstallTargetFiles ( MingwBackend::GetNonModuleInstallTargetFiles (
vector<string>& out ) const vector<FileLocation>& out ) const
{ {
for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ ) for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ )
{ {
const InstallFile& installfile = *ProjectNode.installfiles[i]; const InstallFile& installfile = *ProjectNode.installfiles[i];
string targetFilenameNoFixup = installfile.base + sSep + installfile.newname; out.push_back ( *installfile.target );
string targetFilename = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( targetFilenameNoFixup ),
installDirectory );
out.push_back ( targetFilename );
} }
} }
void void
MingwBackend::GetModuleInstallTargetFiles ( MingwBackend::GetModuleInstallTargetFiles (
vector<string>& out ) const vector<FileLocation>& out ) const
{ {
for ( size_t i = 0; i < ProjectNode.modules.size (); i++ ) for ( size_t i = 0; i < ProjectNode.modules.size (); i++ )
{ {
@ -1073,54 +1167,36 @@ MingwBackend::GetModuleInstallTargetFiles (
continue; continue;
if ( module.installName.length () > 0 ) if ( module.installName.length () > 0 )
{ {
string targetFilenameNoFixup; out.push_back ( FileLocation ( InstallDirectory,
if ( module.installBase.length () > 0 ) module.installBase,
targetFilenameNoFixup = module.installBase + sSep + module.installName; module.installName ) );
else
targetFilenameNoFixup = module.installName;
string targetFilename = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( targetFilenameNoFixup ),
installDirectory );
out.push_back ( targetFilename );
} }
} }
} }
void void
MingwBackend::GetInstallTargetFiles ( MingwBackend::GetInstallTargetFiles (
vector<string>& out ) const vector<FileLocation>& out ) const
{ {
GetNonModuleInstallTargetFiles ( out ); GetNonModuleInstallTargetFiles ( out );
GetModuleInstallTargetFiles ( out ); GetModuleInstallTargetFiles ( out );
} }
void void
MingwBackend::OutputInstallTarget ( const string& sourceFilename, MingwBackend::OutputInstallTarget ( const FileLocation& source,
const string& targetFilename, const FileLocation& target )
const string& targetDirectory )
{ {
string fullTargetFilename;
if ( targetDirectory.length () > 0)
fullTargetFilename = targetDirectory + sSep + targetFilename;
else
fullTargetFilename = targetFilename;
string normalizedTargetFilename = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( fullTargetFilename ),
installDirectory );
string normalizedTargetDirectory = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( targetDirectory ),
installDirectory );
fprintf ( fMakefile, fprintf ( fMakefile,
"%s: %s | %s\n", "%s: %s | %s\n",
normalizedTargetFilename.c_str (), strFile( &target ).c_str (),
sourceFilename.c_str (), strFile( &source ).c_str (),
normalizedTargetDirectory.c_str () ); strDirectory( &target ).c_str () );
fprintf ( fMakefile, fprintf ( fMakefile,
"\t$(ECHO_CP)\n" ); "\t$(ECHO_CP)\n" );
fprintf ( fMakefile, fprintf ( fMakefile,
"\t${cp} %s %s 1>$(NUL)\n", "\t${cp} %s %s 1>$(NUL)\n",
sourceFilename.c_str (), strFile( &source ).c_str (),
normalizedTargetFilename.c_str () ); strFile( &target ).c_str () );
} }
void void
@ -1129,9 +1205,7 @@ MingwBackend::OutputNonModuleInstallTargets ()
for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ ) for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ )
{ {
const InstallFile& installfile = *ProjectNode.installfiles[i]; const InstallFile& installfile = *ProjectNode.installfiles[i];
OutputInstallTarget ( installfile.GetPath (), OutputInstallTarget ( *installfile.source, *installfile.target );
installfile.newname,
installfile.base );
} }
} }
@ -1159,12 +1233,10 @@ MingwBackend::OutputModuleInstallTargets ()
if ( module.installName.length () > 0 ) if ( module.installName.length () > 0 )
{ {
const Module& aliasedModule = GetAliasedModuleOrModule ( module ); const Module& aliasedModule = GetAliasedModuleOrModule ( module );
string sourceFilename = MingwModuleHandler::PassThruCacheDirectory (
NormalizeFilename ( aliasedModule.GetPath () ), FileLocation source ( OutputDirectory, aliasedModule.GetBasePath (), aliasedModule.GetTargetName () );
outputDirectory ); FileLocation target ( InstallDirectory, module.installBase, module.installName );
OutputInstallTarget ( sourceFilename, OutputInstallTarget ( source, target );
module.installName,
module.installBase );
} }
} }
} }
@ -1182,24 +1254,23 @@ MingwBackend::GetRegistrySourceFiles ()
string string
MingwBackend::GetRegistryTargetFiles () MingwBackend::GetRegistryTargetFiles ()
{ {
string system32ConfigDirectory = NormalizeFilename ( string system32ConfigDirectory = "system32" + sSep + "config";
MingwModuleHandler::PassThruCacheDirectory ( FileLocation system32 ( InstallDirectory, system32ConfigDirectory, "" );
"system32" + sSep + "config" + sSep,
installDirectory ) ); vector<FileLocation> registry_files;
return system32ConfigDirectory + sSep + "default " + registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "default" ) );
system32ConfigDirectory + sSep + "sam " + registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "sam" ) );
system32ConfigDirectory + sSep + "security " + registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "security" ) );
system32ConfigDirectory + sSep + "software " + registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "software" ) );
system32ConfigDirectory + sSep + "system"; registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "system" ) );
return v2s( registry_files, 6 );
} }
void void
MingwBackend::OutputRegistryInstallTarget () MingwBackend::OutputRegistryInstallTarget ()
{ {
string system32ConfigDirectory = NormalizeFilename ( FileLocation system32 ( InstallDirectory, "system32" + sSep + "config", "" );
MingwModuleHandler::PassThruCacheDirectory (
"system32" + sSep + "config" + sSep,
installDirectory ) );
string registrySourceFiles = GetRegistrySourceFiles (); string registrySourceFiles = GetRegistrySourceFiles ();
string registryTargetFiles = GetRegistryTargetFiles (); string registryTargetFiles = GetRegistryTargetFiles ();
@ -1210,12 +1281,12 @@ MingwBackend::OutputRegistryInstallTarget ()
"%s: %s %s $(MKHIVE_TARGET)\n", "%s: %s %s $(MKHIVE_TARGET)\n",
registryTargetFiles.c_str (), registryTargetFiles.c_str (),
registrySourceFiles.c_str (), registrySourceFiles.c_str (),
system32ConfigDirectory.c_str () ); strDirectory ( &system32 ).c_str () );
fprintf ( fMakefile, fprintf ( fMakefile,
"\t$(ECHO_MKHIVE)\n" ); "\t$(ECHO_MKHIVE)\n" );
fprintf ( fMakefile, fprintf ( fMakefile,
"\t$(MKHIVE_TARGET) boot%cbootdata %s boot%cbootdata%chiveinst.inf\n", "\t$(MKHIVE_TARGET) boot%cbootdata %s boot%cbootdata%chiveinst.inf\n",
cSep, system32ConfigDirectory.c_str (), cSep, strDirectory ( &system32 ).c_str (),
cSep, cSep ); cSep, cSep );
fprintf ( fMakefile, fprintf ( fMakefile,
"\n" ); "\n" );
@ -1224,7 +1295,7 @@ MingwBackend::OutputRegistryInstallTarget ()
void void
MingwBackend::GenerateInstallTarget () MingwBackend::GenerateInstallTarget ()
{ {
vector<string> vInstallTargetFiles; vector<FileLocation> vInstallTargetFiles;
GetInstallTargetFiles ( vInstallTargetFiles ); GetInstallTargetFiles ( vInstallTargetFiles );
string installTargetFiles = v2s ( vInstallTargetFiles, 5 ); string installTargetFiles = v2s ( vInstallTargetFiles, 5 );
string registryTargetFiles = GetRegistryTargetFiles (); string registryTargetFiles = GetRegistryTargetFiles ();
@ -1232,7 +1303,7 @@ MingwBackend::GenerateInstallTarget ()
fprintf ( fMakefile, fprintf ( fMakefile,
"install: %s %s\n", "install: %s %s\n",
installTargetFiles.c_str (), installTargetFiles.c_str (),
registryTargetFiles.c_str () ); registryTargetFiles.c_str () );
OutputNonModuleInstallTargets (); OutputNonModuleInstallTargets ();
OutputModuleInstallTargets (); OutputModuleInstallTargets ();
OutputRegistryInstallTarget (); OutputRegistryInstallTarget ();

View file

@ -29,6 +29,8 @@
class Directory; class Directory;
class MingwModuleHandler; class MingwModuleHandler;
extern std::string
v2s ( const std::vector<FileLocation>& files, int wrap_at );
extern std::string extern std::string
v2s ( const string_list& v, int wrap_at ); v2s ( const string_list& v, int wrap_at );
@ -62,7 +64,7 @@ private:
void GenerateGlobalCFlagsAndProperties ( const char* op, void GenerateGlobalCFlagsAndProperties ( const char* op,
IfableData& data ) const; IfableData& data ) const;
void GenerateProjectGccOptionsMacro ( const char* assignmentOperation, void GenerateProjectGccOptionsMacro ( const char* assignmentOperation,
IfableData& data ) const; IfableData& data ) const;
void GenerateProjectGccOptions ( const char* assignmentOperation, void GenerateProjectGccOptions ( const char* assignmentOperation,
IfableData& data ) const; IfableData& data ) const;
std::string GenerateProjectLFLAGS () const; std::string GenerateProjectLFLAGS () const;
@ -106,12 +108,10 @@ private:
std::string GetInstallDirectories ( const std::string& installDirectory ); std::string GetInstallDirectories ( const std::string& installDirectory );
void GetNonModuleInstallFiles ( std::vector<std::string>& out ) const; void GetNonModuleInstallFiles ( std::vector<std::string>& out ) const;
void GetInstallFiles ( std::vector<std::string>& out ) const; void GetInstallFiles ( std::vector<std::string>& out ) const;
void GetNonModuleInstallTargetFiles ( std::vector<std::string>& out ) const; void GetNonModuleInstallTargetFiles ( std::vector<FileLocation>& out ) const;
void GetModuleInstallTargetFiles ( std::vector<std::string>& out ) const; void GetModuleInstallTargetFiles ( std::vector<FileLocation>& out ) const;
void GetInstallTargetFiles ( std::vector<std::string>& out ) const; void GetInstallTargetFiles ( std::vector<FileLocation>& out ) const;
void OutputInstallTarget ( const std::string& sourceFilename, void OutputInstallTarget ( const FileLocation& source, const FileLocation& target );
const std::string& targetFilename,
const std::string& targetDirectory );
void OutputNonModuleInstallTargets (); void OutputNonModuleInstallTargets ();
void OutputModuleInstallTargets (); void OutputModuleInstallTargets ();
std::string GetRegistrySourceFiles (); std::string GetRegistrySourceFiles ();

File diff suppressed because it is too large Load diff

View file

@ -41,21 +41,16 @@ public:
static void SetMakefile ( FILE* f ); static void SetMakefile ( FILE* f );
void EnablePreCompiledHeaderSupport (); void EnablePreCompiledHeaderSupport ();
static std::string PassThruCacheDirectory ( static const FileLocation* PassThruCacheDirectory (const FileLocation* fileLocation );
const std::string &f,
Directory* directoryTree );
static std::string PassThruCacheDirectory (const FileLocation* fileLocation ); static DirectoryLocation GetTargetDirectoryTree (
static Directory* GetTargetDirectoryTree (
const Module& module ); const Module& module );
static std::string GetTargetFilename ( static const FileLocation* GetTargetFilename (
const Module& module, const Module& module,
string_list* pclean_files ); string_list* pclean_files );
static std::string static const FileLocation* GetImportLibraryFilename (
GetImportLibraryFilename (
const Module& module, const Module& module,
string_list* pclean_files ); string_list* pclean_files );
@ -64,7 +59,7 @@ public:
std::string GetModuleTargets ( const Module& module ); std::string GetModuleTargets ( const Module& module );
void GetObjectsVector ( const IfableData& data, void GetObjectsVector ( const IfableData& data,
std::vector<std::string>& objectFiles ) const; std::vector<FileLocation>& objectFiles ) const;
void GenerateObjectMacro(); void GenerateObjectMacro();
void GenerateTargetMacro(); void GenerateTargetMacro();
void GenerateOtherMacros(); void GenerateOtherMacros();
@ -83,25 +78,28 @@ public:
void GenerateDependsTarget () const; void GenerateDependsTarget () const;
static bool ReferenceObjects ( const Module& module ); static bool ReferenceObjects ( const Module& module );
virtual void AddImplicitLibraries ( Module& module ) { return; } virtual void AddImplicitLibraries ( Module& module ) { return; }
void OutputCopyCommand ( const FileLocation& source,
const FileLocation& destination );
protected: protected:
virtual void GetModuleSpecificCompilationUnits ( std::vector<CompilationUnit*>& compilationUnits ); virtual void GetModuleSpecificCompilationUnits ( std::vector<CompilationUnit*>& compilationUnits );
std::string GetWorkingDirectory () const; std::string GetWorkingDirectory () const;
std::string GetBasename ( const std::string& filename ) const; std::string GetBasename ( const std::string& filename ) const;
FileLocation* GetActualSourceFilename ( const FileLocation* fileLocation ) const; const FileLocation* GetActualSourceFilename ( const FileLocation* file ) const;
std::string GetExtraDependencies ( const std::string& filename ) const; std::string GetExtraDependencies ( const FileLocation *file ) const;
std::string GetCompilationUnitDependencies ( const CompilationUnit& compilationUnit ) const; std::string GetCompilationUnitDependencies ( const CompilationUnit& compilationUnit ) const;
std::string GetModuleArchiveFilename () const; const FileLocation* GetModuleArchiveFilename () const;
bool IsGeneratedFile ( const File& file ) const; bool IsGeneratedFile ( const File& file ) const;
std::string GetImportLibraryDependency ( const Module& importedModule ); std::string GetImportLibraryDependency ( const Module& importedModule );
void GetTargets ( const Module& dependencyModule, void GetTargets ( const Module& dependencyModule,
string_list& targets ); string_list& targets );
void GetModuleDependencies ( string_list& dependencies ); void GetModuleDependencies ( string_list& dependencies );
std::string GetAllDependencies () const; std::string GetAllDependencies () const;
void GetSourceFilenames ( string_list& list, void GetSourceFilenames ( std::vector<FileLocation>& list,
bool includeGeneratedFiles ) const; bool includeGeneratedFiles ) const;
void GetSourceFilenamesWithoutGeneratedFiles ( string_list& list ) const; void GetSourceFilenamesWithoutGeneratedFiles ( std::vector<FileLocation>& list ) const;
std::string GetObjectFilename ( const FileLocation* sourceFileLocation, const FileLocation* GetObjectFilename ( const FileLocation* sourceFile,
string_list* pclean_files ) const; string_list* pclean_files ) const;
std::string GetObjectFilenames (); std::string GetObjectFilenames ();
@ -121,10 +119,10 @@ protected:
const std::string& libsMacro, const std::string& libsMacro,
const std::string& pefixupParameters ); const std::string& pefixupParameters );
void GeneratePhonyTarget() const; void GeneratePhonyTarget() const;
void GenerateBuildMapCode ( const char *mapTarget = NULL ); void GenerateBuildMapCode ( const FileLocation *mapTarget = NULL );
void GenerateRules (); void GenerateRules ();
void GenerateImportLibraryTargetIfNeeded (); void GenerateImportLibraryTargetIfNeeded ();
void GetDefinitionDependencies ( string_list& dependencies ) const; void GetDefinitionDependencies ( std::vector<FileLocation>& dependencies ) const;
std::string GetLinkingDependencies () const; std::string GetLinkingDependencies () const;
static MingwBackend* backend; static MingwBackend* backend;
@ -150,19 +148,19 @@ private:
std::string GenerateGccIncludeParameters () const; std::string GenerateGccIncludeParameters () const;
std::string GenerateGccParameters () const; std::string GenerateGccParameters () const;
std::string GenerateNasmParameters () const; std::string GenerateNasmParameters () const;
std::string GetPrecompiledHeaderFilename () const; const FileLocation* GetPrecompiledHeaderFilename () const;
void GenerateGccCommand ( const FileLocation* sourceFileLocation, void GenerateGccCommand ( const FileLocation* sourceFile,
const std::string& extraDependencies, const std::string& extraDependencies,
const std::string& cc, const std::string& cc,
const std::string& cflagsMacro ); const std::string& cflagsMacro );
void GenerateGccAssemblerCommand ( const FileLocation* sourceFileLocation, void GenerateGccAssemblerCommand ( const FileLocation* sourceFile,
const std::string& cc, const std::string& cc,
const std::string& cflagsMacro ); const std::string& cflagsMacro );
void GenerateNasmCommand ( const FileLocation* sourceFileLocation, void GenerateNasmCommand ( const FileLocation* sourceFile,
const std::string& nasmflagsMacro ); const std::string& nasmflagsMacro );
void GenerateWindresCommand ( const FileLocation* sourceFileLocation, void GenerateWindresCommand ( const FileLocation* sourceFile,
const std::string& windresflagsMacro ); const std::string& windresflagsMacro );
void GenerateWinebuildCommands ( const FileLocation* sourceFileLocation ); void GenerateWinebuildCommands ( const FileLocation* sourceFile );
std::string GetWidlFlags ( const CompilationUnit& compilationUnit ); std::string GetWidlFlags ( const CompilationUnit& compilationUnit );
void GenerateWidlCommandsServer ( void GenerateWidlCommandsServer (
const CompilationUnit& compilationUnit, const CompilationUnit& compilationUnit,
@ -198,24 +196,23 @@ private:
const std::string& nasmflagsMacro, const std::string& nasmflagsMacro,
const std::string& windresflagsMacro, const std::string& windresflagsMacro,
const std::string& widlflagsMacro ); const std::string& widlflagsMacro );
std::string GenerateArchiveTarget ( const std::string& ar, const FileLocation* GenerateArchiveTarget ( const std::string& ar,
const std::string& objs_macro ) const; const std::string& objs_macro ) const;
void GetSpecObjectDependencies ( string_list& dependencies, void GetSpecObjectDependencies ( std::vector<FileLocation>& dependencies,
const std::string& filename ) const; const FileLocation *file ) const;
void GetWidlObjectDependencies ( string_list& dependencies, void GetWidlObjectDependencies ( std::vector<FileLocation>& dependencies,
const std::string& filename ) const; const FileLocation *file ) const;
void GetDefaultDependencies ( string_list& dependencies ) const; void GetDefaultDependencies ( string_list& dependencies ) const;
void GetInvocationDependencies ( const Module& module, string_list& dependencies ); void GetInvocationDependencies ( const Module& module, string_list& dependencies );
bool IsWineModule () const; bool IsWineModule () const;
std::string GetDefinitionFilename () const; const FileLocation* GetDefinitionFilename () const;
static std::string RemoveVariables ( std::string path);
void GenerateBuildNonSymbolStrippedCode (); void GenerateBuildNonSymbolStrippedCode ();
void CleanupCompilationUnitVector ( std::vector<CompilationUnit*>& compilationUnits ); void CleanupCompilationUnitVector ( std::vector<CompilationUnit*>& compilationUnits );
void GetRpcHeaderDependencies ( std::vector<std::string>& dependencies ) const; void GetRpcHeaderDependencies ( std::vector<FileLocation>& dependencies ) const;
static std::string GetPropertyValue ( const Module& module, const std::string& name ); static std::string GetPropertyValue ( const Module& module, const std::string& name );
std::string GetRpcServerHeaderFilename ( std::string basename ) const; const FileLocation* GetRpcServerHeaderFilename ( const FileLocation *base ) const;
std::string GetRpcClientHeaderFilename ( std::string basename ) const; const FileLocation* GetRpcClientHeaderFilename ( const FileLocation *base ) const;
std::string GetIdlHeaderFilename ( std::string basename ) const; const FileLocation* GetIdlHeaderFilename ( const FileLocation *base ) const;
std::string GetModuleCleanTarget ( const Module& module ) const; std::string GetModuleCleanTarget ( const Module& module ) const;
void GetReferencedObjectLibraryModuleCleanTargets ( std::vector<std::string>& moduleNames ) const; void GetReferencedObjectLibraryModuleCleanTargets ( std::vector<std::string>& moduleNames ) const;
public: public:
@ -427,12 +424,12 @@ public:
virtual void Process (); virtual void Process ();
private: private:
void GenerateIsoModuleTarget (); void GenerateIsoModuleTarget ();
std::string GetBootstrapCdDirectories ( const std::string& bootcdDirectory ); void GetBootstrapCdDirectories ( std::vector<FileLocation>& out, const std::string& bootcdDirectory );
std::string GetNonModuleCdDirectories ( const std::string& bootcdDirectory ); void GetNonModuleCdDirectories ( std::vector<FileLocation>& out, const std::string& bootcdDirectory );
std::string GetCdDirectories ( const std::string& bootcdDirectory ); void GetCdDirectories ( std::vector<FileLocation>& out, const std::string& bootcdDirectory );
void GetBootstrapCdFiles ( std::vector<std::string>& out ) const; void GetBootstrapCdFiles ( std::vector<FileLocation>& out ) const;
void GetNonModuleCdFiles ( std::vector<std::string>& out ) const; void GetNonModuleCdFiles ( std::vector<FileLocation>& out ) const;
void GetCdFiles ( std::vector<std::string>& out ) const; void GetCdFiles ( std::vector<FileLocation>& out ) const;
void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory ); void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory );
void OutputCdfileCopyCommands ( const std::string& bootcdDirectory ); void OutputCdfileCopyCommands ( const std::string& bootcdDirectory );
}; };
@ -447,9 +444,6 @@ public:
private: private:
void GenerateLiveIsoModuleTarget (); void GenerateLiveIsoModuleTarget ();
void CreateDirectory ( const std::string& directory ); void CreateDirectory ( const std::string& directory );
void OutputCopyCommand ( const std::string& sourceFilename,
const std::string& targetFilename,
const std::string& targetDirectory );
void OutputModuleCopyCommands ( std::string& livecdDirectory, void OutputModuleCopyCommands ( std::string& livecdDirectory,
std::string& livecdReactos ); std::string& livecdReactos );
void OutputNonModuleCopyCommands ( std::string& livecdDirectory, void OutputNonModuleCopyCommands ( std::string& livecdDirectory,

View file

@ -100,7 +100,6 @@ ProxyMakefile::GenerateProxyMakefileForModule ( Module& module,
if ( outputTree.length () > 0 ) if ( outputTree.length () > 0 )
{ {
base = outputTree + sSep + module.GetBasePath (); base = outputTree + sSep + module.GetBasePath ();
Path path;
pathToTopDirectory = working_directory; pathToTopDirectory = working_directory;
} }
else else
@ -122,7 +121,7 @@ ProxyMakefile::GenerateProxyMakefileForModule ( Module& module,
s = s + sprintf ( s, "DEFAULT = %s\n", defaultTarget.c_str () ); s = s + sprintf ( s, "DEFAULT = %s\n", defaultTarget.c_str () );
s = s + sprintf ( s, "include $(TOP)/proxy.mak\n" ); s = s + sprintf ( s, "include $(TOP)/proxy.mak\n" );
FileSupportCode::WriteIfChanged ( buf, proxyMakefile ); FileSupportCode::WriteIfChanged ( buf, proxyMakefile, true );
free ( buf ); free ( buf );
} }

View file

@ -34,38 +34,24 @@ CDFile::ReplaceVariable ( const string& name,
return path; return path;
} }
CDFile::CDFile ( const Project& project_, CDFile::CDFile ( const Project& project,
const XMLElement& cdfileNode, const XMLElement& cdfileNode,
const string& path ) const string& path )
: project ( project_ ), : XmlNode ( project, cdfileNode )
node ( cdfileNode )
{ {
const XMLAttribute* att = node.GetAttribute ( "base", false ); const XMLAttribute* att = cdfileNode.GetAttribute ( "base", false );
string target_relative_directory;
if ( att != NULL ) if ( att != NULL )
base = ReplaceVariable ( "$(CDOUTPUT)", Environment::GetCdOutputPath (), att->value ); target_relative_directory = ReplaceVariable ( "$(CDOUTPUT)", Environment::GetCdOutputPath (), att->value );
else else
base = ""; target_relative_directory = "";
att = node.GetAttribute ( "nameoncd", false ); const XMLAttribute* nameoncd = cdfileNode.GetAttribute ( "nameoncd", false );
if ( att != NULL )
nameoncd = att->value;
else
nameoncd = node.value;
name = node.value;
this->path = path;
}
CDFile::~CDFile () source = new FileLocation ( SourceDirectory,
{ path,
} cdfileNode.value );
target = new FileLocation ( OutputDirectory,
string target_relative_directory,
CDFile::GetPath () const nameoncd ? att->value : cdfileNode.value );
{
return path + sSep + name;
}
void
CDFile::ProcessXML()
{
} }

View file

@ -28,6 +28,7 @@ CompilationUnit::CompilationUnit ( File* file )
module(NULL), module(NULL),
node(NULL) node(NULL)
{ {
local_name = file->name;
name = file->name; name = file->name;
files.push_back ( file ); files.push_back ( file );
} }
@ -41,6 +42,7 @@ CompilationUnit::CompilationUnit ( const Project* project,
{ {
const XMLAttribute* att = node->GetAttribute ( "name", true ); const XMLAttribute* att = node->GetAttribute ( "name", true );
assert(att); assert(att);
local_name = att->value;
name = module->GetBasePath () + cSep + att->value; name = module->GetBasePath () + cSep + att->value;
} }
@ -92,16 +94,40 @@ CompilationUnit::IsFirstFile () const
return file->first; return file->first;
} }
FileLocation*
CompilationUnit::GetFilename ( Directory* intermediateDirectory ) const const FileLocation*
CompilationUnit::GetFilename () const
{ {
if ( files.size () == 0 || files.size () > 1 ) if ( files.size () == 0 || files.size () > 1 )
return new FileLocation ( intermediateDirectory, name ); {
return new FileLocation ( IntermediateDirectory,
module ? module->GetBasePath () : "",
local_name );
}
File* file = files[0]; File* file = files[0];
if (file->path_prefix.length() > 0)
return new FileLocation ( intermediateDirectory, file->name ); DirectoryLocation directory;
if ( file->path_prefix.length () == 0 )
directory = SourceDirectory;
else if ( file->path_prefix == "$(INTERMEDIATE)" )
directory = IntermediateDirectory;
else else
return new FileLocation ( NULL, file->name ); throw InvalidOperationException ( __FILE__,
__LINE__,
"Invalid path prefix '%s'",
file->path_prefix.c_str () );
size_t pos = file->name.find_last_of ( "/\\" );
assert ( pos != string::npos );
string relative_path = file->name.substr ( 0, pos );
string name = file->name.substr ( pos + 1 );
if ( relative_path.compare ( 0, 15, "$(INTERMEDIATE)") == 0 )
{
directory = IntermediateDirectory;
relative_path.erase ( 0, 16 );
}
return new FileLocation ( directory, relative_path, name );
} }
std::string std::string

View file

@ -24,7 +24,8 @@ using std::string;
/* static */ void /* static */ void
FileSupportCode::WriteIfChanged ( char* outbuf, FileSupportCode::WriteIfChanged ( char* outbuf,
string filename ) const string& filename,
bool ignoreError )
{ {
FILE* out; FILE* out;
unsigned int end; unsigned int end;
@ -36,7 +37,11 @@ FileSupportCode::WriteIfChanged ( char* outbuf,
{ {
out = fopen ( filename.c_str (), "wb" ); out = fopen ( filename.c_str (), "wb" );
if ( out == NULL ) if ( out == NULL )
{
if ( ignoreError )
return;
throw AccessDeniedException ( filename ); throw AccessDeniedException ( filename );
}
fputs ( outbuf, out ); fputs ( outbuf, out );
fclose ( out ); fclose ( out );
return; return;

View file

@ -22,32 +22,22 @@
using std::string; using std::string;
InstallFile::InstallFile ( const Project& project_, InstallFile::InstallFile ( const Project& project,
const XMLElement& installfileNode, const XMLElement& installfileNode,
const string& path ) const string& path )
: project ( project_ ), : XmlNode(project, installfileNode )
node ( installfileNode )
{ {
const XMLAttribute* att = node.GetAttribute ( "base", false ); const XMLAttribute* base = node.GetAttribute ( "base", false );
if ( att != NULL ) const XMLAttribute* newname = node.GetAttribute ( "newname", false );
base = att->value;
else
base = "";
att = node.GetAttribute ( "newname", false ); DirectoryLocation source_directory = SourceDirectory;
if ( att != NULL ) const XMLAttribute* att = node.GetAttribute ( "root", false );
newname = att->value;
else
newname = node.value;
name = node.value;
att = node.GetAttribute ( "root", false );
if ( att != NULL) if ( att != NULL)
{ {
if ( att->value == "intermediate" ) if ( att->value == "intermediate" )
this->path = "$(INTERMEDIATE)" + sSep + path; source_directory = IntermediateDirectory;
else if ( att->value == "output" ) else if ( att->value == "output" )
this->path = "$(OUTPUT)" + sSep + path; source_directory = OutputDirectory;
else else
{ {
throw InvalidAttributeValueException ( throw InvalidAttributeValueException (
@ -56,21 +46,15 @@ InstallFile::InstallFile ( const Project& project_,
att->value ); att->value );
} }
} }
else
this->path = path;
}
InstallFile::~InstallFile () source = new FileLocation ( source_directory,
{ path,
} node.value );
target = new FileLocation ( InstallDirectory,
string base && base->value != "."
InstallFile::GetPath () const ? base->value
{ : "",
return path + sSep + name; newname
} ? newname->value
: node.value );
void
InstallFile::ProcessXML()
{
} }

View file

@ -795,8 +795,19 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
e.location, e.location,
"Only one <pch> is valid per module" ); "Only one <pch> is valid per module" );
} }
pch = new PchFile ( size_t pos = e.value.find_last_of ( "/\\" );
e, *this, File ( FixSeparator ( path + cSep + e.value ), false, "", true ) ); if ( pos == string::npos )
{
pch = new PchFile (
e, *this, FileLocation ( SourceDirectory, path, e.value ) );
}
else
{
string dir = e.value.substr ( 0, pos );
string name = e.value.substr ( pos + 1);
pch = new PchFile (
e, *this, FileLocation ( SourceDirectory, path + sSep + dir, name ) );
}
subs_invalid = true; subs_invalid = true;
} }
else if ( e.name == "compilationunit" ) else if ( e.name == "compilationunit" )
@ -1146,6 +1157,15 @@ Module::GetDependencyPath () const
return GetPath(); return GetPath();
} }
string
Module::GetDependencyTargetName () const
{
if ( HasImportLibrary () )
return "lib" + name + ".a";
else
return GetTargetName();
}
string string
Module::GetBasePath () const Module::GetBasePath () const
{ {
@ -1650,7 +1670,7 @@ Property::ProcessXML()
PchFile::PchFile ( PchFile::PchFile (
const XMLElement& node_, const XMLElement& node_,
const Module& module_, const Module& module_,
const File file_ ) const FileLocation& file_ )
: node(node_), module(module_), file(file_) : node(node_), module(module_), file(file_)
{ {
} }
@ -1659,93 +1679,3 @@ void
PchFile::ProcessXML() PchFile::ProcessXML()
{ {
} }
AutoRegister::AutoRegister ( const Project& project_,
const Module* module_,
const XMLElement& node_ )
: project(project_),
module(module_),
node(node_)
{
Initialize();
}
AutoRegister::~AutoRegister ()
{
}
bool
AutoRegister::IsSupportedModuleType ( ModuleType type )
{
switch ( type )
{
case Win32DLL:
case Win32OCX:
return true;
case Kernel:
case KernelModeDLL:
case NativeDLL:
case NativeCUI:
case Win32CUI:
case Win32GUI:
case Win32SCR:
case KernelModeDriver:
case BootSector:
case BootLoader:
case BootProgram:
case BuildTool:
case StaticLibrary:
case ObjectLibrary:
case Iso:
case LiveIso:
case IsoRegTest:
case LiveIsoRegTest:
case Test:
case RpcServer:
case RpcClient:
case Alias:
case IdlHeader:
case EmbeddedTypeLib:
case ElfExecutable:
return false;
}
throw InvalidOperationException ( __FILE__,
__LINE__ );
}
AutoRegisterType
AutoRegister::GetAutoRegisterType( string type )
{
if ( type == "DllRegisterServer" )
return DllRegisterServer;
if ( type == "DllInstall" )
return DllInstall;
if ( type == "Both" )
return Both;
throw XMLInvalidBuildFileException (
node.location,
"<autoregister> type attribute must be DllRegisterServer, DllInstall or Both." );
}
void
AutoRegister::Initialize ()
{
if ( !IsSupportedModuleType ( module->type ) )
{
throw XMLInvalidBuildFileException (
node.location,
"<autoregister> is not applicable for this module type." );
}
const XMLAttribute* att = node.GetAttribute ( "infsection", true );
infSection = att->value;
att = node.GetAttribute ( "type", true );
type = GetAutoRegisterType ( att->value );
}
void
AutoRegister::ProcessXML()
{
}

View file

@ -99,10 +99,40 @@ ParseContext::ParseContext ()
} }
FileLocation::FileLocation ( Directory* directory, FileLocation::FileLocation ( const DirectoryLocation directory,
std::string filename ) const std::string& relative_path,
: directory (directory), const std::string& name )
filename (filename) : directory ( directory ),
relative_path ( NormalizeFilename ( relative_path ) ),
name ( name )
{
if ( relative_path[0] == '/' ||
relative_path[0] == '\\' ||
relative_path.find ( '$' ) != string::npos ||
( relative_path.length () > 1 && ( relative_path[1] == ':' ||
relative_path.find_last_of ( "/\\" ) == relative_path.length () - 1 ) )
)
{
throw InvalidOperationException ( __FILE__,
__LINE__,
"Invalid relative path '%s'",
relative_path.c_str () );
}
if ( strpbrk ( name.c_str (), "/\\:" ) )
{
throw InvalidOperationException ( __FILE__,
__LINE__,
"Invalid file name '%s'",
name.c_str () );
}
}
FileLocation::FileLocation ( const FileLocation& other )
: directory ( other.directory ),
relative_path ( other.relative_path ),
name ( other.name )
{ {
} }

View file

@ -70,6 +70,7 @@ extern char cBadSep;
#define MS_VS_DEF_VERSION "7.10" #define MS_VS_DEF_VERSION "7.10"
class XmlNode;
class Directory; class Directory;
class Project; class Project;
class IfableData; class IfableData;
@ -105,6 +106,20 @@ class Metadata;
typedef std::map<std::string,Directory*> directory_map; typedef std::map<std::string,Directory*> directory_map;
class XmlNode
{
protected:
const Project& project;
const XMLElement& node;
XmlNode ( const Project& project_,
const XMLElement& node_ );
virtual ~XmlNode();
public:
virtual void ProcessXML();
};
class Directory class Directory
{ {
public: public:
@ -168,7 +183,8 @@ class FileSupportCode
{ {
public: public:
static void WriteIfChanged ( char* outbuf, static void WriteIfChanged ( char* outbuf,
std::string filename ); const std::string& filename,
bool ignoreError = false );
}; };
@ -307,7 +323,7 @@ public:
bool isUnicode; bool isUnicode;
bool isDefaultEntryPoint; bool isDefaultEntryPoint;
Bootstrap* bootstrap; Bootstrap* bootstrap;
AutoRegister* autoRegister; AutoRegister* autoRegister; // <autoregister> node
IfableData non_if_data; IfableData non_if_data;
std::vector<Invoke*> invocations; std::vector<Invoke*> invocations;
std::vector<Dependency*> dependencies; std::vector<Dependency*> dependencies;
@ -339,6 +355,7 @@ public:
bool GenerateInOutputTree () const; bool GenerateInOutputTree () const;
std::string GetTargetName () const; // "foo.exe" std::string GetTargetName () const; // "foo.exe"
std::string GetDependencyPath () const; // "path/foo.exe" or "path/libfoo.a" std::string GetDependencyPath () const; // "path/foo.exe" or "path/libfoo.a"
std::string GetDependencyTargetName () const; // "foo.exe" or "libfoo.a"
std::string GetBasePath () const; // "path" std::string GetBasePath () const; // "path"
std::string GetPath () const; // "path/foo.exe" std::string GetPath () const; // "path/foo.exe"
std::string GetPathWithPrefix ( const std::string& prefix ) const; // "path/prefixfoo.exe" std::string GetPathWithPrefix ( const std::string& prefix ) const; // "path/prefixfoo.exe"
@ -814,22 +831,40 @@ private:
}; };
class CDFile enum DirectoryLocation
{
SourceDirectory,
IntermediateDirectory,
OutputDirectory,
InstallDirectory,
TemporaryDirectory,
};
class FileLocation
{ {
public: public:
const Project& project; DirectoryLocation directory;
const XMLElement& node; std::string relative_path;
std::string name; std::string name;
std::string base;
std::string nameoncd; FileLocation ( const DirectoryLocation directory,
std::string path; const std::string& relative_path,
const std::string& name );
FileLocation ( const FileLocation& other );
};
class CDFile : public XmlNode
{
public:
FileLocation *source;
FileLocation *target;
CDFile ( const Project& project, CDFile ( const Project& project,
const XMLElement& bootstrapNode, const XMLElement& bootstrapNode,
const std::string& path ); const std::string& path );
~CDFile ();
void ProcessXML();
std::string GetPath () const;
private: private:
static std::string ReplaceVariable ( const std::string& name, static std::string ReplaceVariable ( const std::string& name,
const std::string& value, const std::string& value,
@ -837,22 +872,15 @@ private:
}; };
class InstallFile class InstallFile : public XmlNode
{ {
public: public:
const Project& project; FileLocation *source;
const XMLElement& node; FileLocation *target;
std::string name;
std::string base;
std::string newname;
std::string path;
InstallFile ( const Project& project, InstallFile ( const Project& project,
const XMLElement& bootstrapNode, const XMLElement& bootstrapNode,
const std::string& path ); const std::string& path );
~InstallFile ();
void ProcessXML ();
std::string GetPath () const;
}; };
@ -861,12 +889,12 @@ class PchFile
public: public:
const XMLElement& node; const XMLElement& node;
const Module& module; const Module& module;
File file; FileLocation file;
PchFile ( PchFile (
const XMLElement& node, const XMLElement& node,
const Module& module, const Module& module,
const File file ); const FileLocation& file );
void ProcessXML(); void ProcessXML();
}; };
@ -921,8 +949,10 @@ public:
bool IsGeneratedFile () const; bool IsGeneratedFile () const;
bool HasFileWithExtension ( const std::string& extension ) const; bool HasFileWithExtension ( const std::string& extension ) const;
bool IsFirstFile () const; bool IsFirstFile () const;
FileLocation* GetFilename ( Directory* intermediateDirectory ) const; const FileLocation* GetFilename () const;
std::string GetSwitches () const; std::string GetSwitches () const;
private:
std::string local_name;
}; };
@ -944,16 +974,6 @@ private:
}; };
class FileLocation
{
public:
Directory* directory;
std::string filename;
FileLocation ( Directory* directory,
std::string filename );
};
enum AutoRegisterType enum AutoRegisterType
{ {
DllRegisterServer, DllRegisterServer,
@ -961,22 +981,18 @@ enum AutoRegisterType
Both Both
}; };
class AutoRegister class AutoRegister : public XmlNode
{ {
public: public:
const Project& project;
const Module* module; const Module* module;
const XMLElement& node;
std::string infSection; std::string infSection;
AutoRegisterType type; AutoRegisterType type;
AutoRegister ( const Project& project_, AutoRegister ( const Project& project_,
const Module* module_, const Module* module_,
const XMLElement& node_ ); const XMLElement& node_ );
~AutoRegister ();
void ProcessXML();
private: private:
bool IsSupportedModuleType ( ModuleType type ); bool IsSupportedModuleType ( ModuleType type );
AutoRegisterType GetAutoRegisterType( std::string type ); AutoRegisterType GetAutoRegisterType( const std::string& type );
void Initialize (); void Initialize ();
}; };

View file

@ -244,6 +244,7 @@ RBUILD_COMMON_SOURCES = \
$(addprefix $(RBUILD_BASE_), \ $(addprefix $(RBUILD_BASE_), \
global.cpp \ global.cpp \
automaticdependency.cpp \ automaticdependency.cpp \
autoregister.cpp \
bootstrap.cpp \ bootstrap.cpp \
cdfile.cpp \ cdfile.cpp \
compilationunit.cpp \ compilationunit.cpp \
@ -264,6 +265,7 @@ RBUILD_COMMON_SOURCES = \
syssetupgenerator.cpp \ syssetupgenerator.cpp \
testsupportcode.cpp \ testsupportcode.cpp \
wineresource.cpp \ wineresource.cpp \
xmlnode.cpp \
) )
RBUILD_SPECIAL_SOURCES = \ RBUILD_SPECIAL_SOURCES = \
@ -374,6 +376,10 @@ $(RBUILD_INT_)automaticdependency.o: $(RBUILD_BASE_)automaticdependency.cpp $(RB
$(ECHO_CC) $(ECHO_CC)
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
$(RBUILD_INT_)autoregister.o: $(RBUILD_BASE_)autoregister.cpp $(RBUILD_HEADERS) | $(RBUILD_INT)
$(ECHO_CC)
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
$(RBUILD_INT_)bootstrap.o: $(RBUILD_BASE_)bootstrap.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) $(RBUILD_INT_)bootstrap.o: $(RBUILD_BASE_)bootstrap.cpp $(RBUILD_HEADERS) | $(RBUILD_INT)
$(ECHO_CC) $(ECHO_CC)
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
@ -454,6 +460,10 @@ $(RBUILD_INT_)wineresource.o: $(RBUILD_BASE_)wineresource.cpp $(RBUILD_HEADERS)
$(ECHO_CC) $(ECHO_CC)
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
$(RBUILD_INT_)xmlnode.o: $(RBUILD_BASE_)xmlnode.cpp $(RBUILD_HEADERS) | $(RBUILD_INT)
$(ECHO_CC)
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
$(RBUILD_INT_)testsupportcode.o: $(RBUILD_BASE_)testsupportcode.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) $(RBUILD_INT_)testsupportcode.o: $(RBUILD_BASE_)testsupportcode.cpp $(RBUILD_HEADERS) | $(RBUILD_INT)
$(ECHO_CC) $(ECHO_CC)
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@

View file

@ -297,8 +297,8 @@ TestSupportCode::GetSourceFilenames ( string_list& list,
const vector<CompilationUnit*>& compilationUnits = module.non_if_data.compilationUnits; const vector<CompilationUnit*>& compilationUnits = module.non_if_data.compilationUnits;
for ( i = 0; i < compilationUnits.size (); i++ ) for ( i = 0; i < compilationUnits.size (); i++ )
{ {
FileLocation* sourceFileLocation = compilationUnits[i]->GetFilename ( NULL ); const FileLocation* sourceFileLocation = compilationUnits[i]->GetFilename ();
string filename = sourceFileLocation->filename; string filename = sourceFileLocation->relative_path + sSep + sourceFileLocation->name;
if ( !compilationUnits[i]->IsGeneratedFile () && IsTestFile ( filename ) ) if ( !compilationUnits[i]->IsGeneratedFile () && IsTestFile ( filename ) )
list.push_back ( filename ); list.push_back ( filename );
} }
@ -317,8 +317,8 @@ TestSupportCode::GetSourceFilenames ( string_list& list,
for ( j = 0; j < compilationUnits.size (); j++ ) for ( j = 0; j < compilationUnits.size (); j++ )
{ {
CompilationUnit& compilationUnit = *compilationUnits[j]; CompilationUnit& compilationUnit = *compilationUnits[j];
FileLocation* sourceFileLocation = compilationUnits[j]->GetFilename ( NULL ); const FileLocation* sourceFileLocation = compilationUnits[j]->GetFilename ();
string filename = sourceFileLocation->filename; string filename = sourceFileLocation->relative_path + sSep + sourceFileLocation->name;
if ( !compilationUnit.IsGeneratedFile () && IsTestFile ( filename ) ) if ( !compilationUnit.IsGeneratedFile () && IsTestFile ( filename ) )
list.push_back ( filename ); list.push_back ( filename );
} }

View file

@ -0,0 +1,38 @@
/*
* Copyright (C) 2007 Hervé Poussineau
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "pch.h"
#include "rbuild.h"
using std::string;
XmlNode::XmlNode ( const Project& project_,
const XMLElement& node )
: project(project_),
node(node)
{
}
XmlNode::~XmlNode ()
{
}
void
XmlNode::ProcessXML ()
{
}