Support absolute paths for intermediate/output directories

Never put real intermediate/output directory names in generated makefile, use $(INTERMEDIATE) and $(OUTPUT) instead

svn path=/trunk/; revision=28218
This commit is contained in:
Hervé Poussineau 2007-08-07 15:08:09 +00:00
parent ebb26326a5
commit 434e1ef9df
11 changed files with 143 additions and 74 deletions

View file

@ -336,12 +336,33 @@ void
AutomaticDependency::ParseFile ( const Module& module, AutomaticDependency::ParseFile ( const Module& module,
const File& file ) const File& file )
{ {
string normalizedFilename = NormalizeFilename ( file.name ); string normalizedFilename = NormalizeFilename ( file.GetFullPath () );
RetrieveFromCacheOrParse ( module, RetrieveFromCacheOrParse ( module,
normalizedFilename, normalizedFilename,
NULL ); NULL );
} }
string
AutomaticDependency::ReplaceVariable ( const string& name,
const string& value,
string path )
{
size_t i = path.find ( name );
if ( i != string::npos )
return path.replace ( i, name.length (), value );
else
return path;
}
string
AutomaticDependency::ResolveVariablesInPath ( const string& path )
{
string s = ReplaceVariable ( "$(INTERMEDIATE)", Environment::GetIntermediatePath (), path );
s = ReplaceVariable ( "$(OUTPUT)", Environment::GetOutputPath (), s );
s = ReplaceVariable ( "$(INSTALL)", Environment::GetInstallPath (), s );
return s;
}
bool bool
AutomaticDependency::LocateIncludedFile ( const string& directory, AutomaticDependency::LocateIncludedFile ( const string& directory,
const string& includedFilename, const string& includedFilename,
@ -423,7 +444,7 @@ AutomaticDependency::RetrieveFromCacheOrParse ( const Module& module,
{ {
sourceFile = new SourceFile ( this, sourceFile = new SourceFile ( this,
module, module,
filename, ResolveVariablesInPath ( filename ),
parentSourceFile, parentSourceFile,
false ); false );
sourcefile_map[filename] = sourceFile; sourcefile_map[filename] = sourceFile;

View file

@ -766,7 +766,7 @@ MingwBackend::GetVersionString ( const string& versionCommand )
char separators[] = " "; char separators[] = " ";
char *token; char *token;
char *prevtoken = NULL; char *prevtoken = NULL;
string version; string version;
token = strtok ( buffer, separators ); token = strtok ( buffer, separators );
@ -865,11 +865,11 @@ MingwBackend::GetBinutilsVersionDate ( const string& binutilsCommand )
} }
buffer[i] = '\0'; buffer[i] = '\0';
pclose ( fp ); pclose ( fp );
char separators[] = " "; char separators[] = " ";
char *token; char *token;
char *prevtoken = NULL; char *prevtoken = NULL;
token = strtok ( buffer, separators ); token = strtok ( buffer, separators );
while ( token != NULL ) while ( token != NULL )
{ {

View file

@ -466,7 +466,7 @@ MingwModuleHandler::GetSourceFilenames ( string_list& list,
FileLocation* sourceFileLocation = GetActualSourceFilename ( FileLocation* sourceFileLocation = GetActualSourceFilename (
compilationUnits[i]->GetFilename ( backend->intermediateDirectory ) ); compilationUnits[i]->GetFilename ( backend->intermediateDirectory ) );
list.push_back ( PassThruCacheDirectory ( sourceFileLocation->filename, list.push_back ( PassThruCacheDirectory ( sourceFileLocation->filename,
sourceFileLocation->directory ) ); sourceFileLocation->directory ) );
} }
} }
// intentionally make a copy so that we can append more work in // intentionally make a copy so that we can append more work in
@ -693,9 +693,9 @@ MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Includ
if ( parameters.length () > 0 ) if ( parameters.length () > 0 )
parameters += " "; parameters += " ";
if ( include.root == "intermediate" ) if ( include.root == "intermediate" )
path_prefix = backend->intermediateDirectory->name + cSep; path_prefix = "$(INTERMEDIATE)" + sSep;
else if (include.root == "output" ) else if (include.root == "output" )
path_prefix = backend->outputDirectory->name + cSep; path_prefix = "$(OUTPUT)" + sSep;
else else
path_prefix = ""; path_prefix = "";
@ -811,14 +811,14 @@ MingwModuleHandler::GenerateMacro (
include.baseModule->type == RpcClient || include.baseModule->type == RpcClient ||
include.baseModule->type == IdlHeader) ) include.baseModule->type == IdlHeader) )
includeDirectory = PassThruCacheDirectory ( NormalizeFilename ( include.directory ), includeDirectory = PassThruCacheDirectory ( NormalizeFilename ( include.directory ),
backend->intermediateDirectory ); backend->intermediateDirectory );
else else
includeDirectory = include.directory; includeDirectory = include.directory;
if ( include.root == "intermediate" ) if ( include.root == "intermediate" )
path_prefix = backend->intermediateDirectory->name + cSep; path_prefix = "$(INTERMEDIATE)" + sSep;
else if (include.root == "output" ) else if (include.root == "output" )
path_prefix = backend->outputDirectory->name + cSep; path_prefix = "$(OUTPUT)" + sSep;
else else
path_prefix = ""; path_prefix = "";
@ -1281,13 +1281,12 @@ MingwModuleHandler::GenerateWidlCommandsEmbeddedTypeLib (
GetDirectory ( EmbeddedTypeLibFilename ).c_str () ); GetDirectory ( EmbeddedTypeLibFilename ).c_str () );
fprintf ( fMakefile, "\t$(ECHO_WIDL)\n" ); fprintf ( fMakefile, "\t$(ECHO_WIDL)\n" );
fprintf ( fMakefile, fprintf ( fMakefile,
//"\t%s %s %s -t -T $@ %s\n", "\t%s %s %s -t -T %s %s\n",
"\t%s %s %s -t -T %s %s\n",
"$(Q)$(WIDL_TARGET)", "$(Q)$(WIDL_TARGET)",
GetWidlFlags ( compilationUnit ).c_str (), GetWidlFlags ( compilationUnit ).c_str (),
widlflagsMacro.c_str (), widlflagsMacro.c_str (),
EmbeddedTypeLibFilename.c_str(), EmbeddedTypeLibFilename.c_str(),
filename.c_str () ); filename.c_str () );
} }
void void
@ -2003,8 +2002,9 @@ MingwModuleHandler::GenerateOtherMacros ()
fprintf ( fprintf (
fMakefile, fMakefile,
"%s += $(PROJECT_WIDLFLAGS)\n", "%s += $(PROJECT_WIDLFLAGS) -I%s\n",
widlflagsMacro.c_str () ); widlflagsMacro.c_str (),
module.GetBasePath ().c_str () );
fprintf ( fprintf (
fMakefile, fMakefile,

View file

@ -98,7 +98,7 @@ protected:
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 ( string_list& list,
bool includeGeneratedFiles ) const; bool includeGeneratedFiles ) const;
void GetSourceFilenamesWithoutGeneratedFiles ( string_list& list ) const; void GetSourceFilenamesWithoutGeneratedFiles ( string_list& list ) const;
std::string GetObjectFilename ( const FileLocation* sourceFileLocation, std::string GetObjectFilename ( const FileLocation* sourceFileLocation,
string_list* pclean_files ) const; string_list* pclean_files ) const;
@ -213,7 +213,7 @@ private:
void GetRpcHeaderDependencies ( std::vector<std::string>& dependencies ) const; void GetRpcHeaderDependencies ( std::vector<std::string>& dependencies ) const;
std::string GetRpcServerHeaderFilename ( std::string basename ) const; std::string GetRpcServerHeaderFilename ( std::string basename ) const;
std::string GetRpcClientHeaderFilename ( std::string basename ) const; std::string GetRpcClientHeaderFilename ( std::string basename ) const;
std::string GetIdlHeaderFilename ( std::string basename ) const; std::string GetIdlHeaderFilename ( std::string basename ) 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:
@ -334,8 +334,8 @@ public:
MingwWin32DLLModuleHandler ( const Module& module ); MingwWin32DLLModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; } virtual HostType DefaultHost() { return HostFalse; }
virtual void Process (); virtual void Process ();
std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; }
void AddImplicitLibraries ( Module& module ); void AddImplicitLibraries ( Module& module );
private: private:
void GenerateWin32DLLModuleTarget (); void GenerateWin32DLLModuleTarget ();
}; };
@ -347,8 +347,8 @@ public:
MingwWin32OCXModuleHandler ( const Module& module ); MingwWin32OCXModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; } virtual HostType DefaultHost() { return HostFalse; }
virtual void Process (); virtual void Process ();
std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; }
void AddImplicitLibraries ( Module& module ); void AddImplicitLibraries ( Module& module );
private: private:
void GenerateWin32OCXModuleTarget (); void GenerateWin32OCXModuleTarget ();
}; };
@ -361,7 +361,7 @@ public:
virtual HostType DefaultHost() { return HostFalse; } virtual HostType DefaultHost() { return HostFalse; }
virtual void Process (); virtual void Process ();
std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; }
void AddImplicitLibraries ( Module& module ); void AddImplicitLibraries ( Module& module );
private: private:
void GenerateWin32CUIModuleTarget (); void GenerateWin32CUIModuleTarget ();
}; };
@ -374,7 +374,7 @@ public:
virtual HostType DefaultHost() { return HostFalse; } virtual HostType DefaultHost() { return HostFalse; }
virtual void Process (); virtual void Process ();
std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; } std::string TypeSpecificLinkerFlags() { return module.useHostStdlib ? "-nostartfiles -lgcc" : "-nostartfiles -nostdlib -lgcc"; }
void AddImplicitLibraries ( Module& module ); void AddImplicitLibraries ( Module& module );
private: private:
void GenerateWin32GUIModuleTarget (); void GenerateWin32GUIModuleTarget ();
}; };

