diff options
author | Brad King <brad.king@kitware.com> | 2013-12-18 21:39:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-12-20 14:35:20 (GMT) |
commit | bd11de085757f170c5880d99291048b9f512a120 (patch) | |
tree | 26183dc20d16c8118633b1add7ae1417145ec5ee /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 2a384e08cc0809fec75ebb20be585fb5a1bf591a (diff) | |
download | CMake-bd11de085757f170c5880d99291048b9f512a120.zip CMake-bd11de085757f170c5880d99291048b9f512a120.tar.gz CMake-bd11de085757f170c5880d99291048b9f512a120.tar.bz2 |
Makefile: Allow "gmake target1 target2 -j" (#14312)
Add the .NOTPARALLEL target to each local Makefile command-line
interface entry point file so that even with -j we launch only
one "make -f Makefile2" at a time. The actual build rules
in Makefile2 and lower will still run in parallel.
Do not add .NOTPARALLEL for Borland or Watcom make tools because
they do not tolerate it. Other make tools that do not understand
.NOTPARALLEL will not be hurt.
Suggested-by: Robert Luberda <robert-cmake@debian.org>
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 6ca386c..ec1d2c4 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1686,6 +1686,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); |