You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/05/02 16:03:02 UTC

[lucy-commits] [1/8] git commit: refs/heads/master - C89 fix for Charmonizer

Updated Branches:
  refs/heads/master a879c1629 -> b2e42b386


C89 fix for Charmonizer


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/848adfc8
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/848adfc8
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/848adfc8

Branch: refs/heads/master
Commit: 848adfc818f0edccfbfffb66fd8a92f2fbca69d5
Parents: a879c16
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu May 2 14:01:11 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu May 2 14:01:11 2013 +0200

----------------------------------------------------------------------
 charmonizer/src/Charmonizer/Core/Compiler.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/848adfc8/charmonizer/src/Charmonizer/Core/Compiler.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Compiler.c b/charmonizer/src/Charmonizer/Core/Compiler.c
index fb0d960..2130b47 100644
--- a/charmonizer/src/Charmonizer/Core/Compiler.c
+++ b/charmonizer/src/Charmonizer/Core/Compiler.c
@@ -362,6 +362,7 @@ chaz_CC_link_command() {
 char*
 chaz_CC_shared_lib_file(const char *name) {
     const char *prefix = "";
+    const char *shlib_ext = chaz_OS_shared_lib_ext();
     if (!chaz_CC.intval__MSC_VER) {
         if (strcmp(chaz_OS_name(), "cygwin") == 0) {
             prefix = "cyg";
@@ -370,7 +371,6 @@ chaz_CC_shared_lib_file(const char *name) {
             prefix = "lib";
         }
     }
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
     return chaz_Util_join("", prefix, name, shlib_ext, NULL);
 }
 


[lucy-commits] [3/8] git commit: refs/heads/master - Remove newline from Windows rm command

Posted by nw...@apache.org.
Remove newline from Windows rm command


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/7b2b8b8d
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/7b2b8b8d
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/7b2b8b8d

Branch: refs/heads/master
Commit: 7b2b8b8da61baabe1c9fe79e8cc6ab1ef11ad35c
Parents: d3237b8
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu May 2 15:29:25 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu May 2 15:30:54 2013 +0200

----------------------------------------------------------------------
 charmonizer/src/Charmonizer/Core/Make.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/7b2b8b8d/charmonizer/src/Charmonizer/Core/Make.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Make.c b/charmonizer/src/Charmonizer/Core/Make.c
index eef026f..4bfdcd5 100644
--- a/charmonizer/src/Charmonizer/Core/Make.c
+++ b/charmonizer/src/Charmonizer/Core/Make.c
@@ -494,7 +494,7 @@ chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const char *files) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", files,
-                                 ") do @if exist %i del /f %i\n", NULL);
+                                 ") do @if exist %i del /f %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -514,7 +514,7 @@ chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, const char *dirs) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", dirs,
-                                 ") do @if exist %i rmdir /s /q %i\n", NULL);
+                                 ") do @if exist %i rmdir /s /q %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);


[lucy-commits] [4/8] git commit: refs/heads/master - Work around command length limit of cmd.exe

Posted by nw...@apache.org.
Work around command length limit of cmd.exe


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/d3237b81
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/d3237b81
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/d3237b81

Branch: refs/heads/master
Commit: d3237b81b903ff6345852a90888ed88b50094b1d
Parents: 2c0dccd
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu May 2 15:22:02 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu May 2 15:30:54 2013 +0200

