ENH: backup of work in progress

This commit is contained in:
Ken Martin 2005-05-05 12:45:53 -04:00
parent a9b729128f
commit c2cd47b32c
4 changed files with 3873 additions and 0 deletions

View File

@ -0,0 +1,469 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator3
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "cmGlobalUnixMakefileGenerator3.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmake.h"
#include "cmGeneratedFileStream.h"
cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3()
{
// This type of makefile always requires unix style paths
m_ForceUnixPaths = true;
m_FindMakeProgramFile = "CMakeUnixFindMake.cmake";
}
void cmGlobalUnixMakefileGenerator3
::EnableLanguage(std::vector<std::string>const& languages, cmMakefile *mf)
{
mf->AddDefinition("CMAKE_CFG_INTDIR",".");
this->cmGlobalGenerator::EnableLanguage(languages, mf);
std::string path;
for(std::vector<std::string>::const_iterator l = languages.begin();
l != languages.end(); ++l)
{
const char* lang = l->c_str();
std::string langComp = "CMAKE_";
langComp += lang;
langComp += "_COMPILER";
if(!mf->GetDefinition(langComp.c_str()))
{
cmSystemTools::Error(langComp.c_str(), " not set, after EnableLanguage");
continue;
}
const char* cc = mf->GetRequiredDefinition(langComp.c_str());
path = cmSystemTools::FindProgram(cc);
if(path.size() == 0)
{
std::string message = "your ";
message += lang;
message += " compiler: ";
if(cc)
{
message += cc;
}
else
{
message += "(NULL)";
}
message += " was not found in your path. "
"For CMake to correctly use try compile commands, the compiler must "
"be in your path. Please add the compiler to your PATH environment,"
" and re-run CMake.";
cmSystemTools::Error(message.c_str());
}
}
}
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator *cmGlobalUnixMakefileGenerator3::CreateLocalGenerator()
{
cmLocalGenerator* lg = new cmLocalUnixMakefileGenerator3;
lg->SetGlobalGenerator(this);
return lg;
}
//----------------------------------------------------------------------------
void cmGlobalUnixMakefileGenerator3::GetDocumentation(cmDocumentationEntry& entry) const
{
entry.name = this->GetName();
entry.brief = "Generates standard UNIX makefiles.";
entry.full =
"A hierarchy of UNIX makefiles is generated into the build tree. Any "
"standard UNIX-style make program can build the project through the "
"default make target. A \"make install\" target is also provided.";
}
//----------------------------------------------------------------------------
void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
{
// Open the output file. This should not be copy-if-different
// because the check-build-system step compares the makefile time to
// see if the build system must be regenerated.
std::string cmakefileName = this->GetCMakeInstance()->GetHomeOutputDirectory();
cmakefileName += "/Makefile.cmake";
std::string makefileName = this->GetCMakeInstance()->GetHomeOutputDirectory();
makefileName += "/Makefile";
cmGeneratedFileStream cmakefileStream(cmakefileName.c_str());
if(!cmakefileStream)
{
return;
}
// get a local generator for some useful methods
cmLocalUnixMakefileGenerator3 *lg =
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[0]);
// Write the do not edit header.
lg->WriteDisclaimer(cmakefileStream);
// for each cmMakefile get its list of dependencies
unsigned int i;
std::vector<std::string> lfiles;
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
// Get the list of files contributing to this generation step.
lfiles.insert(lfiles.end(),lg->GetMakefile()->GetListFiles().begin(),
lg->GetMakefile()->GetListFiles().end());
}
// Sort the list and remove duplicates.
std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>());
std::vector<std::string>::iterator new_end =
std::unique(lfiles.begin(),lfiles.end());
lfiles.erase(new_end, lfiles.end());
// reset lg to the first makefile
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[0]);
// Build the path to the cache file.
std::string cache = this->GetCMakeInstance()->GetHomeOutputDirectory();
cache += "/CMakeCache.txt";
// Save the list to the cmake file.
cmakefileStream
<< "# The top level Makefile was generated from the following files:\n"
<< "SET(CMAKE_MAKEFILE_DEPENDS\n"
<< " \"" << lg->ConvertToRelativePath(cache.c_str()).c_str() << "\"\n";
for(std::vector<std::string>::const_iterator i = lfiles.begin();
i != lfiles.end(); ++i)
{
cmakefileStream
<< " \"" << lg->ConvertToRelativePath(i->c_str()).c_str()
<< "\"\n";
}
cmakefileStream
<< " )\n\n";
// Build the path to the cache check file.
std::string check = this->GetCMakeInstance()->GetHomeOutputDirectory();
check += "/cmake.check_cache";
// Set the corresponding makefile in the cmake file.
cmakefileStream
<< "# The corresponding makefile is:\n"
<< "SET(CMAKE_MAKEFILE_OUTPUTS\n"
<< " \"" << lg->ConvertToRelativePath(makefileName.c_str()).c_str() << "\"\n"
<< " \"" << lg->ConvertToRelativePath(check.c_str()).c_str() << "\"\n";
// add in all the directory information files
std::string tmpStr;
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
tmpStr = lg->GetMakefile()->GetStartOutputDirectory();
tmpStr += "/CMakeDirectoryInformation.cmake";
cmakefileStream
<< " \"" << this->ConvertToHomeRelativePath(tmpStr.c_str()).c_str() << "\"\n";
}
cmakefileStream << " )\n\n";
// now write all the language stuff
// Set the set of files to check for dependency integrity.
// loop over all of the local generators to collect this
std::set<cmStdString> checkSetLangs;
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
std::map<cmStdString,cmLocalUnixMakefileGenerator3::IntegrityCheckSet>& checkSet =
lg->GetIntegrityCheckSet();
for(std::map<cmStdString,
cmLocalUnixMakefileGenerator3::IntegrityCheckSet>::const_iterator
l = checkSet.begin(); l != checkSet.end(); ++l)
{
checkSetLangs.insert(l->first);
}
}
// list the languages
cmakefileStream
<< "# The set of files whose dependency integrity should be checked:\n";
cmakefileStream
<< "SET(CMAKE_DEPENDS_LANGUAGES\n";
for(std::set<cmStdString>::iterator
l = checkSetLangs.begin(); l != checkSetLangs.end(); ++l)
{
cmakefileStream << " \"" << l->c_str() << "\"\n";
}
cmakefileStream << " )\n";
// now list the files for each language
for(std::set<cmStdString>::iterator
l = checkSetLangs.begin(); l != checkSetLangs.end(); ++l)
{
cmakefileStream
<< "SET(CMAKE_DEPENDS_CHECK_" << l->c_str() << "\n";
// now for each local gen get the checkset
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
// get the check set for this local gen and language
cmLocalUnixMakefileGenerator3::IntegrityCheckSet iCheckSet =
lg->GetIntegrityCheckSet()[*l];
// for each file
for(cmLocalUnixMakefileGenerator3::IntegrityCheckSet::const_iterator csIter =
iCheckSet.begin();
csIter != iCheckSet.end(); ++csIter)
{
cmakefileStream
<< " \"" << this->ConvertToHomeRelativePath(csIter->c_str()).c_str() << "\"\n";
}
}
cmakefileStream << " )\n";
}
}
void cmGlobalUnixMakefileGenerator3::WriteMainMakefile()
{
// Open the output file. This should not be copy-if-different
// because the check-build-system step compares the makefile time to
// see if the build system must be regenerated.
std::string makefileName = this->GetCMakeInstance()->GetHomeOutputDirectory();
makefileName += "/Makefile";
cmGeneratedFileStream makefileStream(makefileName.c_str());
if(!makefileStream)
{
return;
}
// get a local generator for some useful methods
cmLocalUnixMakefileGenerator3 *lg =
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[0]);
// Write the do not edit header.
lg->WriteDisclaimer(makefileStream);
// Write the main entry point target. This must be the VERY first
// target so that make with no arguments will run it.
// Just depend on the all target to drive the build.
std::vector<std::string> depends;
std::vector<std::string> no_commands;
depends.push_back("all");
// Write the rule.
lg->WriteMakeRule(makefileStream,
"Default target executed when no arguments are "
"given to make.",
"default_target",
depends,
no_commands);
lg->WriteMakeVariables(makefileStream);
lg->WriteSpecialTargetsTop(makefileStream);
lg->WriteAllRules(makefileStream);
// Write special "cmake_check_build_system" target to run cmake with
// the --check-build-system flag.
// Build command to run CMake to check if anything needs regenerating.
std::string cmakefileName = makefileName;
cmakefileName += ".cmake";
std::string runRule = this->GetCMakeInstance()->GetCacheDefinition("CMAKE_COMMAND");
runRule += " -H";
runRule += this->GetCMakeInstance()->GetHomeDirectory();
runRule += " -B";
runRule += this->GetCMakeInstance()->GetHomeOutputDirectory();
runRule += " --check-build-system ";
runRule += lg->ConvertToRelativeOutputPath(cmakefileName.c_str());
std::vector<std::string> no_depends;
std::vector<std::string> commands;
commands.push_back(runRule);
lg->WriteMakeRule(makefileStream,
"Special rule to run CMake to check the build system "
"integrity.\n"
"No rule that depends on this can have "
"commands that come from listfiles\n"
"because they might be regenerated.",
"cmake_check_build_system",
no_depends,
commands);
// write the target convenience rules
unsigned int i;
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
lg = static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
lg->WriteConvenienceRules(makefileStream);
}
}
void cmGlobalUnixMakefileGenerator3::WriteSupportMakefiles()
{
this->WriteDependMakefile();
this->WriteBuildMakefile();
this->WriteCleanMakefile();
}
void cmGlobalUnixMakefileGenerator3::WriteDependMakefile()
{
unsigned int i;
// Open the output file. This should not be copy-if-different
// because the check-build-system step compares the makefile time to
// see if the build system must be regenerated.
std::string makefileName = this->GetCMakeInstance()->GetHomeOutputDirectory();
makefileName += "/depend.make";
cmGeneratedFileStream makefileStream(makefileName.c_str());
if(!makefileStream)
{
return;
}
// get a local generator for some useful methods
cmLocalUnixMakefileGenerator3 *lg =
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[0]);
// Write the do not edit header.
lg->WriteDisclaimer(makefileStream);
lg->WriteMakeVariables(makefileStream);
// add the generic dependency
std::vector<std::string> depends;
std::vector<std::string> no_commands;
lg->WriteMakeRule(makefileStream, 0, "depend", depends, no_commands);
// include the build rules
makefileStream
<< "# Include make rules for build targets\n";
makefileStream
<< lg->GetIncludeDirective() << " "
<< lg->ConvertToOutputForExisting("build.make").c_str()
<< "\n\n";
// include all the target depends
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
cmLocalUnixMakefileGenerator3 *lg2 =
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
if (!lg2->GetExcludeAll())
{
lg2->WriteTargetIncludes(makefileStream,"depend.make","depend");
}
}
}
void cmGlobalUnixMakefileGenerator3::WriteBuildMakefile()
{
unsigned int i;
// Open the output file. This should not be copy-if-different
// because the check-build-system step compares the makefile time to
// see if the build system must be regenerated.
std::string makefileName = this->GetCMakeInstance()->GetHomeOutputDirectory();
makefileName += "/build.make";
cmGeneratedFileStream makefileStream(makefileName.c_str());
if(!makefileStream)
{
return;
}
// get a local generator for some useful methods
cmLocalUnixMakefileGenerator3 *lg =
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[0]);
// Write the do not edit header.
lg->WriteDisclaimer(makefileStream);
lg->WriteMakeVariables(makefileStream);
// add the generic dependency
std::vector<std::string> depends;
std::vector<std::string> no_commands;
lg->WriteMakeRule(makefileStream, 0, "build", depends, no_commands);
// include all the target depends
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
cmLocalUnixMakefileGenerator3 *lg2 =
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
// are any parents excluded
bool exclude = false;
cmLocalGenerator *lg3 = lg2;
while (lg3)
{
if (lg3->GetExcludeAll())
{
exclude = true;
break;
}
lg3 = lg3->GetParent();
}
if (!exclude)
{
lg2->WriteTargetIncludes(makefileStream,"build.make","build");
}
}
}
void cmGlobalUnixMakefileGenerator3::WriteCleanMakefile()
{
unsigned int i;
// Open the output file. This should not be copy-if-different
// because the check-build-system step compares the makefile time to
// see if the build system must be regenerated.
std::string makefileName = this->GetCMakeInstance()->GetHomeOutputDirectory();
makefileName += "/clean.make";
cmGeneratedFileStream makefileStream(makefileName.c_str());
if(!makefileStream)
{
return;
}
// get a local generator for some useful methods
cmLocalUnixMakefileGenerator3 *lg =
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[0]);
// Write the do not edit header.
lg->WriteDisclaimer(makefileStream);
lg->WriteMakeVariables(makefileStream);
// add the generic dependency
std::vector<std::string> depends;
std::vector<std::string> no_commands;
lg->WriteMakeRule(makefileStream, 0, "clean", depends, no_commands);
// include all the target depends
for (i = 0; i < m_LocalGenerators.size(); ++i)
{
cmLocalUnixMakefileGenerator3 *lg2 =
static_cast<cmLocalUnixMakefileGenerator3 *>(m_LocalGenerators[i]);
lg2->WriteTargetIncludes(makefileStream,"clean.make","clean");
// add the directory based rules
lg2->WriteLocalCleanRule(makefileStream);
}
}
//----------------------------------------------------------------------------
void cmGlobalUnixMakefileGenerator3::Generate()
{
// first do superclass method
this->cmGlobalGenerator::Generate();
// write the main makefile
this->WriteMainMakefile();
this->WriteMainCMakefile();
// now write the support Makefiles
this->WriteSupportMakefiles();
}

