[Cmake-commits] CMake branch, next, updated. v3.2.1-1296-g3e031d1

Brad King brad.king at kitware.com
Tue Mar 31 08:30:02 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  3e031d185c129ef233b5a82735153558f86f1674 (commit)
       via  4adf1dad2a6e462364bae81030c928599d11c24f (commit)
      from  8114ac4c960dfb5d7174d9323bb0cb070f5e8175 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3e031d185c129ef233b5a82735153558f86f1674
commit 3e031d185c129ef233b5a82735153558f86f1674
Merge: 8114ac4 4adf1da
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Mar 31 08:30:01 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Mar 31 08:30:01 2015 -0400

    Merge topic 'makefile-DELETE_ON_ERROR' into next
    
    4adf1dad Makefile: Tell GNU make to delete rule outputs on error (#15474)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4adf1dad2a6e462364bae81030c928599d11c24f
commit 4adf1dad2a6e462364bae81030c928599d11c24f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 30 16:32:26 2015 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 30 16:35:48 2015 -0400

    Makefile: Tell GNU make to delete rule outputs on error (#15474)
    
    Add .DELETE_ON_ERROR to the "build.make" files that contain the actual
    build rules that generate files.  This tells GNU make to delete the
    output of a rule if the recipe modifies the output but returns failure.
    This is particularly useful for custom commands that use shell
    redirection to produce a file.
    
    Do not add .DELETE_ON_ERROR for Borland or Watcom make tools because
    they may not tolerate it and would not honor it anyway.  Other make
    tools that do not understand .DELETE_ON_ERROR will not be hurt.
    
    Suggested-by: Andrey Vihrov <andrey.vihrov at gmail.com>

diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h
index 120d2f8..005f0d6 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.h
+++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -46,6 +46,7 @@ public:
                               cmMakefile *, bool optional);
 
   virtual bool AllowNotParallel() const { return false; }
+  virtual bool AllowDeleteOnError() const { return false; }
 };
 
 #endif
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 50a901e..a76a835 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -128,6 +128,9 @@ public:
   /** Does the make tool tolerate .NOTPARALLEL? */
   virtual bool AllowNotParallel() const { return true; }
 
+  /** Does the make tool tolerate .DELETE_ON_ERROR? */
+  virtual bool AllowDeleteOnError() const { return true; }
+
   virtual void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
 protected:
   void WriteMainMakefile2();
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index 0e577b5..7bc209b 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -45,6 +45,7 @@ public:
                               cmMakefile *, bool optional);
 
   virtual bool AllowNotParallel() const { return false; }
+  virtual bool AllowDeleteOnError() const { return false; }
 };
 
 #endif
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 641cd23..2cd2d3e 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -122,6 +122,14 @@ void cmMakefileTargetGenerator::CreateRuleFile()
     return;
     }
   this->LocalGenerator->WriteDisclaimer(*this->BuildFileStream);
+  if (this->GlobalGenerator->AllowDeleteOnError())
+    {
+    std::vector<std::string> no_depends;
+    std::vector<std::string> no_commands;
+    this->LocalGenerator->WriteMakeRule(
+      *this->BuildFileStream, "Delete rule output on recipe failure.",
+      ".DELETE_ON_ERROR", no_depends, no_commands, false);
+    }
   this->LocalGenerator->WriteSpecialTargetsTop(*this->BuildFileStream);
 }
 

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGlobalBorlandMakefileGenerator.h |    1 +
 Source/cmGlobalUnixMakefileGenerator3.h   |    3 +++
 Source/cmGlobalWatcomWMakeGenerator.h     |    1 +
 Source/cmMakefileTargetGenerator.cxx      |    8 ++++++++
 4 files changed, 13 insertions(+)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list