----------------------------------------------------------------------
 common/charmonizer.main |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/d3237b81/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index 040cad1..56b1192 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -373,7 +373,18 @@ S_write_makefile(struct chaz_CLIArgs *args) {
 
     clean_rule = chaz_MakeFile_clean_rule(makefile);
 
-    chaz_MakeRule_add_rm_command(clean_rule, "$(LUCY_OBJS)");
+    if (chaz_OS_shell_type() == CHAZ_OS_CMD_EXE) {
+        /*
+         * The length of the command would exceed the limit of 8191
+         * characters. As a work-around, delete all .obj files in BASE_DIR
+         * using 'del /s /q'.
+         */
+        chaz_MakeRule_add_command(clean_rule, "del /s /q $(BASE_DIR)\\*.obj");
+    }
+    else {
+        chaz_MakeRule_add_rm_command(clean_rule, "$(LUCY_OBJS)");
+    }
+
     chaz_MakeRule_add_rm_command(clean_rule, json_parser_h);
     chaz_MakeRule_add_rm_command(clean_rule, json_parser_c);
     chaz_MakeRule_add_recursive_rm_command(clean_rule, "$(AUTOGEN_DIR)");


[lucy-commits] [2/8] git commit: refs/heads/master - Fix detection of math library under C++

Posted by nw...@apache.org.
Fix detection of math library under C++

math.h functions might be overloaded under C++.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/2c0dccdf
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/2c0dccdf
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/2c0dccdf

Branch: refs/heads/master
Commit: 2c0dccdfe3418b038c40f8de709ef6ebd7a7c098
Parents: 848adfc
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu May 2 14:30:31 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu May 2 14:55:22 2013 +0200

----------------------------------------------------------------------
 charmonizer/src/Charmonizer/Probe/Floats.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/2c0dccdf/charmonizer/src/Charmonizer/Probe/Floats.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Floats.c b/charmonizer/src/Charmonizer/Probe/Floats.c
index e486741..fc31386 100644
--- a/charmonizer/src/Charmonizer/Probe/Floats.c
+++ b/charmonizer/src/Charmonizer/Probe/Floats.c
@@ -51,8 +51,9 @@ chaz_Floats_math_library(void) {
     static const char sqrt_code[] =
         CHAZ_QUOTE(  #include <math.h>                              )
         CHAZ_QUOTE(  #include <stdio.h>                             )
+        CHAZ_QUOTE(  typedef double (*sqrt_t)(double);              )
         CHAZ_QUOTE(  int main(void) {                               )
-        CHAZ_QUOTE(      printf("%p\n", sqrt);                      )
+        CHAZ_QUOTE(      printf("%p\n", (sqrt_t)sqrt);              )
         CHAZ_QUOTE(      return 0;                                  )
         CHAZ_QUOTE(  }                                              );
     chaz_CFlags *temp_cflags = chaz_CC_get_temp_cflags();


[lucy-commits] [6/8] git commit: refs/heads/master - Add /nologo to recursive nmake invocations

Posted by nw...@apache.org.
Add /nologo to recursive nmake invocations


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/426e9a3a
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/426e9a3a
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/426e9a3a

Branch: refs/heads/master
Commit: 426e9a3a442545e612e3008d718b21a2c8cc4c62
Parents: 892a94f
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu May 2 15:41:24 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu May 2 15:44:32 2013 +0200

----------------------------------------------------------------------
 charmonizer/src/Charmonizer/Core/Make.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/426e9a3a/charmonizer/src/Charmonizer/Core/Make.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Make.c b/charmonizer/src/Charmonizer/Core/Make.c
index a35c1a8..5210154 100644
--- a/charmonizer/src/Charmonizer/Core/Make.c
+++ b/charmonizer/src/Charmonizer/Core/Make.c
@@ -556,10 +556,10 @@ chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir,
         free(command);
 
         if (!target) {
-            chaz_MakeRule_add_command(rule, "$(MAKE)");
+            chaz_MakeRule_add_command(rule, "$(MAKE) /nologo");
         }
         else {
-            command = chaz_Util_join(" ", "$(MAKE)", target, NULL);
+            command = chaz_Util_join(" ", "$(MAKE) /nologo", target, NULL);
             chaz_MakeRule_add_command(rule, command);
             free(command);
         }


[lucy-commits] [7/8] git commit: refs/heads/master - Add /nologo to invocation of MSVC linker

Posted by nw...@apache.org.
Add /nologo to invocation of MSVC linker


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/aaf812ff
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/aaf812ff
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/aaf812ff

Branch: refs/heads/master
Commit: aaf812ff4ffb7d69ab8dac6fc7c4c22ce09612c2
Parents: 426e9a3
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu May 2 15:43:02 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu May 2 15:46:53 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/common/charmonizer.main |    3 +++
 common/charmonizer.main                    |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/aaf812ff/clownfish/compiler/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/clownfish/compiler/common/charmonizer.main b/clownfish/compiler/common/charmonizer.main
index 4234025..3b896ba 100644
--- a/clownfish/compiler/common/charmonizer.main
+++ b/clownfish/compiler/common/charmonizer.main
@@ -221,6 +221,9 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeFile_add_rule(makefile, "$(COMMON_OBJS)", parse_header_c);
 
     link_flags = chaz_CFlags_new(cflags_style);
+    if (chaz_CC_msvc_version_num()) {
+        chaz_CFlags_append(link_flags, "/nologo");
+    }
     if (args->code_coverage) {
         chaz_CFlags_enable_code_coverage(link_flags);
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/aaf812ff/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index 56b1192..4ebae65 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -316,6 +316,9 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeRule_add_prereq(rule, "$(AUTOGEN_DIR)");
 
     link_flags = chaz_CFlags_new(cflags_style);
+    if (chaz_CC_msvc_version_num()) {
+        chaz_CFlags_append(link_flags, "/nologo");
+    }
     math_library = chaz_Floats_math_library();
     if (math_library) {
         chaz_CFlags_add_library(link_flags, math_library);


[lucy-commits] [5/8] git commit: refs/heads/master - Remove import library and export file under MSVC

Posted by nw...@apache.org.
Remove import library and export file under MSVC


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/892a94f6
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/892a94f6
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/892a94f6

Branch: refs/heads/master
Commit: 892a94f630cf9f5fbc587d7c9772f49be9cb5ae7
Parents: 7b2b8b8
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu May 2 15:38:21 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu May 2 15:44:32 2013 +0200

----------------------------------------------------------------------
 charmonizer/src/Charmonizer/Core/Make.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/892a94f6/charmonizer/src/Charmonizer/Core/Make.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Make.c b/charmonizer/src/Charmonizer/Core/Make.c
index 4bfdcd5..a35c1a8 100644
--- a/charmonizer/src/Charmonizer/Core/Make.c
+++ b/charmonizer/src/Charmonizer/Core/Make.c
@@ -333,6 +333,17 @@ chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
 
     chaz_MakeRule_add_rm_command(makefile->clean, shared_lib);
 
+    if (chaz_CC_msvc_version_num()) {
+        /* Remove import library and export file under MSVC. */
+        char *filename;
+        filename = chaz_Util_join("", name, ".lib", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+        filename = chaz_Util_join("", name, ".exp", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+    }
+
     chaz_CFlags_destroy(local_flags);
     free(shared_lib);
     free(command);


[lucy-commits] [8/8] git commit: refs/heads/master - Regenerate charmonizer.c

Posted by nw...@apache.org.
Regenerate charmonizer.c


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/b2e42b38
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/b2e42b38
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/b2e42b38

Branch: refs/heads/master
Commit: b2e42b38659084bedf9ba59314a326c481ea9b92
Parents: aaf812f
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu May 2 14:01:41 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Thu May 2 15:46:53 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/common/charmonizer.c |   24 ++++++++++++---
 clownfish/runtime/common/charmonizer.c  |   24 +++++++++++----
 common/charmonizer.c                    |   40 +++++++++++++++++++++----
 3 files changed, 70 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/b2e42b38/clownfish/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/common/charmonizer.c b/clownfish/compiler/common/charmonizer.c
index 4b8e834..c76bf71 100644
--- a/clownfish/compiler/common/charmonizer.c
+++ b/clownfish/compiler/common/charmonizer.c
@@ -1782,6 +1782,7 @@ chaz_CC_link_command() {
 char*
 chaz_CC_shared_lib_file(const char *name) {
     const char *prefix = "";
+    const char *shlib_ext = chaz_OS_shared_lib_ext();
     if (!chaz_CC.intval__MSC_VER) {
         if (strcmp(chaz_OS_name(), "cygwin") == 0) {
             prefix = "cyg";
@@ -1790,7 +1791,6 @@ chaz_CC_shared_lib_file(const char *name) {
             prefix = "lib";
         }
     }
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
     return chaz_Util_join("", prefix, name, shlib_ext, NULL);
 }
 
@@ -3220,6 +3220,17 @@ chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
 
     chaz_MakeRule_add_rm_command(makefile->clean, shared_lib);
 
+    if (chaz_CC_msvc_version_num()) {
+        /* Remove import library and export file under MSVC. */
+        char *filename;
+        filename = chaz_Util_join("", name, ".lib", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+        filename = chaz_Util_join("", name, ".exp", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+    }
+
     chaz_CFlags_destroy(local_flags);
     free(shared_lib);
     free(command);
@@ -3381,7 +3392,7 @@ chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const char *files) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", files,
-                                 ") do @if exist %i del /f %i\n", NULL);
+                                 ") do @if exist %i del /f %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3401,7 +3412,7 @@ chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, const char *dirs) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", dirs,
-                                 ") do @if exist %i rmdir /s /q %i\n", NULL);
+                                 ") do @if exist %i rmdir /s /q %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3432,10 +3443,10 @@ chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir,
         free(command);
 
         if (!target) {
-            chaz_MakeRule_add_command(rule, "$(MAKE)");
+            chaz_MakeRule_add_command(rule, "$(MAKE) /nologo");
         }
         else {
-            command = chaz_Util_join(" ", "$(MAKE)", target, NULL);
+            command = chaz_Util_join(" ", "$(MAKE) /nologo", target, NULL);
             chaz_MakeRule_add_command(rule, command);
             free(command);
         }
@@ -5337,6 +5348,9 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeFile_add_rule(makefile, "$(COMMON_OBJS)", parse_header_c);
 
     link_flags = chaz_CFlags_new(cflags_style);
+    if (chaz_CC_msvc_version_num()) {
+        chaz_CFlags_append(link_flags, "/nologo");
+    }
     if (args->code_coverage) {
         chaz_CFlags_enable_code_coverage(link_flags);
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/b2e42b38/clownfish/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/common/charmonizer.c b/clownfish/runtime/common/charmonizer.c
index b4d50eb..f239ff1 100644
--- a/clownfish/runtime/common/charmonizer.c
+++ b/clownfish/runtime/common/charmonizer.c
@@ -2061,6 +2061,7 @@ chaz_CC_link_command() {
 char*
 chaz_CC_shared_lib_file(const char *name) {
     const char *prefix = "";
+    const char *shlib_ext = chaz_OS_shared_lib_ext();
     if (!chaz_CC.intval__MSC_VER) {
         if (strcmp(chaz_OS_name(), "cygwin") == 0) {
             prefix = "cyg";
@@ -2069,7 +2070,6 @@ chaz_CC_shared_lib_file(const char *name) {
             prefix = "lib";
         }
     }
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
     return chaz_Util_join("", prefix, name, shlib_ext, NULL);
 }
 
@@ -3499,6 +3499,17 @@ chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
 
     chaz_MakeRule_add_rm_command(makefile->clean, shared_lib);
 
+    if (chaz_CC_msvc_version_num()) {
+        /* Remove import library and export file under MSVC. */
+        char *filename;
+        filename = chaz_Util_join("", name, ".lib", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+        filename = chaz_Util_join("", name, ".exp", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+    }
+
     chaz_CFlags_destroy(local_flags);
     free(shared_lib);
     free(command);
@@ -3660,7 +3671,7 @@ chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const char *files) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", files,
-                                 ") do @if exist %i del /f %i\n", NULL);
+                                 ") do @if exist %i del /f %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3680,7 +3691,7 @@ chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, const char *dirs) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", dirs,
-                                 ") do @if exist %i rmdir /s /q %i\n", NULL);
+                                 ") do @if exist %i rmdir /s /q %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3711,10 +3722,10 @@ chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir,
         free(command);
 
         if (!target) {
-            chaz_MakeRule_add_command(rule, "$(MAKE)");
+            chaz_MakeRule_add_command(rule, "$(MAKE) /nologo");
         }
         else {
-            command = chaz_Util_join(" ", "$(MAKE)", target, NULL);
+            command = chaz_Util_join(" ", "$(MAKE) /nologo", target, NULL);
             chaz_MakeRule_add_command(rule, command);
             free(command);
         }
@@ -4776,8 +4787,9 @@ chaz_Floats_math_library(void) {
     static const char sqrt_code[] =
         CHAZ_QUOTE(  #include <math.h>                              )
         CHAZ_QUOTE(  #include <stdio.h>                             )
+        CHAZ_QUOTE(  typedef double (*sqrt_t)(double);              )
         CHAZ_QUOTE(  int main(void) {                               )
-        CHAZ_QUOTE(      printf("%p\n", sqrt);                      )
+        CHAZ_QUOTE(      printf("%p\n", (sqrt_t)sqrt);              )
         CHAZ_QUOTE(      return 0;                                  )
         CHAZ_QUOTE(  }                                              );
     chaz_CFlags *temp_cflags = chaz_CC_get_temp_cflags();

http://git-wip-us.apache.org/repos/asf/lucy/blob/b2e42b38/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/common/charmonizer.c b/common/charmonizer.c
index ba3849d..04d5e0d 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -2061,6 +2061,7 @@ chaz_CC_link_command() {
 char*
 chaz_CC_shared_lib_file(const char *name) {
     const char *prefix = "";
+    const char *shlib_ext = chaz_OS_shared_lib_ext();
     if (!chaz_CC.intval__MSC_VER) {
         if (strcmp(chaz_OS_name(), "cygwin") == 0) {
             prefix = "cyg";
@@ -2069,7 +2070,6 @@ chaz_CC_shared_lib_file(const char *name) {
             prefix = "lib";
         }
     }
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
     return chaz_Util_join("", prefix, name, shlib_ext, NULL);
 }
 
@@ -3499,6 +3499,17 @@ chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
 
     chaz_MakeRule_add_rm_command(makefile->clean, shared_lib);
 
+    if (chaz_CC_msvc_version_num()) {
+        /* Remove import library and export file under MSVC. */
+        char *filename;
+        filename = chaz_Util_join("", name, ".lib", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+        filename = chaz_Util_join("", name, ".exp", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+    }
+
     chaz_CFlags_destroy(local_flags);
     free(shared_lib);
     free(command);
@@ -3660,7 +3671,7 @@ chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const char *files) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", files,
-                                 ") do @if exist %i del /f %i\n", NULL);
+                                 ") do @if exist %i del /f %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3680,7 +3691,7 @@ chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, const char *dirs) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", dirs,
-                                 ") do @if exist %i rmdir /s /q %i\n", NULL);
+                                 ") do @if exist %i rmdir /s /q %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3711,10 +3722,10 @@ chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir,
         free(command);
 
         if (!target) {
-            chaz_MakeRule_add_command(rule, "$(MAKE)");
+            chaz_MakeRule_add_command(rule, "$(MAKE) /nologo");
         }
         else {
-            command = chaz_Util_join(" ", "$(MAKE)", target, NULL);
+            command = chaz_Util_join(" ", "$(MAKE) /nologo", target, NULL);
             chaz_MakeRule_add_command(rule, command);
             free(command);
         }
@@ -4776,8 +4787,9 @@ chaz_Floats_math_library(void) {
     static const char sqrt_code[] =
         CHAZ_QUOTE(  #include <math.h>                              )
         CHAZ_QUOTE(  #include <stdio.h>                             )
+        CHAZ_QUOTE(  typedef double (*sqrt_t)(double);              )
         CHAZ_QUOTE(  int main(void) {                               )
-        CHAZ_QUOTE(      printf("%p\n", sqrt);                      )
+        CHAZ_QUOTE(      printf("%p\n", (sqrt_t)sqrt);              )
         CHAZ_QUOTE(      return 0;                                  )
         CHAZ_QUOTE(  }                                              );
     chaz_CFlags *temp_cflags = chaz_CC_get_temp_cflags();
@@ -6606,6 +6618,9 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeRule_add_prereq(rule, "$(AUTOGEN_DIR)");
 
     link_flags = chaz_CFlags_new(cflags_style);
+    if (chaz_CC_msvc_version_num()) {
+        chaz_CFlags_append(link_flags, "/nologo");
+    }
     math_library = chaz_Floats_math_library();
     if (math_library) {
         chaz_CFlags_add_library(link_flags, math_library);
@@ -6663,7 +6678,18 @@ S_write_makefile(struct chaz_CLIArgs *args) {
 
     clean_rule = chaz_MakeFile_clean_rule(makefile);
 
-    chaz_MakeRule_add_rm_command(clean_rule, "$(LUCY_OBJS)");
+    if (chaz_OS_shell_type() == CHAZ_OS_CMD_EXE) {
+        /*
+         * The length of the command would exceed the limit of 8191
+         * characters. As a work-around, delete all .obj files in BASE_DIR
+         * using 'del /s /q'.
+         */
+        chaz_MakeRule_add_command(clean_rule, "del /s /q $(BASE_DIR)\\*.obj");
+    }
+    else {
+        chaz_MakeRule_add_rm_command(clean_rule, "$(LUCY_OBJS)");
+    }
+
     chaz_MakeRule_add_rm_command(clean_rule, json_parser_h);
     chaz_MakeRule_add_rm_command(clean_rule, json_parser_c);
     chaz_MakeRule_add_recursive_rm_command(clean_rule, "$(AUTOGEN_DIR)");