On 17/01/2007 19:44, Bram Moolenaar wrote:
Mike Williams wrote:
Attached is a patch to use VC8 specific optimization options. FTR, VC8
no longer supports the /Gn processor code generation directive, and the
makefile now uses link time code generation when not optimizing for space.
Although MS keeps changing the arguments, the new ones mostly get used
again in future versions. Thus this check:
+ !if "$(_NMAKE_VER)" != "8.00.50727.42"
Should probably check if the version is greater than or smaller than
this specific number. At least do the comparing with this specific
number once and pass the result to further "if"s.
Proposal #2 - now derives VC version from _NMAKE_VER. Updated a couple
of checks for VC4 so the file is a bit more more self documenting.
Enjoy.
Mike
--
Barnum was wrong... it's more like every thirty seconds.
*** Make_mvc.mak.orig Wed Apr 26 10:30:22 2006
--- Make_mvc.mak Thu Jan 18 11:07:26 2007
***************
*** 320,326 ****
--- 320,348 ----
INTDIR=$(OBJDIR)
OUTDIR=$(OBJDIR)
+ # Derive version of VC being used
+ !if "$(_NMAKE_VER)" == ""
+ VC_VER = 4
+ !endif
+ !if "$(_NMAKE_VER)" == "162"
+ VC_VER = 5
+ !endif
+ !if "$(_NMAKE_VER)" == "6.00.8168.0"
+ VC_VER = 6
+ !endif
+ !if "$(_NMAKE_VER)" == "7.00.9466"
+ VC_VER = 7
+ !endif
+ !if "$(_NMAKE_VER)" == "8.00.50727.42"
+ VC_VER = 8
+ !endif
+ # Default to VC6 (arbitrarily) if unknown
+ !ifndef VC_VER
+ VC_VER = 6
+ !endif
+
# Convert processor ID to MVC-compatible number
+ !if "$(VC_VER)" < "8"
!if "$(CPUNR)" == "i386"
CPUARG = /G3
!elseif "$(CPUNR)" == "i486"
***************
*** 334,339 ****
--- 356,367 ----
!else
CPUARG =
!endif
+ !else
+ # VC8 only allows specifying SSE architecture
+ !if "$(CPUNR)" == "pentium4"
+ CPUARG = /arch:SSE2
+ !endif
+ !endif
!ifdef NODEBUG
VIM = vim
***************
*** 344,349 ****
--- 372,383 ----
!else # MAXSPEED
OPTFLAG = /Ox
!endif
+ !if "$(VC_VER)" >= "8"
+ # Use link time code generation if not worried about size
+ !if "$(OPTIMIZE)" != "SPACE"
+ OPTFLAG = $(OPTFLAG) /GL
+ !endif
+ !endif
CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
! ifdef USE_MSVCRT
***************
*** 363,369 ****
CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in
VC4.0.
! ! if "$(_NMAKE_VER)" == ""
LIBC =
! else
LIBC = /fixed:no
--- 397,403 ----
CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in
VC4.0.
! ! if "$(VC_VER)" == "4"
LIBC =
! else
LIBC = /fixed:no
***************
*** 707,712 ****
--- 741,755 ----
$(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
$(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
+ # Report link time code generation progress if used.
+ !ifdef NODEBUG
+ !if "$(VC_VER)" >= "8"
+ !if "$(OPTIMIZE)" != "SPACE"
+ LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
+ !endif
+ !endif
+ !endif
+
all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
GvimExt/gvimext.dll
***************
*** 795,801 ****
# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
! !IF "$(_NMAKE_VER)" == ""
.c{$(OUTDIR)/}.obj:
!ELSE
.c{$(OUTDIR)/}.obj::
--- 838,844 ----
# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
! !IF "$(VC_VER)" == "4"
.c{$(OUTDIR)/}.obj:
!ELSE
.c{$(OUTDIR)/}.obj::
***************
*** 804,810 ****
# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
! !IF "$(_NMAKE_VER)" == ""
.cpp{$(OUTDIR)/}.obj:
!ELSE
.cpp{$(OUTDIR)/}.obj::
--- 847,853 ----
# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
! !IF "$(VC_VER)" == "4"
.cpp{$(OUTDIR)/}.obj:
!ELSE
.cpp{$(OUTDIR)/}.obj::