diff options
-rw-r--r-- | Source/cmGlobalBorlandMakefileGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalWatcomWMakeGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 11 |
4 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h index bd3db3e..70004ea 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.h +++ b/Source/cmGlobalBorlandMakefileGenerator.h @@ -44,6 +44,8 @@ public: */ virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); + + virtual bool AllowNotParallel() const { return false; } }; #endif diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index 986d1d7..00a86eb 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -125,6 +125,9 @@ public: const std::string &workingDirectory, const std::string &compileCommand); + /** Does the make tool tolerate .NOTPARALLEL? */ + virtual bool AllowNotParallel() const { return true; } + protected: void WriteMainMakefile2(); void WriteMainCMakefile(); diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h index 23e60a1..d5350ef 100644 --- a/Source/cmGlobalWatcomWMakeGenerator.h +++ b/Source/cmGlobalWatcomWMakeGenerator.h @@ -43,6 +43,8 @@ public: */ virtual void EnableLanguage(std::vector<std::string>const& languages, cmMakefile *, bool optional); + + virtual bool AllowNotParallel() const { return false; } }; #endif diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 7e97f78..20e8eea 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1685,6 +1685,17 @@ void cmLocalUnixMakefileGenerator3 "default_target", depends, no_commands, true); + + // Help out users that try "gmake target1 target2 -j". + cmGlobalUnixMakefileGenerator3* gg = + static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator); + if(gg->AllowNotParallel()) + { + std::vector<std::string> no_depends; + this->WriteMakeRule(ruleFileStream, + "Allow only one \"make -f Makefile2\" at a time, but pass parallelism.", + ".NOTPARALLEL", no_depends, no_commands, true); + } } this->WriteSpecialTargetsTop(ruleFileStream); |