diff options
author | Brad King <brad.king@kitware.com> | 2003-08-07 15:42:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2003-08-07 15:42:02 (GMT) |
commit | 3cdde6177681fe384cd132bc73fb7dd31ec3f805 (patch) | |
tree | 4ac8f785eb88876af56e3b08f2c00804144c72a3 /Source/cmLocalUnixMakefileGenerator.cxx | |
parent | 4a1412b0cb0af4d0e6c58f4555f69f9693af0581 (diff) | |
download | CMake-3cdde6177681fe384cd132bc73fb7dd31ec3f805.zip CMake-3cdde6177681fe384cd132bc73fb7dd31ec3f805.tar.gz CMake-3cdde6177681fe384cd132bc73fb7dd31ec3f805.tar.bz2 |
ENH: Makefiles now have rules to do a global generate if the CMake listfiles have changed. Necessary for when try-compiles are added to a listfile.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index e7bf258..20d1aaa 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -2368,23 +2368,27 @@ void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) } } + std::string checkCache = m_Makefile->GetHomeOutputDirectory(); + checkCache += "/cmake.check_cache"; + checkCache = cmSystemTools::ConvertToOutputPath(checkCache.c_str()); + std::vector<std::string> cmake_depends; + cmake_depends.push_back(checkCache); + cmake_depends.push_back("$(CMAKE_MAKEFILE_SOURCES)"); + this->OutputMakeRule(fout, "dependencies.", "cmake.depends", - "$(CMAKE_MAKEFILE_SOURCES)", + cmake_depends, "$(CMAKE_COMMAND) " "-S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) " - "-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)" - ); - std::vector<std::string> commands; - commands.push_back("$(CMAKE_COMMAND) " - "-S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) " - "-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"); + "-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"); this->OutputMakeRule(fout, "dependencies", "cmake.check_depends", allsources, - commands); + "$(CMAKE_COMMAND) " + "-S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) " + "-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"); this->OutputMakeRule(fout, "dependencies", @@ -2401,24 +2405,24 @@ void cmLocalUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) "-S$(CMAKE_CURRENT_SOURCE) -O$(CMAKE_CURRENT_BINARY) " "-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"); - this->OutputMakeRule(fout, + this->OutputMakeRule(fout, "CMakeCache.txt", "rebuild_cache", "$(CMAKE_BINARY_DIR)/CMakeCache.txt", "$(CMAKE_COMMAND) " "-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"); - std::string checkCache = m_Makefile->GetHomeOutputDirectory(); - checkCache += "/cmake.check_cache"; - checkCache = cmSystemTools::ConvertToOutputPath(checkCache.c_str()); + std::vector<std::string> check_cache_depends; std::string CMakeCache = m_Makefile->GetHomeOutputDirectory(); CMakeCache += "/CMakeCache.txt"; CMakeCache = cmSystemTools::ConvertToOutputPath(CMakeCache.c_str()); + check_cache_depends.push_back(CMakeCache); + check_cache_depends.push_back("$(CMAKE_MAKEFILE_SOURCES)"); this->OutputMakeRule(fout, "CMakeCache.txt because out-of-date:", checkCache.c_str(), - CMakeCache.c_str(), + check_cache_depends, "$(CMAKE_COMMAND) " "-H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)"); // if CMAKE_EDIT_COMMAND is defined then add a rule to run it @@ -2794,6 +2798,20 @@ void cmLocalUnixMakefileGenerator::OutputMakeRule(std::ostream& fout, const char* comment, const char* target, const std::vector<std::string>& depends, + const char* command) +{ + std::vector<std::string> commands; + if(command) + { + commands.push_back(command); + } + this->OutputMakeRule(fout, comment, target, depends, commands); +} + +void cmLocalUnixMakefileGenerator::OutputMakeRule(std::ostream& fout, + const char* comment, + const char* target, + const std::vector<std::string>& depends, const std::vector<std::string>& commands) { if(!target) |