Hello all.

This patch allows to run parallel builds for CMake-based ports.
Yes, it works. At least, for me. :) Tested on a few KDE4 ports.

It definitely needs bulk build test - anyone?

If bulk will pass fine, I'll push the patch upstream.

--
  WBR,
    Vadim Zhukov


Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/cmake/Makefile,v
retrieving revision 1.80
diff -u -p -r1.80 Makefile
--- Makefile    13 May 2013 15:02:26 -0000      1.80
+++ Makefile    19 May 2013 14:26:19 -0000
@@ -12,7 +12,7 @@ HOMEPAGE =    http://www.cmake.org/
 CATEGORIES =   devel
 COMMENT =      portable build system
 DISTNAME =     cmake-2.8.10.2
-REVISION =     5
+REVISION =     6
 MASTER_SITES = ${HOMEPAGE}files/v2.8/
 
 MAINTAINER =   David Coppa <[email protected]>
Index: patches/patch-Source_cmGlobalUnixMakefileGenerator3_cxx
===================================================================
RCS file: patches/patch-Source_cmGlobalUnixMakefileGenerator3_cxx
diff -N patches/patch-Source_cmGlobalUnixMakefileGenerator3_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmGlobalUnixMakefileGenerator3_cxx     19 May 2013 
14:26:19 -0000
@@ -0,0 +1,139 @@
+$OpenBSD$
+Add support for .CHEAP in our make to allow parallel builds.
+--- Source/cmGlobalUnixMakefileGenerator3.cxx.orig     Sun May 19 17:23:39 2013
++++ Source/cmGlobalUnixMakefileGenerator3.cxx  Sun May 19 17:33:44 2013
+@@ -212,6 +212,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile
+                     "Default target executed when no arguments are "
+                     "given to make.",
+                     "default_target",
++                    false,
+                     depends,
+                     no_commands, true);
+ 
+@@ -227,12 +228,12 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile
+   // Write and empty all:
+   lg->WriteMakeRule(makefileStream,
+                     "The main recursive all target", "all",
+-                    depends, no_commands, true);
++                    false, depends, no_commands, true);
+ 
+   // Write an empty preinstall:
+   lg->WriteMakeRule(makefileStream,
+                     "The main recursive preinstall target", "preinstall",
+-                    depends, no_commands, true);
++                    false, depends, no_commands, true);
+ 
+   // Write out the "special" stuff
+   lg->WriteSpecialTargetsTop(makefileStream);
+@@ -480,7 +481,7 @@ cmGlobalUnixMakefileGenerator3
+   doc += "\" pass in the directory.";
+   std::vector<std::string> no_commands;
+   lg->WriteMakeRule(ruleFileStream, doc.c_str(),
+-                    makeTarget.c_str(), depends, no_commands, true);
++                    makeTarget.c_str(), false, depends, no_commands, true);
+ }
+ 
+ //----------------------------------------------------------------------------
+@@ -632,7 +633,7 @@ cmGlobalUnixMakefileGenerator3
+         depends.push_back("cmake_check_build_system");
+         lg->WriteMakeRule(ruleFileStream,
+                           "Build rule for target.",
+-                          t->second.GetName(), depends, commands,
++                          t->second.GetName(), true, depends, commands,
+                           true);
+ 
+         // Add a fast rule to build the target
+@@ -649,7 +650,7 @@ cmGlobalUnixMakefileGenerator3
+         commands.push_back(lg->GetRecursiveMakeCall
+                             (makefileName.c_str(), makeTargetName.c_str()));
+         lg->WriteMakeRule(ruleFileStream, "fast build rule for target.",
+-                          localName.c_str(), depends, commands, true);
++                          localName.c_str(), true, depends, commands, true);
+ 
+         // Add a local name for the rule to relink the target before
+         // installation.
+@@ -665,7 +666,7 @@ cmGlobalUnixMakefileGenerator3
+                              (makefileName.c_str(), makeTargetName.c_str()));
+           lg->WriteMakeRule(ruleFileStream,
+                             "Manual pre-install relink rule for target.",
+-                            localName.c_str(), depends, commands, true);
++                            localName.c_str(), true, depends, commands, true);
+           }
+         }
+       }
+@@ -765,7 +766,7 @@ cmGlobalUnixMakefileGenerator3
+ 
+       this->AppendGlobalTargetDepends(depends,t->second);
+       lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
+-                        localName.c_str(), depends, commands, true);
++                        localName.c_str(), false, depends, commands, true);
+ 
+       // add the all/all dependency
+       if(!this->IsExcluded(this->LocalGenerators[0], t->second))
+@@ -774,7 +775,7 @@ cmGlobalUnixMakefileGenerator3
+         depends.push_back(localName);
+         commands.clear();
+         lg->WriteMakeRule(ruleFileStream, "Include target in all.",
+-                          "all", depends, commands, true);
++                          "all", false, depends, commands, true);
+         }
+ 
+       // Write the rule.
+@@ -815,14 +816,14 @@ cmGlobalUnixMakefileGenerator3
+       localName += "/rule";
+       lg->WriteMakeRule(ruleFileStream,
+                         "Build rule for subdir invocation for target.",
+-                        localName.c_str(), depends, commands, true);
++                        localName.c_str(), true, depends, commands, true);
+ 
+       // Add a target with the canonical name (no prefix, suffix or path).
+       commands.clear();
+       depends.clear();
+       depends.push_back(localName);
+       lg->WriteMakeRule(ruleFileStream, "Convenience name for target.",
+-                        t->second.GetName(), depends, commands, true);
++                        t->second.GetName(), true, depends, commands, true);
+ 
+       // Add rules to prepare the target for installation.
+       if(t->second.NeedRelinkBeforeInstall(lg->ConfigurationName.c_str()))
+@@ -835,7 +836,7 @@ cmGlobalUnixMakefileGenerator3
+                             (makefileName.c_str(), localName.c_str()));
+         lg->WriteMakeRule(ruleFileStream,
+                           "Pre-install relink rule for target.",
+-                          localName.c_str(), depends, commands, true);
++                          localName.c_str(), true, depends, commands, true);
+ 
+         if(!this->IsExcluded(this->LocalGenerators[0], t->second))
+           {
+@@ -843,7 +844,7 @@ cmGlobalUnixMakefileGenerator3
+           depends.push_back(localName);
+           commands.clear();
+           lg->WriteMakeRule(ruleFileStream, "Prepare target for install.",
+-                            "preinstall", depends, commands, true);
++                            "preinstall", true, depends, commands, true);
+           }
+         }
+ 
+@@ -856,11 +857,11 @@ cmGlobalUnixMakefileGenerator3
+       commands.push_back(lg->GetRecursiveMakeCall
+                           (makefileName.c_str(), makeTargetName.c_str()));
+       lg->WriteMakeRule(ruleFileStream, "clean rule for target.",
+-                        makeTargetName.c_str(), depends, commands, true);
++                        makeTargetName.c_str(), true, depends, commands, 
true);
+       commands.clear();
+       depends.push_back(makeTargetName);
+       lg->WriteMakeRule(ruleFileStream, "clean rule for target.",
+-                        "clean", depends, commands, true);
++                        "clean", true, depends, commands, true);
+       }
+     }
+ }
+@@ -1034,7 +1035,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
+     }
+   lg->WriteMakeRule(ruleFileStream, "Help Target",
+                     "help",
+-                    no_depends, commands, true);
++                    true, no_depends, commands, true);
+   ruleFileStream << "\n\n";
+ }
+ 
Index: patches/patch-Source_cmLocalUnixMakefileGenerator3_cxx
===================================================================
RCS file: patches/patch-Source_cmLocalUnixMakefileGenerator3_cxx
diff -N patches/patch-Source_cmLocalUnixMakefileGenerator3_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmLocalUnixMakefileGenerator3_cxx      19 May 2013 
14:26:19 -0000
@@ -0,0 +1,201 @@
+$OpenBSD$
+Add support for .CHEAP in our make to allow parallel builds.
+--- Source/cmLocalUnixMakefileGenerator3.cxx.orig      Tue Nov 27 17:26:33 2012
++++ Source/cmLocalUnixMakefileGenerator3.cxx   Sun May 19 18:14:19 2013
+@@ -335,7 +335,7 @@ cmLocalUnixMakefileGenerator3
+     depends.push_back(output);
+     std::vector<std::string> no_commands;
+     this->WriteMakeRule(ruleFileStream, 0,
+-                        outNoExt.c_str(), depends, no_commands, true, true);
++                        outNoExt.c_str(), true, depends, no_commands, true, 
true);
+     inHelp = false;
+     }
+ 
+@@ -361,7 +361,7 @@ cmLocalUnixMakefileGenerator3
+   // Write the rule to the makefile.
+   std::vector<std::string> no_depends;
+   this->WriteMakeRule(ruleFileStream, comment,
+-                      output, no_depends, commands, true, inHelp);
++                      output, true, no_depends, commands, true, inHelp);
+ }
+ 
+ //----------------------------------------------------------------------------
+@@ -402,7 +402,7 @@ void cmLocalUnixMakefileGenerator3
+                             this->Makefile->GetHomeOutputDirectory(),
+                             cmLocalGenerator::START_OUTPUT);
+       this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
+-                          localName.c_str(), depends, commands, true);
++                          localName.c_str(), true, depends, commands, true);
+ 
+       // Add a target with the canonical name (no prefix, suffix or path).
+       if(localName != t->second.GetName())
+@@ -410,7 +410,7 @@ void cmLocalUnixMakefileGenerator3
+         commands.clear();
+         depends.push_back(localName);
+         this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
+-                            t->second.GetName(), depends, commands, true);
++                            t->second.GetName(), true, depends, commands, 
true);
+         }
+ 
+       // Add a fast rule to build the target
+@@ -430,7 +430,7 @@ void cmLocalUnixMakefileGenerator3
+                             this->Makefile->GetHomeOutputDirectory(),
+                             cmLocalGenerator::START_OUTPUT);
+       this->WriteMakeRule(ruleFileStream, "fast build rule for target.",
+-                          localName.c_str(), depends, commands, true);
++                          localName.c_str(), true, depends, commands, true);
+ 
+       // Add a local name for the rule to relink the target before
+       // installation.
+@@ -449,7 +449,7 @@ void cmLocalUnixMakefileGenerator3
+                               cmLocalGenerator::START_OUTPUT);
+         this->WriteMakeRule(ruleFileStream,
+                             "Manual pre-install relink rule for target.",
+-                            localName.c_str(), depends, commands, true);
++                            localName.c_str(), true, depends, commands, true);
+         }
+       }
+     }
+@@ -539,6 +539,7 @@ cmLocalUnixMakefileGenerator3
+ ::WriteMakeRule(std::ostream& os,
+                 const char* comment,
+                 const char* target,
++                bool is_cheap,
+                 const std::vector<std::string>& depends,
+                 const std::vector<std::string>& commands,
+                 bool symbolic,
+@@ -579,6 +580,10 @@ cmLocalUnixMakefileGenerator3
+     space = " ";
+     }
+ 
++  // Mark rule as "cheap" or "expensive" on OpenBSD
++  os << (is_cheap ? ".CHEAP" : ".EXPENSIVE");
++  os << ":" << space << cmMakeSafe(tgt) << "\n";
++
+   // Mark the rule as symbolic if requested.
+   if(symbolic)
+     {
+@@ -743,7 +748,7 @@ cmLocalUnixMakefileGenerator3
+   // the interface Makefile.
+   this->WriteMakeRule(
+     makefileStream, "Disable implicit rules so canonical targets will work.",
+-    ".SUFFIXES", no_depends, no_commands, false);
++    ".SUFFIXES", false, no_depends, no_commands, false);
+ 
+   if(!this->NMake && !this->WatcomWMake && !this->BorlandMakeCurlyHack)
+     {
+@@ -756,7 +761,7 @@ cmLocalUnixMakefileGenerator3
+   std::vector<std::string> depends;
+   depends.push_back(".hpux_make_needs_suffix_list");
+   this->WriteMakeRule(makefileStream, 0,
+-                      ".SUFFIXES", depends, no_commands, false);
++                      ".SUFFIXES", false, depends, no_commands, false);
+ 
+   cmGlobalUnixMakefileGenerator3* gg =
+     static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
+@@ -782,6 +787,7 @@ cmLocalUnixMakefileGenerator3
+     this->WriteMakeRule(makefileStream,
+                         "Suppress display of executed commands.",
+                         "$(VERBOSE).SILENT",
++                        false,
+                         no_depends,
+                         no_commands, false);
+     }
+@@ -804,7 +810,7 @@ cmLocalUnixMakefileGenerator3
+   this->WriteMakeRule
+     (makefileStream,
+      "A target that is always out of date.",
+-     "cmake_force", no_depends, no_commands, true);
++     "cmake_force", true, no_depends, no_commands, true);
+ 
+   // Variables for reference by other rules.
+   this->WriteMakeVariables(makefileStream);
+@@ -847,6 +853,7 @@ void cmLocalUnixMakefileGenerator3
+                       "commands that come from listfiles\n"
+                       "because they might be regenerated.",
+                       "cmake_check_build_system",
++                      false,
+                       no_depends,
+                       commands, true);
+   }
+@@ -873,7 +880,7 @@ cmLocalUnixMakefileGenerator3
+ 
+     // Write the rule.
+     this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
+-                        helpTarget, depends, no_commands, true);
++                        helpTarget, true, depends, no_commands, true);
+     }
+ }
+ 
+@@ -1682,6 +1689,7 @@ void cmLocalUnixMakefileGenerator3
+                       "Default target executed when no arguments are "
+                       "given to make.",
+                       "default_target",
++                      false,
+                       depends,
+                       no_commands, true);
+   }
+@@ -1734,7 +1742,7 @@ void cmLocalUnixMakefileGenerator3
+                                  cmLocalGenerator::START_OUTPUT);
+       std::string targetName = glIt->second.GetName();
+       this->WriteMakeRule(ruleFileStream, targetString.c_str(),
+-                          targetName.c_str(), depends, commands, true);
++                          targetName.c_str(), false, depends, commands, true);
+ 
+       // Provide a "/fast" version of the target.
+       depends.clear();
+@@ -1754,7 +1762,7 @@ void cmLocalUnixMakefileGenerator3
+         }
+       targetName += "/fast";
+       this->WriteMakeRule(ruleFileStream, targetString.c_str(),
+-                          targetName.c_str(), depends, commands, true);
++                          targetName.c_str(), false, depends, commands, true);
+       }
+     }
+ 
+@@ -1804,7 +1812,7 @@ void cmLocalUnixMakefileGenerator3
+     commands.push_back(progCmd.str());
+     }
+   this->WriteMakeRule(ruleFileStream, "The main all target", "all",
+-                      depends, commands, true);
++                      false, depends, commands, true);
+ 
+   // Write the clean rule.
+   recursiveTarget = this->Makefile->GetStartOutputDirectory();
+@@ -1817,12 +1825,12 @@ void cmLocalUnixMakefileGenerator3
+                                 this->Makefile->GetHomeOutputDirectory(),
+                                 cmLocalGenerator::START_OUTPUT);
+   this->WriteMakeRule(ruleFileStream, "The main clean target", "clean",
+-                      depends, commands, true);
++                      false, depends, commands, true);
+   commands.clear();
+   depends.clear();
+   depends.push_back("clean");
+   this->WriteMakeRule(ruleFileStream, "The main clean target", "clean/fast",
+-                      depends, commands, true);
++                      false, depends, commands, true);
+ 
+   // Write the preinstall rule.
+   recursiveTarget = this->Makefile->GetStartOutputDirectory();
+@@ -1847,10 +1855,10 @@ void cmLocalUnixMakefileGenerator3
+                         this->Makefile->GetHomeOutputDirectory(),
+                         cmLocalGenerator::START_OUTPUT);
+   this->WriteMakeRule(ruleFileStream, "Prepare targets for installation.",
+-                      "preinstall", depends, commands, true);
++                      "preinstall", false, depends, commands, true);
+   depends.clear();
+   this->WriteMakeRule(ruleFileStream, "Prepare targets for installation.",
+-                      "preinstall/fast", depends, commands, true);
++                      "preinstall/fast", false, depends, commands, true);
+ 
+   // write the depend rule, really a recompute depends rule
+   depends.clear();
+@@ -1869,7 +1877,7 @@ void cmLocalUnixMakefileGenerator3
+                         cmLocalGenerator::START_OUTPUT);
+   this->WriteMakeRule(ruleFileStream, "clear depends",
+                       "depend",
+-                      depends, commands, true);
++                      false, depends, commands, true);
+ }
+ 
+ 
Index: patches/patch-Source_cmLocalUnixMakefileGenerator3_cxx.orig
===================================================================
RCS file: patches/patch-Source_cmLocalUnixMakefileGenerator3_cxx.orig
diff -N patches/patch-Source_cmLocalUnixMakefileGenerator3_cxx.orig
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmLocalUnixMakefileGenerator3_cxx.orig 19 May 2013 
14:26:19 -0000
@@ -0,0 +1,200 @@
+$OpenBSD$
+Add support for .CHEAP in our make to allow parallel builds.
+--- Source/cmLocalUnixMakefileGenerator3.cxx.orig      Tue Nov 27 17:26:33 2012
++++ Source/cmLocalUnixMakefileGenerator3.cxx   Sun May 19 17:56:10 2013
+@@ -335,7 +335,7 @@ cmLocalUnixMakefileGenerator3
+     depends.push_back(output);
+     std::vector<std::string> no_commands;
+     this->WriteMakeRule(ruleFileStream, 0,
+-                        outNoExt.c_str(), depends, no_commands, true, true);
++                        outNoExt.c_str(), true, depends, no_commands, true, 
true);
+     inHelp = false;
+     }
+ 
+@@ -361,7 +361,7 @@ cmLocalUnixMakefileGenerator3
+   // Write the rule to the makefile.
+   std::vector<std::string> no_depends;
+   this->WriteMakeRule(ruleFileStream, comment,
+-                      output, no_depends, commands, true, inHelp);
++                      output, true, no_depends, commands, true, inHelp);
+ }
+ 
+ //----------------------------------------------------------------------------
+@@ -402,7 +402,7 @@ void cmLocalUnixMakefileGenerator3
+                             this->Makefile->GetHomeOutputDirectory(),
+                             cmLocalGenerator::START_OUTPUT);
+       this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
+-                          localName.c_str(), depends, commands, true);
++                          localName.c_str(), true, depends, commands, true);
+ 
+       // Add a target with the canonical name (no prefix, suffix or path).
+       if(localName != t->second.GetName())
+@@ -410,7 +410,7 @@ void cmLocalUnixMakefileGenerator3
+         commands.clear();
+         depends.push_back(localName);
+         this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
+-                            t->second.GetName(), depends, commands, true);
++                            t->second.GetName(), true, depends, commands, 
true);
+         }
+ 
+       // Add a fast rule to build the target
+@@ -430,7 +430,7 @@ void cmLocalUnixMakefileGenerator3
+                             this->Makefile->GetHomeOutputDirectory(),
+                             cmLocalGenerator::START_OUTPUT);
+       this->WriteMakeRule(ruleFileStream, "fast build rule for target.",
+-                          localName.c_str(), depends, commands, true);
++                          localName.c_str(), true, depends, commands, true);
+ 
+       // Add a local name for the rule to relink the target before
+       // installation.
+@@ -449,7 +449,7 @@ void cmLocalUnixMakefileGenerator3
+                               cmLocalGenerator::START_OUTPUT);
+         this->WriteMakeRule(ruleFileStream,
+                             "Manual pre-install relink rule for target.",
+-                            localName.c_str(), depends, commands, true);
++                            localName.c_str(), true, depends, commands, true);
+         }
+       }
+     }
+@@ -539,6 +539,7 @@ cmLocalUnixMakefileGenerator3
+ ::WriteMakeRule(std::ostream& os,
+                 const char* comment,
+                 const char* target,
++                bool is_cheap,
+                 const std::vector<std::string>& depends,
+                 const std::vector<std::string>& commands,
+                 bool symbolic,
+@@ -589,6 +590,9 @@ cmLocalUnixMakefileGenerator3
+       }
+     }
+ 
++  // Mark rule as "cheap" or "expensive" on OpenBSD
++  os << space << (is_cheap ? ".CHEAP" : ".EXPENSIVE");
++
+   // Write the rule.
+   if(depends.empty())
+     {
+@@ -743,7 +747,7 @@ cmLocalUnixMakefileGenerator3
+   // the interface Makefile.
+   this->WriteMakeRule(
+     makefileStream, "Disable implicit rules so canonical targets will work.",
+-    ".SUFFIXES", no_depends, no_commands, false);
++    ".SUFFIXES", false, no_depends, no_commands, false);
+ 
+   if(!this->NMake && !this->WatcomWMake && !this->BorlandMakeCurlyHack)
+     {
+@@ -756,7 +760,7 @@ cmLocalUnixMakefileGenerator3
+   std::vector<std::string> depends;
+   depends.push_back(".hpux_make_needs_suffix_list");
+   this->WriteMakeRule(makefileStream, 0,
+-                      ".SUFFIXES", depends, no_commands, false);
++                      ".SUFFIXES", false, depends, no_commands, false);
+ 
+   cmGlobalUnixMakefileGenerator3* gg =
+     static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
+@@ -782,6 +786,7 @@ cmLocalUnixMakefileGenerator3
+     this->WriteMakeRule(makefileStream,
+                         "Suppress display of executed commands.",
+                         "$(VERBOSE).SILENT",
++                        false,
+                         no_depends,
+                         no_commands, false);
+     }
+@@ -804,7 +809,7 @@ cmLocalUnixMakefileGenerator3
+   this->WriteMakeRule
+     (makefileStream,
+      "A target that is always out of date.",
+-     "cmake_force", no_depends, no_commands, true);
++     "cmake_force", true, no_depends, no_commands, true);
+ 
+   // Variables for reference by other rules.
+   this->WriteMakeVariables(makefileStream);
+@@ -847,6 +852,7 @@ void cmLocalUnixMakefileGenerator3
+                       "commands that come from listfiles\n"
+                       "because they might be regenerated.",
+                       "cmake_check_build_system",
++                      false,
+                       no_depends,
+                       commands, true);
+   }
+@@ -873,7 +879,7 @@ cmLocalUnixMakefileGenerator3
+ 
+     // Write the rule.
+     this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
+-                        helpTarget, depends, no_commands, true);
++                        helpTarget, true, depends, no_commands, true);
+     }
+ }
+ 
+@@ -1682,6 +1688,7 @@ void cmLocalUnixMakefileGenerator3
+                       "Default target executed when no arguments are "
+                       "given to make.",
+                       "default_target",
++                      false,
+                       depends,
+                       no_commands, true);
+   }
+@@ -1734,7 +1741,7 @@ void cmLocalUnixMakefileGenerator3
+                                  cmLocalGenerator::START_OUTPUT);
+       std::string targetName = glIt->second.GetName();
+       this->WriteMakeRule(ruleFileStream, targetString.c_str(),
+-                          targetName.c_str(), depends, commands, true);
++                          targetName.c_str(), false, depends, commands, true);
+ 
+       // Provide a "/fast" version of the target.
+       depends.clear();
+@@ -1754,7 +1761,7 @@ void cmLocalUnixMakefileGenerator3
+         }
+       targetName += "/fast";
+       this->WriteMakeRule(ruleFileStream, targetString.c_str(),
+-                          targetName.c_str(), depends, commands, true);
++                          targetName.c_str(), false, depends, commands, true);
+       }
+     }
+ 
+@@ -1804,7 +1811,7 @@ void cmLocalUnixMakefileGenerator3
+     commands.push_back(progCmd.str());
+     }
+   this->WriteMakeRule(ruleFileStream, "The main all target", "all",
+-                      depends, commands, true);
++                      false, depends, commands, true);
+ 
+   // Write the clean rule.
+   recursiveTarget = this->Makefile->GetStartOutputDirectory();
+@@ -1817,12 +1824,12 @@ void cmLocalUnixMakefileGenerator3
+                                 this->Makefile->GetHomeOutputDirectory(),
+                                 cmLocalGenerator::START_OUTPUT);
+   this->WriteMakeRule(ruleFileStream, "The main clean target", "clean",
+-                      depends, commands, true);
++                      false, depends, commands, true);
+   commands.clear();
+   depends.clear();
+   depends.push_back("clean");
+   this->WriteMakeRule(ruleFileStream, "The main clean target", "clean/fast",
+-                      depends, commands, true);
++                      false, depends, commands, true);
+ 
+   // Write the preinstall rule.
+   recursiveTarget = this->Makefile->GetStartOutputDirectory();
+@@ -1847,10 +1854,10 @@ void cmLocalUnixMakefileGenerator3
+                         this->Makefile->GetHomeOutputDirectory(),
+                         cmLocalGenerator::START_OUTPUT);
+   this->WriteMakeRule(ruleFileStream, "Prepare targets for installation.",
+-                      "preinstall", depends, commands, true);
++                      "preinstall", false, depends, commands, true);
+   depends.clear();
+   this->WriteMakeRule(ruleFileStream, "Prepare targets for installation.",
+-                      "preinstall/fast", depends, commands, true);
++                      "preinstall/fast", false, depends, commands, true);
+ 
+   // write the depend rule, really a recompute depends rule
+   depends.clear();
+@@ -1869,7 +1876,7 @@ void cmLocalUnixMakefileGenerator3
+                         cmLocalGenerator::START_OUTPUT);
+   this->WriteMakeRule(ruleFileStream, "clear depends",
+                       "depend",
+-                      depends, commands, true);
++                      false, depends, commands, true);
+ }
+ 
+ 
Index: patches/patch-Source_cmLocalUnixMakefileGenerator3_h
===================================================================
RCS file: patches/patch-Source_cmLocalUnixMakefileGenerator3_h
diff -N patches/patch-Source_cmLocalUnixMakefileGenerator3_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmLocalUnixMakefileGenerator3_h        19 May 2013 
14:26:19 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+Add support for .CHEAP in our make to allow parallel builds.
+--- Source/cmLocalUnixMakefileGenerator3.h.orig        Sun May 19 14:47:23 2013
++++ Source/cmLocalUnixMakefileGenerator3.h     Sun May 19 17:20:51 2013
+@@ -56,6 +56,7 @@ class cmLocalUnixMakefileGenerator3 : public cmLocalGe
+   void WriteMakeRule(std::ostream& os,
+                      const char* comment,
+                      const char* target,
++                     bool is_cheap,
+                      const std::vector<std::string>& depends,
+                      const std::vector<std::string>& commands,
+                      bool symbolic,
Index: patches/patch-Source_cmMakefileExecutableTargetGenerator_cxx
===================================================================
RCS file: patches/patch-Source_cmMakefileExecutableTargetGenerator_cxx
diff -N patches/patch-Source_cmMakefileExecutableTargetGenerator_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmMakefileExecutableTargetGenerator_cxx        19 May 
2013 14:26:19 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+Add support for .CHEAP in our make to allow parallel builds.
+--- Source/cmMakefileExecutableTargetGenerator.cxx.orig        Sun May 19 
17:43:16 2013
++++ Source/cmMakefileExecutableTargetGenerator.cxx     Sun May 19 17:34:47 2013
+@@ -431,7 +431,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecuta
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream,
+                                       0,
+                                       targetFullPathReal.c_str(),
+-                                      depends, commands, false);
++                                      true, depends, commands, false);
+ 
+   // The symlink name for the target should depend on the real target
+   // so if the target version changes it rebuilds and recreates the
+@@ -443,7 +443,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecuta
+     depends.push_back(targetFullPathReal.c_str());
+     this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                         targetFullPath.c_str(),
+-                                        depends, commands, false);
++                                        true, depends, commands, false);
+     }
+ 
+   // Write the main driver rule to build everything in this target.
Index: patches/patch-Source_cmMakefileLibraryTargetGenerator_cxx
===================================================================
RCS file: patches/patch-Source_cmMakefileLibraryTargetGenerator_cxx
diff -N patches/patch-Source_cmMakefileLibraryTargetGenerator_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmMakefileLibraryTargetGenerator_cxx   19 May 2013 
14:26:19 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+Add support for .CHEAP in our make to allow parallel builds.
+--- Source/cmMakefileLibraryTargetGenerator.cxx.orig   Sun May 19 17:42:51 2013
++++ Source/cmMakefileLibraryTargetGenerator.cxx        Sun May 19 17:35:11 2013
+@@ -126,7 +126,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibr
+   // Write the rule.
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                       this->Target->GetName(),
+-                                      depends, commands, true);
++                                      true, depends, commands, true);
+ 
+   // Write the main driver rule to build everything in this target.
+   this->WriteTargetDriverRule(this->Target->GetName(), false);
+@@ -755,7 +755,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRul
+   // Write the build rule.
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                       targetFullPathReal.c_str(),
+-                                      depends, commands, false);
++                                      true, depends, commands, false);
+ 
+   // Some targets have more than one output file.  Create rules to
+   // drive the build if any extra outputs are missing.
Index: patches/patch-Source_cmMakefileTargetGenerator_cxx
===================================================================
RCS file: patches/patch-Source_cmMakefileTargetGenerator_cxx
diff -N patches/patch-Source_cmMakefileTargetGenerator_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmMakefileTargetGenerator_cxx  19 May 2013 14:26:19 
-0000
@@ -0,0 +1,124 @@
+$OpenBSD$
+Add support for .CHEAP in our make to allow parallel builds.
+--- Source/cmMakefileTargetGenerator.cxx.orig  Sun May 19 14:43:50 2013
++++ Source/cmMakefileTargetGenerator.cxx       Sun May 19 17:42:18 2013
+@@ -401,7 +401,7 @@ cmMakefileTargetGenerator::MacOSXContentGeneratorType:
+   this->Generator->LocalGenerator->WriteMakeRule(
+     *this->Generator->BuildFileStream, 0,
+     output.c_str(),
+-    depends, commands, false);
++    true, depends, commands, false);
+   this->Generator->ExtraFiles.insert(output);
+ }
+ 
+@@ -730,7 +730,7 @@ cmMakefileTargetGenerator
+   // Write the rule.
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                       relativeObj.c_str(),
+-                                      depends, commands, false);
++                                      true, depends, commands, false);
+ 
+   // Check for extra outputs created by the compilation.
+   if(const char* extra_outputs_str =
+@@ -818,7 +818,7 @@ cmMakefileTargetGenerator
+ 
+       this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                           relativeObjI.c_str(),
+-                                          force_depends, commands, false);
++                                          true, force_depends, commands, 
false);
+       }
+ 
+     if(do_assembly_rules)
+@@ -875,7 +875,7 @@ cmMakefileTargetGenerator
+ 
+       this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                           relativeObjS.c_str(),
+-                                          force_depends, commands, false);
++                                          true, force_depends, commands, 
false);
+       }
+     }
+ 
+@@ -886,8 +886,8 @@ cmMakefileTargetGenerator
+   std::vector<std::string> p_depends;
+   // always provide an empty requires target
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+-                                      objectRequires.c_str(), p_depends,
+-                                      no_commands, true);
++                                      objectRequires.c_str(), true,
++                                      p_depends, no_commands, true);
+ 
+   // write a build rule to recursively build what this obj provides
+   std::string objectProvides = relativeObj;
+@@ -905,14 +905,15 @@ cmMakefileTargetGenerator
+   p_depends.clear();
+   p_depends.push_back(objectRequires);
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+-                                      objectProvides.c_str(), p_depends,
+-                                      r_commands, true);
++                                      objectProvides.c_str(), true,
++                                      p_depends, r_commands, true);
+ 
+   // write the provides.build rule dependency on the obj file
+   p_depends.clear();
+   p_depends.push_back(relativeObj);
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+-                                      temp.c_str(), p_depends, no_commands,
++                                      temp.c_str(), true,
++                                      p_depends, no_commands,
+                                       false);
+ }
+ 
+@@ -941,7 +942,7 @@ void cmMakefileTargetGenerator::WriteTargetRequiresRul
+ 
+   // Write the rule.
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+-                                      depTarget.c_str(),
++                                      depTarget.c_str(), false,
+                                       depends, no_commands, true);
+ }
+ 
+@@ -966,7 +967,7 @@ void cmMakefileTargetGenerator::WriteTargetCleanRules(
+ 
+   // Write the rule.
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+-                                      cleanTarget.c_str(),
++                                      cleanTarget.c_str(), false,
+                                       depends, commands, true);
+ }
+ 
+@@ -1147,7 +1148,7 @@ void cmMakefileTargetGenerator::WriteTargetDependRules
+ 
+   // Write the rule.
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+-                                      depTarget.c_str(),
++                                      depTarget.c_str(), false,
+                                       depends, commands, true);
+ }
+ 
+@@ -1239,7 +1240,7 @@ void cmMakefileTargetGenerator
+       }
+     }
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+-                                      o->c_str(), depends, commands,
++                                      o->c_str(), true, depends, commands,
+                                       symbolic);
+ 
+   // If the rule has changed make sure the output is rebuilt.
+@@ -1296,7 +1297,7 @@ cmMakefileTargetGenerator
+     }
+   depends.push_back(in);
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+-                                      out, depends, commands,
++                                      out, false, depends, commands,
+                                       symbolic);
+ 
+   // Register the extra output as paired with the first output so that
+@@ -1529,7 +1530,7 @@ void cmMakefileTargetGenerator::WriteTargetDriverRule(
+   // Write the driver rule.
+   std::vector<std::string> no_commands;
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, comment,
+-                                      buildTargetRuleName.c_str(),
++                                      buildTargetRuleName.c_str(), false,
+                                       depends, no_commands, true);
+ }
+ 
Index: patches/patch-Source_cmMakefileUtilityTargetGenerator_cxx
===================================================================
RCS file: patches/patch-Source_cmMakefileUtilityTargetGenerator_cxx
diff -N patches/patch-Source_cmMakefileUtilityTargetGenerator_cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_cmMakefileUtilityTargetGenerator_cxx   19 May 2013 
14:26:19 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+Add support for .CHEAP in our make to allow parallel builds.
+--- Source/cmMakefileUtilityTargetGenerator.cxx.orig   Sun May 19 17:50:31 2013
++++ Source/cmMakefileUtilityTargetGenerator.cxx        Sun May 19 17:50:46 2013
+@@ -105,7 +105,7 @@ void cmMakefileUtilityTargetGenerator::WriteRuleFiles(
+   // Write the rule.
+   this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, 0,
+                                       this->Target->GetName(),
+-                                      depends, commands, true);
++                                      true, depends, commands, true);
+ 
+   // Write the main driver rule to build everything in this target.
+   this->WriteTargetDriverRule(this->Target->GetName(), false);

Reply via email to