diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2006-01-02 17:36:54 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2006-01-02 17:36:54 (GMT) |
commit | 61e056e2dc20af29d8a58e5fa9e7ea6c2b67c747 (patch) | |
tree | 1db8d3308c22842b6e0ba2353967ba46e3430ce2 /Source | |
parent | 1d9ef3f8b59cd5dee9932cb09060d1b40faa648c (diff) | |
download | CMake-61e056e2dc20af29d8a58e5fa9e7ea6c2b67c747.zip CMake-61e056e2dc20af29d8a58e5fa9e7ea6c2b67c747.tar.gz CMake-61e056e2dc20af29d8a58e5fa9e7ea6c2b67c747.tar.bz2 |
BUG: fix for bug 2533, make foo/foo.o now works and .o files are in the help
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 8 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 20 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.h | 7 |
3 files changed, 26 insertions, 9 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 38ab153..1f1c723 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -894,6 +894,14 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule } } } + std::map<cmStdString,std::vector<cmTarget *> >& objs = lg->GetLocalObjectFiles(); + for(std::map<cmStdString,std::vector<cmTarget *> >::iterator o = + objs.begin(); o != objs.end(); ++o) + { + path = "... "; + path += o->first; + lg->AppendEcho(commands, path.c_str()); + } } } lg->WriteMakeRule(ruleFileStream, "Help Target", diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index e387465..7eb32d2 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -721,8 +721,8 @@ cmLocalUnixMakefileGenerator3 } // Get the full path name of the object file. - std::string obj = this->GetObjectFileName(target, source); - + std::string objNoTargetDir; + std::string obj = this->GetObjectFileName(target, source, &objNoTargetDir); // Avoid generating duplicate rules. if(m_ObjectFiles.find(obj) == m_ObjectFiles.end()) { @@ -749,7 +749,6 @@ cmLocalUnixMakefileGenerator3 objects.push_back(obj); std::string relativeObj = this->GetHomeRelativeOutputPath(); relativeObj += obj; - // we compute some depends when writing the depend.make that we will also // use in the build.make, same with depMakeFile std::vector<std::string> depends; @@ -761,9 +760,12 @@ cmLocalUnixMakefileGenerator3 // The object file should be checked for dependency integrity. m_CheckDependFiles[target.GetName()][lang].insert(&source); - // add this to the list of objects for this local generator - m_LocalObjectFiles[cmSystemTools::GetFilenameName(obj)].push_back(&target); + if(cmSystemTools::FileIsFullPath(objNoTargetDir.c_str())) + { + objNoTargetDir = cmSystemTools::GetFilenameName(objNoTargetDir); + } + m_LocalObjectFiles[objNoTargetDir].push_back(&target); } //---------------------------------------------------------------------------- @@ -2124,7 +2126,8 @@ cmLocalUnixMakefileGenerator3 std::string cmLocalUnixMakefileGenerator3 ::GetObjectFileName(cmTarget& target, - const cmSourceFile& source) + const cmSourceFile& source, + std::string* nameWithoutTargetDir) { // If the full path to the source file includes this directory, // we want to use the relative path for the filename of the @@ -2152,11 +2155,14 @@ cmLocalUnixMakefileGenerator3 // Convert to a safe name. objectName = this->CreateSafeUniqueObjectFileName(objectName.c_str()); - // Prepend the target directory. std::string obj = this->GetTargetDirectory(target); obj += "/"; obj += objectName; + if(nameWithoutTargetDir) + { + *nameWithoutTargetDir = objectName; + } return obj; } diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index 247efe8..5dfd86e 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -169,7 +169,9 @@ public: // write the target rules for the local Makefile into the stream void WriteLocalAllRules(std::ostream& ruleFileStream); - + + std::map<cmStdString,std::vector<cmTarget *> > GetLocalObjectFiles() + { return m_LocalObjectFiles;} protected: // Return the a string with -F flags on apple std::string GetFrameworkFlags(cmTarget&); @@ -320,7 +322,8 @@ protected: std::string GetTargetDirectory(cmTarget& target); std::string GetSubdirTargetName(const char* pass, const char* subdir); std::string GetObjectFileName(cmTarget& target, - const cmSourceFile& source); + const cmSourceFile& source, + std::string* nameWithoutTargetDir = 0); const char* GetSourceFileLanguage(const cmSourceFile& source); std::string ConvertToQuotedOutputPath(const char* p); |