View File

@ -0,0 +1,67 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator3
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2005 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef cmGlobalUnixMakefileGenerator3_h
#define cmGlobalUnixMakefileGenerator3_h
#include "cmGlobalGenerator.h"
/** \class cmGlobalUnixMakefileGenerator3
* \brief Write a Unix makefiles.
*
* cmGlobalUnixMakefileGenerator3 manages UNIX build process for a tree
*/
class cmGlobalUnixMakefileGenerator3 : public cmGlobalGenerator
{
public:
cmGlobalUnixMakefileGenerator3();
static cmGlobalGenerator* New() { return new cmGlobalUnixMakefileGenerator3; }
///! Get the name for the generator.
virtual const char* GetName() const {
return cmGlobalUnixMakefileGenerator3::GetActualName();}
static const char* GetActualName() {return "Unix Makefiles 3";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
///! Create a local generator appropriate to this Global Generator3
virtual cmLocalGenerator *CreateLocalGenerator();
/**
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *);
/**
* Generate the all required files for building this project/tree. This
* basically creates a series of LocalGenerators for each directory and
* requests that they Generate.
*/
virtual void Generate();
protected:
void WriteMainMakefile();
void WriteMainCMakefile();
void WriteDependMakefile();
void WriteBuildMakefile();
void WriteCleanMakefile();
void WriteSupportMakefiles();
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,296 @@
/*=========================================================================
Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile$
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef cmLocalUnixMakefileGenerator3_h
#define cmLocalUnixMakefileGenerator3_h
#include "cmLocalGenerator.h"
class cmCustomCommand;
class cmDependInformation;
class cmDepends;
class cmMakeDepend;
class cmTarget;
class cmSourceFile;
/** \class cmLocalUnixMakefileGenerator3
* \brief Write a LocalUnix makefiles.
*
* cmLocalUnixMakefileGenerator3 produces a LocalUnix makefile from its
* member m_Makefile.
*/
class cmLocalUnixMakefileGenerator3 : public cmLocalGenerator
{
public:
///! Set cache only and recurse to false by default.
cmLocalUnixMakefileGenerator3();
virtual ~cmLocalUnixMakefileGenerator3();
/** Set the command used when there are no dependencies or rules for
a target. This is used to avoid errors on some make
implementations. */
void SetEmptyCommand(const char* cmd);
/** Set whether the echo command needs its argument quoted. */
void SetEchoNeedsQuote(bool b) { m_EchoNeedsQuote = b; }
/**
* Set to true if the shell being used is the windows shell.
* This controls if statements in the makefile and the SHELL variable.
* The default is false.
*/
void SetWindowsShell(bool v) {m_WindowsShell = v;}
/**
* Set the string used to include one makefile into another default
* is include.
*/
void SetIncludeDirective(const char* s) { m_IncludeDirective = s; }
const char *GetIncludeDirective() { return m_IncludeDirective.c_str(); }
/**
* Set the flag used to keep the make program silent.
*/
void SetMakeSilentFlag(const char* s) { m_MakeSilentFlag = s; }
/**
* Set max makefile variable size, default is 0 which means unlimited.
*/
void SetMakefileVariableSize(int s) { m_MakefileVariableSize = s; }
/**
* If ignore lib prefix is true, then do not strip lib from the name
* of a library.
*/
void SetIgnoreLibPrefix(bool s) { m_IgnoreLibPrefix = s; }
/**
* If true, then explicitly pass MAKEFLAGS on the make all target for makes
* that do not use environment variables.
*
*/
void SetPassMakeflags(bool s){m_PassMakeflags = s;}
/**
* Generate the makefile for this directory.
*/
virtual void Generate();
/** Called from command-line hook to scan dependencies. */
static bool ScanDependencies(std::vector<std::string> const& args);
/** Called from command-line hook to check dependencies. */
static void CheckDependencies(cmMakefile* mf);
void WriteDisclaimer(std::ostream& os);
void WriteMakeRule(std::ostream& os,
const char* comment,
const char* target,
const std::vector<std::string>& depends,
const std::vector<std::string>& commands);
void WriteAllRules(std::ostream& makefileStream);
void WriteTargetIncludes(std::ostream& makefileStream,const char *file,
const char *rule);
void WriteSpecialTargetsTop(std::ostream& makefileStream);
void WriteSpecialTargetsBottom(std::ostream& makefileStream);
void WriteMakeVariables(std::ostream& makefileStream);
std::string ConvertToRelativeOutputPath(const char* p);
void WriteConvenienceRules(std::ostream& ruleFileStream);
std::string GetRelativeTargetDirectory(const cmTarget& target);
void WriteLocalCleanRule(std::ostream& makefileStream);
// this returns the relative path between the HomeOutputDirectory and this
// local generators StartOutputDirectory
std::string GetHomeRelativeOutputPath();
// List the files for which to check dependency integrity. Each
// language has its own list because integrity may be checked
// differently.
struct IntegrityCheckSet: public std::set<cmStdString> {};
std::map<cmStdString, IntegrityCheckSet> &GetIntegrityCheckSet()
{ return m_CheckDependFiles;}
protected:
void GenerateMakefile();
void GenerateCMakefile();
void GenerateDirectoryInformationFile();
void GenerateTargetRuleFile(const cmTarget& target);
void GenerateObjectRuleFile(const cmTarget& target,
const cmSourceFile& source,
std::vector<std::string>& objects,
std::vector<std::string>& provides_requires);
void GenerateObjectDependFile(const std::string& obj,
const cmSourceFile& source,
std::vector<std::string>& objects,
std::vector<std::string>& provides_requires,
const std::string& depMarkFile,
std::vector<std::string>& depends);
void GenerateCustomRuleFile(const cmCustomCommand& cc);
void GenerateUtilityRuleFile(const cmTarget& target);
bool GenerateDependsMakeFile(const std::string& lang,
const char* objFile,
std::string& depMakeFile,
std::string& depMarkFile);
void WriteDivider(std::ostream& os);
void WriteRuleFileIncludes(std::ostream& makefileStream);
void WriteSubdirRules(std::ostream& makefileStream, const char* pass);
void WriteSubdirRule(std::ostream& makefileStream, const char* pass,
const char* subdir, std::string& last);
void WriteSubdirDriverRule(std::ostream& makefileStream, const char* pass,
const char* order, const std::string& last);
void WriteLocalRule(std::ostream& ruleFileStream, const char* pass,
const char* dependency);
void WriteConvenienceRule(std::ostream& ruleFileStream,
const char* realTarget,
const char* helpTarget);
void WriteCustomCommands();
void WriteExecutableRule(std::ostream& ruleFileStream,
const char* ruleFileName,
const cmTarget& target,
const std::vector<std::string>& objects,
const std::vector<std::string>& external_objects,
const std::vector<std::string>& provides_requires);
void WriteStaticLibraryRule(std::ostream& ruleFileStream,
const char* ruleFileName,
const cmTarget& target,
const std::vector<std::string>& objects,
const std::vector<std::string>& external_objects,
const std::vector<std::string>& provides_requires);
void WriteSharedLibraryRule(std::ostream& ruleFileStream,
const char* ruleFileName,
const cmTarget& target,
const std::vector<std::string>& objects,
const std::vector<std::string>& external_objects,
const std::vector<std::string>& provides_requires);
void WriteModuleLibraryRule(std::ostream& ruleFileStream,
const char* ruleFileName,
const cmTarget& target,
const std::vector<std::string>& objects,
const std::vector<std::string>& external_objects,
const std::vector<std::string>& provides_requires);
void WriteLibraryRule(std::ostream& ruleFileStream,
const char* ruleFileName,
const cmTarget& target,
const std::vector<std::string>& objects,
const std::vector<std::string>& external_objects,
const char* linkRuleVar,
const char* extraLinkFlags,
const std::vector<std::string>& provides_requires);
void WriteObjectsVariable(std::ostream& ruleFileStream,
const cmTarget& target,
const std::vector<std::string>& objects,
const std::vector<std::string>& external_objects,
std::string& variableName,
std::string& variableNameExternal);
void WriteTargetDependRule(const char* ruleFileName,
const cmTarget& target,
const std::vector<std::string>& objects);
void WriteTargetCleanRule(const char *ruleFileName,
const cmTarget& target,
const std::vector<std::string>& files,
const std::vector<std::string>& objects,
const std::vector<std::string>& external_objects);
void WriteTargetRequiresRule(std::ostream& ruleFileStream,
const cmTarget& target,
const std::vector<std::string>& provides_requires);
void WriteCMakeArgument(std::ostream& os, const char* s);
std::string GetTargetDirectory(const cmTarget& target);
std::string GetSubdirTargetName(const char* pass, const char* subdir);
std::string GetObjectFileName(const cmTarget& target,
const cmSourceFile& source);
const char* GetSourceFileLanguage(const cmSourceFile& source);
std::string ConvertToFullPath(const std::string& localPath);
std::string ConvertToQuotedOutputPath(const char* p);
void ConfigureOutputPaths();
void FormatOutputPath(std::string& path, const char* name);
void AppendTargetDepends(std::vector<std::string>& depends,
const cmTarget& target);
void AppendAnyDepend(std::vector<std::string>& depends, const char* name,
bool assume_unknown_is_file=false);
void AppendRuleDepend(std::vector<std::string>& depends,
const char* ruleFileName);
void AppendCustomDepends(std::vector<std::string>& depends,
const std::vector<cmCustomCommand>& ccs);
void AppendCustomDepend(std::vector<std::string>& depends,
const cmCustomCommand& cc);
void AppendCustomCommands(std::vector<std::string>& commands,
const std::vector<cmCustomCommand>& ccs);
void AppendCustomCommand(std::vector<std::string>& commands,
const cmCustomCommand& cc);
void AppendCleanCommand(std::vector<std::string>& commands,
const std::vector<std::string>& files);
void AppendEcho(std::vector<std::string>& commands,
const char* text);
//==========================================================================
bool SamePath(const char* path1, const char* path2);
std::string ConvertToMakeTarget(const char* tgt);
std::string& CreateSafeUniqueObjectFileName(const char* sin);
std::string CreateMakeVariable(const char* sin, const char* s2in);
//==========================================================================
std::string GetRecursiveMakeCall(const char *makefile, const char* tgt);
void WriteJumpAndBuildRules(std::ostream& makefileStream);
static cmDepends* GetDependsChecker(const std::string& lang,
const char* dir,
const char* objFile);
private:
// Map from target name to build directory containing it for
// jump-and-build targets.
struct RemoteTarget
{
std::string m_BuildDirectory;
std::string m_FilePath;
};
std::map<cmStdString, RemoteTarget> m_JumpAndBuild;
std::map<cmStdString, IntegrityCheckSet> m_CheckDependFiles;
// Command used when a rule has no dependencies or commands.
std::vector<std::string> m_EmptyCommands;
//==========================================================================
// Configuration settings.
int m_MakefileVariableSize;
std::map<cmStdString, cmStdString> m_MakeVariableMap;
std::map<cmStdString, cmStdString> m_ShortMakeVariableMap;
std::map<cmStdString, cmStdString> m_UniqueObjectNamesMap;
std::string m_IncludeDirective;
std::string m_MakeSilentFlag;
std::string m_ExecutableOutputPath;
std::string m_LibraryOutputPath;
bool m_PassMakeflags;
//==========================================================================
// Flag for whether echo command needs quotes.
bool m_EchoNeedsQuote;
// List of make rule files that need to be included by the makefile.
std::vector<std::string> m_IncludeRuleFiles;
// Set of custom rule files that have been generated.
std::set<cmStdString> m_CustomRuleFiles;
// Set of object file names that will be built in this directory.
std::set<cmStdString> m_ObjectFiles;
};
#endif