+/*
+ * 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.
+ */
#ifndef __RBUILD_H
#define __RBUILD_H
#define SBAD_SEP "\\"
#endif
+#define MS_VS_DEF_VERSION "7.10"
+
class Project;
class IfableData;
class Module;
bool Verbose;
bool CleanAsYouGo;
bool AutomaticDependencies;
+ bool CheckDependenciesForModuleOnly;
+ std::string CheckDependenciesForModuleOnlyModule;
+ std::string VSProjectVersion;
bool MakeHandlesInstallDirectories;
bool GenerateProxyMakefilesInSourceTree;
};
LiveIso = 14,
Test = 15,
RpcServer = 16,
- RpcClient = 17
+ RpcClient = 17,
+ Alias = 18
};
enum HostType
const XMLElement& node;
std::string xmlbuildFile;
std::string name;
+ std::string guid;
std::string extension;
std::string entrypoint;
std::string baseaddress;
ModuleType type;
ImportLibrary* importLibrary;
bool mangledSymbols;
+ bool isUnicode;
Bootstrap* bootstrap;
IfableData non_if_data;
std::vector<Invoke*> invocations;
HostType host;
std::string installBase;
std::string installName;
+ std::string aliasedModuleName;
bool useWRC;
- bool enableWarnings;
+ bool allowWarnings;
bool enabled;
Module ( const Project& project,
bool HasImportLibrary () const;
bool IsDLL () const;
bool GenerateInOutputTree () const;
- std::string GetTargetName () const;
- std::string GetDependencyPath () const;
- std::string GetBasePath () const;
- std::string GetPath () const;
- std::string GetPathWithPrefix ( const std::string& prefix ) const;
+ std::string GetTargetName () const; // "foo.exe"
+ std::string GetDependencyPath () const; // "path/foo.exe" or "path/libfoo.a"
+ std::string GetBasePath () const; // "path"
+ std::string GetPath () const; // "path/foo.exe"
+ std::string GetPathWithPrefix ( const std::string& prefix ) const; // "path/prefixfoo.exe"
void GetTargets ( string_list& ) const;
std::string GetInvocationTarget ( const int index ) const;
bool HasFileWithExtension ( const IfableData&, const std::string& extension ) const;
public:
const Project& project;
const Module* module;
- const XMLElement& node;
+ const XMLElement* node;
+ const Module* baseModule;
std::string directory;
std::string basePath;
Include ( const Project& project,
- const XMLElement& includeNode );
+ const XMLElement* includeNode );
Include ( const Project& project,
const Module* module,
- const XMLElement& includeNode );
+ const XMLElement* includeNode );
+ Include ( const Project& project,
+ std::string directory,
+ std::string basePath );
~Include ();
void ProcessXML();
private:
- void Initialize();
};
const XMLElement& node;
const Module& module;
std::string name;
- const Module* imported_module;
+ const Module* importedModule;
Library ( const XMLElement& _node,
const Module& _module,
const XMLElement& node;
const Project& project;
const Module* module;
+ const bool negated;
std::string property, value;
IfableData data;
If ( const XMLElement& node_,
const Project& project_,
- const Module* module_ );
+ const Module* module_,
+ const bool negated_ = false );
~If();
void ProcessXML();
int* stubIndex );
void WriteStubsFile ( Module& module );
std::string GetStartupFilename ( Module& module );
+ bool IsUnknownCharacter ( char ch );
std::string GetTestDispatcherName ( std::string filename );
bool IsTestFile ( std::string& filename ) const;
void GetSourceFilenames ( string_list& list,
{
public:
SourceFile ( AutomaticDependency* automaticDependency,
- Module& module,
+ const Module& module,
const std::string& filename,
SourceFile* parent,
bool isNonAutomaticDependency );
std::string Location () const;
std::vector<SourceFile*> files;
AutomaticDependency* automaticDependency;
- Module& module;
+ const Module& module;
std::string filename;
std::string filenamePart;
std::string directoryPart;
void Open ();
void SkipWhitespace ();
bool ReadInclude ( std::string& filename,
+ bool& searchCurrentDirectory,
bool& includeNext );
bool IsIncludedFrom ( const std::string& normalizedFilename );
SourceFile* GetParentSourceFile ();
AutomaticDependency ( const Project& project );
~AutomaticDependency ();
- void Process ();
std::string GetFilename ( const std::string& filename );
bool LocateIncludedFile ( const std::string& directory,
const std::string& includedFilename,
std::string& resolvedFilename );
bool LocateIncludedFile ( SourceFile* sourceFile,
- Module& module,
+ const Module& module,
const std::string& includedFilename,
+ bool searchCurrentDirectory,
bool includeNext,
std::string& resolvedFilename );
- SourceFile* RetrieveFromCacheOrParse ( Module& module,
+ SourceFile* RetrieveFromCacheOrParse ( const Module& module,
const std::string& filename,
SourceFile* parentSourceFile );
SourceFile* RetrieveFromCache ( const std::string& filename );
void CheckAutomaticDependencies ( bool verbose );
- void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile );
+ void CheckAutomaticDependenciesForModule ( Module& module,
+ bool verbose );
private:
- void GetModuleFiles ( Module& module,
+ void GetModulesToCheck ( Module& module, std::vector<const Module*>& modules );
+ void CheckAutomaticDependencies ( const Module& module,
+ bool verbose );
+ void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile );
+ void GetIncludeDirectories ( std::vector<Include*>& includes,
+ const Module& module,
+ Include& currentDirectory,
+ bool searchCurrentDirectory );
+ void GetModuleFiles ( const Module& module,
std::vector<File*>& files ) const;
- void ProcessModule ( Module& module );
- void ProcessFile ( Module& module,
- const File& file );
+ void ParseFiles ();
+ void ParseFiles ( const Module& module );
+ void ParseFile ( const Module& module,
+ const File& file );
std::map<std::string, SourceFile*> sourcefile_map;
};
std::string StripSymbol ( std::string symbol );
};
+extern std::string
+Right ( const std::string& s, size_t n );
+
+extern std::string
+Replace ( const std::string& s, const std::string& find, const std::string& with );
+
extern std::string
FixSeparator ( const std::string& s );
+extern std::string
+DosSeparator ( const std::string& s );
+
extern std::string
ReplaceExtension (
const std::string& filename,