View file

@ -98,7 +98,10 @@ CompilationUnit::GetFilename ( Directory* intermediateDirectory ) const
if ( files.size () == 0 || files.size () > 1 ) if ( files.size () == 0 || files.size () > 1 )
return new FileLocation ( intermediateDirectory, name ); return new FileLocation ( intermediateDirectory, name );
File* file = files[0]; File* file = files[0];
return new FileLocation ( NULL, file->name ); if (file->path_prefix.length() > 0)
return new FileLocation ( intermediateDirectory, file->name );
else
return new FileLocation ( NULL, file->name );
} }
std::string std::string

View file

@ -53,6 +53,14 @@ Directory::Add ( const char* subdir )
} }
const char* p = strpbrk ( subdir, "/\\" ); const char* p = strpbrk ( subdir, "/\\" );
if ( subdir == p || ( *subdir && subdir[1] == ':' ) )
{
throw InvalidOperationException ( __FILE__,
__LINE__,
"Invalid relative path '%s'",
subdir );
}
if ( !p ) if ( !p )
p = subdir + strlen(subdir); p = subdir + strlen(subdir);
string s ( subdir, p-subdir ); string s ( subdir, p-subdir );
@ -109,8 +117,8 @@ Directory::CreateDirectory ( string path )
} }
string string
Directory::ReplaceVariable ( string name, Directory::ReplaceVariable ( const string& name,
string value, const string& value,
string path ) string path )
{ {
size_t i = path.find ( name ); size_t i = path.find ( name );
@ -122,7 +130,7 @@ Directory::ReplaceVariable ( string name,
void void
Directory::ResolveVariablesInPath ( char* buf, Directory::ResolveVariablesInPath ( char* buf,
string path ) const string& path )
{ {
string s = ReplaceVariable ( "$(INTERMEDIATE)", Environment::GetIntermediatePath (), path ); string s = ReplaceVariable ( "$(INTERMEDIATE)", Environment::GetIntermediatePath (), path );
s = ReplaceVariable ( "$(OUTPUT)", Environment::GetOutputPath (), s ); s = ReplaceVariable ( "$(OUTPUT)", Environment::GetOutputPath (), s );
@ -140,7 +148,10 @@ Directory::GenerateTree ( const string& parent,
{ {
char buf[256]; char buf[256];
path = parent + sSep + name; if ( name.size () > 0 )
path = parent + sSep + name;
else
path = parent;
ResolveVariablesInPath ( buf, path ); ResolveVariablesInPath ( buf, path );
if ( CreateDirectory ( buf ) && verbose ) if ( CreateDirectory ( buf ) && verbose )
printf ( "Created %s\n", buf ); printf ( "Created %s\n", buf );

View file

@ -45,9 +45,9 @@ InstallFile::InstallFile ( const Project& project_,
if ( att != NULL) if ( att != NULL)
{ {
if ( att->value == "intermediate" ) if ( att->value == "intermediate" )
this->path = Environment::GetIntermediatePath () + sSep + path; this->path = "$(INTERMEDIATE)" + sSep + path;
else if ( att->value == "output" ) else if ( att->value == "output" )
this->path = Environment::GetOutputPath () + sSep + path; this->path = "$(OUTPUT)" + sSep + path;
else else
{ {
throw InvalidAttributeValueException ( throw InvalidAttributeValueException (

View file

@ -121,7 +121,6 @@ GetSubPath (
const Project& project, const Project& project,
const string& location, const string& location,
const string& path, const string& path,
const XMLAttribute* root,
const string& att_value ) const string& att_value )
{ {
if ( !att_value.size() ) if ( !att_value.size() )
@ -135,25 +134,7 @@ GetSubPath (
if ( !path.size() ) if ( !path.size() )
return att_value; return att_value;
string path_prefix; return FixSeparator(path + cSep + att_value);
if ( root )
{
if ( root->value == "intermediate" )
path_prefix = Environment::GetIntermediatePath() + cSep;
else if ( root->value == "output" )
path_prefix = Environment::GetOutputPath() + cSep;
else
{
throw InvalidAttributeValueException (
location,
"root",
root->value );
}
}
else
path_prefix = "";
return FixSeparator(path_prefix + path + cSep + att_value);
} }
string string
@ -540,7 +521,7 @@ Module::ProcessXML()
for ( i = 0; i < node.subElements.size(); i++ ) for ( i = 0; i < node.subElements.size(); i++ )
{ {
ParseContext parseContext; ParseContext parseContext;
ProcessXMLSubElement ( *node.subElements[i], path, parseContext ); ProcessXMLSubElement ( *node.subElements[i], path, "", parseContext );
} }
for ( i = 0; i < invocations.size(); i++ ) for ( i = 0; i < invocations.size(); i++ )
invocations[i]->ProcessXML (); invocations[i]->ProcessXML ();
@ -564,12 +545,14 @@ Module::ProcessXML()
void void
Module::ProcessXMLSubElement ( const XMLElement& e, Module::ProcessXMLSubElement ( const XMLElement& e,
const string& path, const string& path,
const string& path_prefix,
ParseContext& parseContext ) ParseContext& parseContext )
{ {
If* pOldIf = parseContext.ifData; If* pOldIf = parseContext.ifData;
CompilationUnit* pOldCompilationUnit = parseContext.compilationUnit; CompilationUnit* pOldCompilationUnit = parseContext.compilationUnit;
bool subs_invalid = false; bool subs_invalid = false;
string subpath ( path ); string subpath ( path );
string subpath_prefix ( "" );
if ( e.name == "file" && e.value.size () > 0 ) if ( e.name == "file" && e.value.size () > 0 )
{ {
bool first = false; bool first = false;
@ -601,6 +584,7 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
cplusplus = true; cplusplus = true;
} }
File* pFile = new File ( FixSeparator ( path + cSep + e.value ), File* pFile = new File ( FixSeparator ( path + cSep + e.value ),
path_prefix,
first, first,
switches, switches,
false ); false );
@ -638,9 +622,23 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
else if ( e.name == "directory" ) else if ( e.name == "directory" )
{ {
const XMLAttribute* att = e.GetAttribute ( "name", true ); const XMLAttribute* att = e.GetAttribute ( "name", true );
const XMLAttribute* base = e.GetAttribute ( "root", false ); const XMLAttribute* root = e.GetAttribute ( "root", false );
assert(att); assert(att);
subpath = GetSubPath ( this->project, e.location, path, base, att->value ); if ( root )
{
if ( root->value == "intermediate" )
subpath_prefix = "$(INTERMEDIATE)";
else if ( root->value == "output" )
subpath_prefix = "$(OUTPUT)";
else
{
throw InvalidAttributeValueException (
e.location,
"root",
root->value );
}
}
subpath = GetSubPath ( this->project, e.location, path, att->value );
} }
else if ( e.name == "include" ) else if ( e.name == "include" )
{ {
@ -809,7 +807,7 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
e.name.c_str() ); e.name.c_str() );
} }
for ( size_t i = 0; i < e.subElements.size (); i++ ) for ( size_t i = 0; i < e.subElements.size (); i++ )
ProcessXMLSubElement ( *e.subElements[i], subpath, parseContext ); ProcessXMLSubElement ( *e.subElements[i], subpath, subpath_prefix, parseContext );
parseContext.ifData = pOldIf; parseContext.ifData = pOldIf;
parseContext.compilationUnit = pOldCompilationUnit; parseContext.compilationUnit = pOldCompilationUnit;
} }
@ -1206,10 +1204,26 @@ Module::InvokeModule () const
} }
File::File ( const string& _name, bool _first, File::File ( const string& _name,
bool _first,
std::string _switches, std::string _switches,
bool _isPreCompiledHeader ) bool _isPreCompiledHeader )
: name(_name), : name(_name),
path_prefix(""),
first(_first),
switches(_switches),
isPreCompiledHeader(_isPreCompiledHeader)
{
}
File::File ( const string& _name,
const string& _path_prefix,
bool _first,
std::string _switches,
bool _isPreCompiledHeader )
: name(_name),
path_prefix(_path_prefix),
first(_first), first(_first),
switches(_switches), switches(_switches),
isPreCompiledHeader(_isPreCompiledHeader) isPreCompiledHeader(_isPreCompiledHeader)
@ -1222,6 +1236,15 @@ File::ProcessXML()
} }
std::string File::GetFullPath () const
{
if ( path_prefix.length () > 0 )
return path_prefix + sSep + name;
else
return name;
}
Library::Library ( const XMLElement& _node, Library::Library ( const XMLElement& _node,
const Module& _module, const Module& _module,
const string& _name ) const string& _name )

View file

@ -391,9 +391,8 @@ Project::ProcessXMLSubElement ( const XMLElement& e,
else if ( e.name == "directory" ) else if ( e.name == "directory" )
{ {
const XMLAttribute* att = e.GetAttribute ( "name", true ); const XMLAttribute* att = e.GetAttribute ( "name", true );
const XMLAttribute* base = e.GetAttribute ( "root", false );
assert(att); assert(att);
subpath = GetSubPath ( *this, e.location, path, base, att->value ); subpath = GetSubPath ( *this, e.location, path, att->value );
} }
else if ( e.name == "include" ) else if ( e.name == "include" )
{ {

View file

@ -119,12 +119,12 @@ public:
const std::string& parent ); const std::string& parent );
private: private:
bool mkdir_p ( const char* path ); bool mkdir_p ( const char* path );
std::string ReplaceVariable ( std::string name, std::string ReplaceVariable ( const std::string& name,
std::string value, const std::string& value,
std::string path ); std::string path );
std::string GetEnvironmentVariable ( const std::string& name ); std::string GetEnvironmentVariable ( const std::string& name );
void ResolveVariablesInPath ( char* buf, void ResolveVariablesInPath ( char* buf,
std::string path ); const std::string& path );
bool CreateDirectory ( std::string path ); bool CreateDirectory ( std::string path );
}; };
@ -354,6 +354,7 @@ private:
std::string entrypoint; std::string entrypoint;
void ProcessXMLSubElement ( const XMLElement& e, void ProcessXMLSubElement ( const XMLElement& e,
const std::string& path, const std::string& path,
const std::string& path_prefix,
ParseContext& parseContext ); ParseContext& parseContext );
}; };
@ -388,10 +389,10 @@ class Define
public: public:
const Project& project; const Project& project;
const Module* module; const Module* module;
const XMLElement* node; const XMLElement* node;
std::string name; std::string name;
std::string value; std::string value;
std::string backend; std::string backend;
Define ( const Project& project, Define ( const Project& project,
const XMLElement& defineNode ); const XMLElement& defineNode );
@ -413,6 +414,7 @@ class File
{ {
public: public:
std::string name; std::string name;
std::string path_prefix;
bool first; bool first;
std::string switches; std::string switches;
bool isPreCompiledHeader; bool isPreCompiledHeader;
@ -422,7 +424,14 @@ public:
std::string _switches, std::string _switches,
bool _isPreCompiledHeader ); bool _isPreCompiledHeader );
File ( const std::string& _name,
const std::string& _path_prefix,
bool _first,
std::string _switches,
bool _isPreCompiledHeader );
void ProcessXML(); void ProcessXML();
std::string GetFullPath () const;
}; };
@ -629,11 +638,11 @@ private:
void WriteHooksFile ( Module& module ); void WriteHooksFile ( Module& module );
std::string GetStubsFilename ( Module& module ); std::string GetStubsFilename ( Module& module );
char* WriteStubbedSymbolToStubsFile ( char* buffer, char* WriteStubbedSymbolToStubsFile ( char* buffer,
const StubbedComponent& component, const StubbedComponent& component,
const StubbedSymbol& symbol, const StubbedSymbol& symbol,
int stubIndex ); int stubIndex );
char* WriteStubbedComponentToStubsFile ( char* buffer, char* WriteStubbedComponentToStubsFile ( char* buffer,
const StubbedComponent& component, const StubbedComponent& component,
int* stubIndex ); int* stubIndex );
void WriteStubsFile ( Module& module ); void WriteStubsFile ( Module& module );
std::string GetStartupFilename ( Module& module ); std::string GetStartupFilename ( Module& module );
@ -641,9 +650,9 @@ private:
std::string GetTestDispatcherName ( std::string filename ); std::string GetTestDispatcherName ( std::string filename );
bool IsTestFile ( std::string& filename ) const; bool IsTestFile ( std::string& filename ) const;
void GetSourceFilenames ( string_list& list, void GetSourceFilenames ( string_list& list,
Module& module ) const; Module& module ) const;
char* WriteTestDispatcherPrototypesToStartupFile ( char* buffer, char* WriteTestDispatcherPrototypesToStartupFile ( char* buffer,
Module& module ); Module& module );
char* WriteRegisterTestsFunctionToStartupFile ( char* buffer, char* WriteRegisterTestsFunctionToStartupFile ( char* buffer,
Module& module ); Module& module );
void WriteStartupFile ( Module& module ); void WriteStartupFile ( Module& module );
@ -740,18 +749,22 @@ public:
private: private:
void GetModulesToCheck ( Module& module, std::vector<const Module*>& modules ); void GetModulesToCheck ( Module& module, std::vector<const Module*>& modules );
void CheckAutomaticDependencies ( const Module& module, void CheckAutomaticDependencies ( const Module& module,
bool verbose ); bool verbose );
void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile ); void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile );
void GetIncludeDirectories ( std::vector<Include*>& includes, void GetIncludeDirectories ( std::vector<Include*>& includes,
const Module& module, const Module& module,
Include& currentDirectory, Include& currentDirectory,
bool searchCurrentDirectory ); bool searchCurrentDirectory );
void GetModuleFiles ( const Module& module, void GetModuleFiles ( const Module& module,
std::vector<File*>& files ) const; std::vector<File*>& files ) const;
void ParseFiles (); void ParseFiles ();
void ParseFiles ( const Module& module ); void ParseFiles ( const Module& module );
void ParseFile ( const Module& module, void ParseFile ( const Module& module,
const File& file ); const File& file );
std::string ReplaceVariable ( const std::string& name,
const std::string& value,
std::string path );
std::string ResolveVariablesInPath ( const std::string& path );
std::map<std::string, SourceFile*> sourcefile_map; std::map<std::string, SourceFile*> sourcefile_map;
}; };
@ -994,7 +1007,6 @@ GetSubPath (
const Project& project, const Project& project,
const std::string& location, const std::string& location,
const std::string& path, const std::string& path,
const XMLAttribute* root,
const std::string& att_value ); const std::string& att_value );
extern std::string extern std::string

View file

@ -111,7 +111,7 @@ WineResource::UnpackResourcesInModule ( Module& module,
NormalizeFilename ( resourceFilename ).c_str () ); NormalizeFilename ( resourceFilename ).c_str () );
string command = FixSeparatorForSystemCommand(bin2res) + " " + parameters; string command = FixSeparatorForSystemCommand(bin2res) + " " + parameters;
Directory( outputDirectory ).GenerateTree( ".", false ); Directory( relativeDirectory ).GenerateTree( Environment::GetIntermediatePath(), false );
int exitcode = system ( command.c_str () ); int exitcode = system ( command.c_str () );
if ( exitcode != 0 ) if ( exitcode != 0 )