diff --git a/Makefile b/Makefile
index a39a236198c64c246fd76c4214281c1e9c00a2b0..fe5b9f78df47f66f1f8ed466d5238e4392dd4133 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.466 2008-02-15 15:33:31 miegroet Exp $
+# $Id: Makefile,v 1.467 2008-02-15 20:01:53 geuzaine Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -84,12 +84,7 @@ install-lib: lib
 	rm -f ${includedir}/gmsh/*
 	cp -f ${GMSH_API} ${includedir}/gmsh
 	mkdir -p ${libdir}
-ifeq ($(OPTION),/EHsc /nologo /GR /MTd)
-	cp -f bin/libGmsh${LIBEXT} ${libdir}/libGmsh${LIBEXTDEBUG}
-endif
-ifeq (${OPTION},/EHsc /nologo /GR /MT)
-	cp -f bin/libGmsh${LIBEXT} ${libdir}/libGmsh${LIBEXTRELEASE}
-endif
+	cp -f bin/libGmsh${LIBEXT} ${libdir}/libGmsh${LIBSUFFIX}${LIBEXT}
 
 embed:
 	@if [ -r ../getdp2/contrib/gmsh/Makefile ]; then \
diff --git a/variables.msvc b/variables.msvc
index fbd59e7a70d813a2c1b665fb80a86c99c69fa643..8fe71f794ac3175079e39ff78b2550e3ab08a8b2 100644
--- a/variables.msvc
+++ b/variables.msvc
@@ -1,8 +1,8 @@
 # This is a pre-filled variables file for building a blackbox version
-# of Gmsh with Microsoft Visual C++ (MSVC). 
+# of Gmsh with Microsoft Visual C++ (MSVC).
 #
-# This has been tested with MSVC 2003.NET and MSVC 2008. 
-# See doc/README.msvc for building instructions.
+# This has been tested with MSVC 2003 and MSVC 2008.  See
+# doc/README.msvc for building instructions.
 
 # OS and host
 UNAME=WIN32MSVC
@@ -10,11 +10,18 @@ HOSTNAME=localhost
 
 # The names of the C and C++ compilers
 CC=cl
-OPTION=/EHsc /nologo /GR /MT
-# Add /MLd for single-thread debug mode
+CXX=/EHsc /nologo /GR /MT
+
+# Use /MLd for single-thread debug mode
 #     /MTd for multi-thread debug mode
+#     /MT for multi-thread release mode
 
-CXX=${CC} ${OPTION}
+# append different suffix for release or debug version of library
+ifneq (,${findstring MTd,${CXX}})
+  LIBSUFFIX=_d
+else
+  LIBSUFFIX=_r
+endif
 
 # increase stack size to 16Mb to avoid stack overflows in recursive 
 # tet classification for large 3D Delaunay grids
@@ -47,8 +54,6 @@ DASH=/
 # The extension to use for object files, libraries and executables
 OBJEXT=.obj
 LIBEXT=.lib
-LIBEXTRELEASE=_r.lib
-LIBEXTDEBUG=_d.lib
 EXEEXT=.exe
 
 # Installation directories