Hi,

I enclosed patch to fix WMake verbose/silent output.

Regards

Jiri
>From a581a7538bcbd749a0a704beabdc52665af07970 Mon Sep 17 00:00:00 2001
From: Jiri Malak <[email protected]>
Date: Sun, 9 Mar 2014 10:41:06 +0100
Subject: [PATCH] fix incorrect handling of WMake verbose output

 -e option has nothing to do with verbose output
    it is now properly handled by .ERASE directive in make file
 -s option set silent output globaly, it can not be switch off
    it is now handled only by .SILENT directive in make file   
    directive is simply controled by if block
 Remove SilentNoColon member variable as absolutely useless

---
 Source/cmGlobalWatcomWMakeGenerator.cxx  |  3 +--
 Source/cmLocalUnixMakefileGenerator3.cxx | 43 +++++++++++++++++++-------------
 Source/cmLocalUnixMakefileGenerator3.h   |  6 -----
 3 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index 98ce685..671166e 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -43,11 +43,10 @@ void cmGlobalWatcomWMakeGenerator
 cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator()
 {
   cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
-  lg->SetSilentNoColon(true);
   lg->SetDefineWindowsNULL(true);
   lg->SetWindowsShell(true);
   lg->SetWatcomWMake(true);
-  lg->SetMakeSilentFlag("-s -h -e");
+  lg->SetMakeSilentFlag("-h");
   lg->SetGlobalGenerator(this);
   lg->SetIgnoreLibPrefix(true);
   lg->SetPassMakeflags(false);
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 93722d1..ca814ff 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -80,7 +80,6 @@ static std::string cmSplitExtension(std::string const& in, std::string& base)
 //----------------------------------------------------------------------------
 cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3()
 {
-  this->SilentNoColon = false;
   this->WindowsShell = false;
   this->IncludeDirective = "include";
   this->MakefileVariableSize = 0;
@@ -758,15 +757,15 @@ cmLocalUnixMakefileGenerator3
   depends.push_back(".hpux_make_needs_suffix_list");
   this->WriteMakeRule(makefileStream, 0,
                       ".SUFFIXES", depends, no_commands, false);
-
-  cmGlobalUnixMakefileGenerator3* gg =
-    static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
-  // Write special target to silence make output.  This must be after
-  // the default target in case VERBOSE is set (which changes the
-  // name).  The setting of CMAKE_VERBOSE_MAKEFILE to ON will cause a
-  // "VERBOSE=1" to be added as a make variable which will change the
-  // name of this special target.  This gives a make-time choice to
-  // the user.
+  if( this->WatcomWMake )
+    {
+    // Switch on WMake feature, if an error or interrupt occurs during
+    // makefile processing, the current target being made may be deleted
+    // without prompting (the same as command line -e option).
+      makefileStream << "\n"
+                        ".ERASE\n"
+                        "\n";
+    }
   if(this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"))
     {
     makefileStream
@@ -774,21 +773,31 @@ cmLocalUnixMakefileGenerator3
       << "VERBOSE = 1\n"
       << "\n";
     }
-  if(this->SilentNoColon)
+  if( this->WatcomWMake )
     {
-    makefileStream << "$(VERBOSE).SILENT\n";
+      makefileStream << "!ifndef VERBOSE\n"
+                        ".SILENT\n"
+                        "!endif\n";
     }
   else
     {
-    this->WriteMakeRule(makefileStream,
-                        "Suppress display of executed commands.",
-                        "$(VERBOSE).SILENT",
-                        no_depends,
-                        no_commands, false);
+    // Write special target to silence make output.  This must be after
+    // the default target in case VERBOSE is set (which changes the
+    // name).  The setting of CMAKE_VERBOSE_MAKEFILE to ON will cause a
+    // "VERBOSE=1" to be added as a make variable which will change the
+    // name of this special target.  This gives a make-time choice to
+    // the user.
+      this->WriteMakeRule(makefileStream,
+                          "Suppress display of executed commands.",
+                          "$(VERBOSE).SILENT",
+                          no_depends,
+                          no_commands, false);
     }
 
   // Work-around for makes that drop rules that have no dependencies
   // or commands.
+  cmGlobalUnixMakefileGenerator3* gg =
+    static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
   std::string hack = gg->GetEmptyRuleHackDepends();
   if(!hack.empty())
     {
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 703369e..c0c18c7 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -121,12 +121,6 @@ public:
   void SetUnixCD(bool v)  {this->UnixCD = v;}
 
   /**
-   * Set Support Verbose Variable.  If true, then .SILENT will
-   * be not end with :  i.e. .SILENT: or .SILENT
-   */
-  void SetSilentNoColon(bool v)  {this->SilentNoColon = v;}
-
-  /**
    * Set the string used to include one makefile into another default
    * is include.
    */
-- 
1.7.11.msysgit.0
-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to