Mercurial > vim
comparison src/Make_mvc.mak @ 1419:7e5284f58094 v7.1.134
updated for version 7.1-134
author | vimboss |
---|---|
date | Wed, 03 Oct 2007 11:29:44 +0000 |
parents | 25154b22dc96 |
children | 9fbb40a1228a |
comparison
equal
deleted
inserted
replaced
1418:bac7c3fce150 | 1419:7e5284f58094 |
---|---|
90 # lines: Write a mapfile with line numbers (only for VC6 and later) | 90 # lines: Write a mapfile with line numbers (only for VC6 and later) |
91 # | 91 # |
92 # Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes | 92 # Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes |
93 # doesn't work) | 93 # doesn't work) |
94 # | 94 # |
95 # Visual C Version: MSVCVER=m.n (default derived from nmake if undefined) | |
96 # | |
95 # You can combine any of these interfaces | 97 # You can combine any of these interfaces |
96 # | 98 # |
97 # Example: To build the non-debug, GUI version with Perl interface: | 99 # Example: To build the non-debug, GUI version with Perl interface: |
98 # nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl | 100 # nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl |
99 # | 101 # |
100 # DEBUG with Make_mvc.mak and Make_dvc.mak: | 102 # DEBUG with Make_mvc.mak and Make_dvc.mak: |
101 # This makefile gives a fineness of control which is not supported in | 103 # This makefile gives a fineness of control which is not supported in |
102 # Visual C++ configuration files. Therefore, debugging requires a bit of | 104 # Visual C++ configuration files. Therefore, debugging requires a bit of |
103 # extra work. | 105 # extra work. |
104 # Make_dvc.mak is a Visual C++ project to access that support. | 106 # Make_dvc.mak is a Visual C++ project to access that support. It may be |
107 # badly out of date for the Visual C++ you are using... | |
105 # To use Make_dvc.mak: | 108 # To use Make_dvc.mak: |
106 # 1) Build Vim with Make_mvc.mak. | 109 # 1) Build Vim with Make_mvc.mak. |
107 # Use a "DEBUG=yes" argument to build Vim with debug support. | 110 # Use a "DEBUG=yes" argument to build Vim with debug support. |
108 # E.g. the following builds gvimd.exe: | 111 # E.g. the following builds gvimd.exe: |
109 # nmake -f Make_mvc.mak debug=yes gui=yes | 112 # nmake -f Make_mvc.mak debug=yes gui=yes |
196 # Build a retail version by default | 199 # Build a retail version by default |
197 | 200 |
198 !if "$(DEBUG)" != "yes" | 201 !if "$(DEBUG)" != "yes" |
199 NODEBUG = 1 | 202 NODEBUG = 1 |
200 !else | 203 !else |
204 !undef NODEBUG | |
201 MAKEFLAGS_GVIMEXT = DEBUG=yes | 205 MAKEFLAGS_GVIMEXT = DEBUG=yes |
202 !endif | 206 !endif |
203 | 207 |
204 | 208 |
205 # Get all sorts of useful, standard macros from the SDK. (Note that | 209 # Get all sorts of useful, standard macros from the Platform SDK. |
206 # MSVC 2.2 does not install <ntwin32.mak> in the \msvc20\include | |
207 # directory, but you can find it in \msvc20\include on the CD-ROM. | |
208 # You may also need <win32.mak> from the same place.) | |
209 | 210 |
210 !include <Win32.mak> | 211 !include <Win32.mak> |
211 | 212 |
212 | 213 |
213 #>>>>> path of the compiler and linker; name of include and lib directories | 214 #>>>>> path of the compiler and linker; name of include and lib directories |
270 !endif | 271 !endif |
271 !endif | 272 !endif |
272 | 273 |
273 # Set which version of the CRT to use | 274 # Set which version of the CRT to use |
274 !if defined(USE_MSVCRT) | 275 !if defined(USE_MSVCRT) |
275 CVARS = $(cvarsdll) | 276 # CVARS = $(cvarsdll) |
276 # !elseif defined(MULTITHREADED) | 277 # !elseif defined(MULTITHREADED) |
277 # CVARS = $(cvarsmt) | 278 # CVARS = $(cvarsmt) |
278 !else | 279 !else |
279 # CVARS = $(cvars) | 280 # CVARS = $(cvars) |
280 CVARS = $(cvarsmt) | 281 # CVARS = $(cvarsmt) |
281 !endif | 282 !endif |
282 | 283 |
283 # need advapi32.lib for GetUserName() | 284 # need advapi32.lib for GetUserName() |
284 # need shell32.lib for ExtractIcon() | 285 # need shell32.lib for ExtractIcon() |
285 # gdi32.lib and comdlg32.lib for printing support | 286 # gdi32.lib and comdlg32.lib for printing support |
318 !endif | 319 !endif |
319 | 320 |
320 INTDIR=$(OBJDIR) | 321 INTDIR=$(OBJDIR) |
321 OUTDIR=$(OBJDIR) | 322 OUTDIR=$(OBJDIR) |
322 | 323 |
324 # Derive version of VC being used from nmake if not specified | |
325 !if "$(MSVCVER)" == "" | |
326 !if "$(_NMAKE_VER)" == "" | |
327 MSVCVER = 4.0 | |
328 !endif | |
329 !if "$(_NMAKE_VER)" == "162" | |
330 MSVCVER = 5.0 | |
331 !endif | |
332 !if "$(_NMAKE_VER)" == "6.00.8168.0" | |
333 MSVCVER = 6.0 | |
334 !endif | |
335 !if "$(_NMAKE_VER)" == "7.00.9466" | |
336 MSVCVER = 7.0 | |
337 !endif | |
338 !if "$(_NMAKE_VER)" == "7.10.3077" | |
339 MSVCVER = 7.1 | |
340 !endif | |
341 !if "$(_NMAKE_VER)" == "8.00.50727.42" | |
342 MSVCVER = 8.0 | |
343 !endif | |
344 !if "$(_NMAKE_VER)" == "8.00.50727.762" | |
345 MSVCVER = 8.0 | |
346 !endif | |
347 !endif | |
348 | |
349 # Abort bulding VIM if version of VC is unrecognised. | |
350 !ifndef MSVCVER | |
351 !message *** ERROR | |
352 !message Cannot determine Visual C version being used. If you are using the | |
353 !message Windows SDK then you must have the environment variable MSVCVER set to | |
354 !message your version of the VC compiler. If you are not using the Express | |
355 !message version of Visual C you van either set MSVCVER or update this makefile | |
356 !message to handle the new value for _NMAKE_VER. | |
357 !error Make aborted. | |
358 !endif | |
359 | |
323 # Convert processor ID to MVC-compatible number | 360 # Convert processor ID to MVC-compatible number |
361 !if "$(MSVCVER)" != "8.0" | |
324 !if "$(CPUNR)" == "i386" | 362 !if "$(CPUNR)" == "i386" |
325 CPUARG = /G3 | 363 CPUARG = /G3 |
326 !elseif "$(CPUNR)" == "i486" | 364 !elseif "$(CPUNR)" == "i486" |
327 CPUARG = /G4 | 365 CPUARG = /G4 |
328 !elseif "$(CPUNR)" == "i586" | 366 !elseif "$(CPUNR)" == "i586" |
332 !elseif "$(CPUNR)" == "pentium4" | 370 !elseif "$(CPUNR)" == "pentium4" |
333 CPUARG = /G7 /arch:SSE2 | 371 CPUARG = /G7 /arch:SSE2 |
334 !else | 372 !else |
335 CPUARG = | 373 CPUARG = |
336 !endif | 374 !endif |
375 !else | |
376 # VC8 only allows specifying SSE architecture | |
377 !if "$(CPUNR)" == "pentium4" | |
378 CPUARG = /arch:SSE2 | |
379 !endif | |
380 !endif | |
381 | |
382 LIBC = | |
383 DEBUGINFO = /Zi | |
337 | 384 |
338 !ifdef NODEBUG | 385 !ifdef NODEBUG |
339 VIM = vim | 386 VIM = vim |
340 !if "$(OPTIMIZE)" == "SPACE" | 387 !if "$(OPTIMIZE)" == "SPACE" |
341 OPTFLAG = /O1 | 388 OPTFLAG = /O1 |
342 !elseif "$(OPTIMIZE)" == "SPEED" | 389 !elseif "$(OPTIMIZE)" == "SPEED" |
343 OPTFLAG = /O2 | 390 OPTFLAG = /O2 |
344 !else # MAXSPEED | 391 !else # MAXSPEED |
345 OPTFLAG = /Ox | 392 OPTFLAG = /Ox |
346 !endif | 393 !endif |
394 !if "$(MSVCVER)" == "8.0" | |
395 # Use link time code generation if not worried about size | |
396 !if "$(OPTIMIZE)" != "SPACE" | |
397 OPTFLAG = $(OPTFLAG) /GL | |
398 !endif | |
399 !endif | |
347 CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) | 400 CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG) |
348 RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG | 401 RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG |
349 ! ifdef USE_MSVCRT | 402 ! ifdef USE_MSVCRT |
350 CFLAGS = $(CFLAGS) -MD | 403 CFLAGS = $(CFLAGS) /MD |
351 LIBC = msvcrt.lib | 404 LIBC = msvcrt.lib |
352 # CFLAGS = $(CFLAGS) $(cvarsdll) | |
353 # ! elseif defined(MULTITHREADED) | |
354 # LIBC = libcmt.lib | |
355 # CFLAGS = $(CFLAGS) $(cvarsmt) | |
356 ! else | 405 ! else |
357 # LIBC = libc.lib | |
358 LIBC = libcmt.lib | 406 LIBC = libcmt.lib |
359 # CFLAGS = $(CFLAGS) $(cvars) | 407 CFLAGS = $(CFLAGS) /MT |
360 ! endif | 408 ! endif |
361 !else # DEBUG | 409 !else # DEBUG |
362 VIM = vimd | 410 VIM = vimd |
411 ! if "$(CPU)" == "i386" | |
412 DEBUGINFO = /ZI | |
413 ! endif | |
363 CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od | 414 CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od |
364 RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG | 415 RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG |
365 # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0. | 416 # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0. |
366 ! if "$(_NMAKE_VER)" == "" | 417 ! if "$(MSVCVER)" == "4.0" |
367 LIBC = | 418 LIBC = |
368 ! else | 419 ! else |
369 LIBC = /fixed:no | 420 LIBC = /fixed:no |
370 ! endif | 421 ! endif |
371 ! ifdef USE_MSVCRT | 422 ! ifdef USE_MSVCRT |
372 CFLAGS = $(CFLAGS) -MDd | 423 CFLAGS = $(CFLAGS) /MDd |
373 LIBC = $(LIBC) msvcrtd.lib | 424 LIBC = $(LIBC) msvcrtd.lib |
374 # CFLAGS = $(CFLAGS) $(cvarsdll) | |
375 # ! elseif defined(MULTITHREADED) | |
376 # LIBC = $(LIBC) libcmtd.lib | |
377 # CFLAGS = $(CFLAGS) $(cvarsmt) | |
378 ! else | 425 ! else |
379 # LIBC = $(LIBC) libcd.lib | |
380 LIBC = $(LIBC) libcmtd.lib | 426 LIBC = $(LIBC) libcmtd.lib |
381 # CFLAGS = $(CFLAGS) $(cvars) | 427 CFLAGS = $(CFLAGS) /MTd |
382 ! endif | 428 ! endif |
383 !endif # DEBUG | 429 !endif # DEBUG |
384 | 430 |
385 INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \ | 431 INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \ |
386 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \ | 432 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \ |
679 CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES) | 725 CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES) |
680 | 726 |
681 # | 727 # |
682 # Always generate the .pdb file, so that we get debug symbols that can be used | 728 # Always generate the .pdb file, so that we get debug symbols that can be used |
683 # on a crash (doesn't add overhead to the executable). | 729 # on a crash (doesn't add overhead to the executable). |
684 # | 730 # Generate edit-and-continue debug info when no optimization - allows to |
685 CFLAGS = $(CFLAGS) /Zi /Fd$(OUTDIR)/ | 731 # debug more conveniently (able to look at variables which are in registers) |
686 LINK_PDB = /PDB:$(VIM).pdb -debug # -debug:full -debugtype:cv,fixup | 732 # |
733 CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO) | |
734 LINK_PDB = /PDB:$(VIM).pdb -debug | |
687 | 735 |
688 # | 736 # |
689 # End extra feature include | 737 # End extra feature include |
690 # | 738 # |
691 !message | 739 !message |
692 | 740 |
693 conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no | 741 conflags = /nologo /subsystem:$(SUBSYSTEM) |
694 | 742 |
695 PATHDEF_SRC = $(OUTDIR)\pathdef.c | 743 PATHDEF_SRC = $(OUTDIR)\pathdef.c |
696 | 744 |
697 !IF "$(MAP)" == "yes" | 745 !IF "$(MAP)" == "yes" |
698 # "/map" is for debugging | 746 # "/map" is for debugging |
700 !ELSEIF "$(MAP)" == "lines" | 748 !ELSEIF "$(MAP)" == "lines" |
701 # "/mapinfo:lines" is for debugging, only works for VC6 and later | 749 # "/mapinfo:lines" is for debugging, only works for VC6 and later |
702 conflags = $(conflags) /map /mapinfo:lines | 750 conflags = $(conflags) /map /mapinfo:lines |
703 !ENDIF | 751 !ENDIF |
704 | 752 |
705 LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc | 753 LINKARGS1 = $(linkdebug) $(conflags) |
706 LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \ | 754 LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \ |
707 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \ | 755 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \ |
708 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB) | 756 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB) |
757 | |
758 # Report link time code generation progress if used. | |
759 !ifdef NODEBUG | |
760 !if "$(MSVCVER)" == "8.0" | |
761 !if "$(OPTIMIZE)" != "SPACE" | |
762 LINKARGS1 = $(LINKARGS1) /LTCG:STATUS | |
763 !endif | |
764 !endif | |
765 !endif | |
709 | 766 |
710 all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \ | 767 all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \ |
711 GvimExt/gvimext.dll | 768 GvimExt/gvimext.dll |
712 | 769 |
713 $(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \ | 770 $(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \ |
792 | 849 |
793 ########################################################################### | 850 ########################################################################### |
794 | 851 |
795 # Create a default rule for transforming .c files to .obj files in $(OUTDIR) | 852 # Create a default rule for transforming .c files to .obj files in $(OUTDIR) |
796 # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later) | 853 # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later) |
797 !IF "$(_NMAKE_VER)" == "" | 854 !IF "$(MSVCVER)" == "4.0" |
798 .c{$(OUTDIR)/}.obj: | 855 .c{$(OUTDIR)/}.obj: |
799 !ELSE | 856 !ELSE |
800 .c{$(OUTDIR)/}.obj:: | 857 .c{$(OUTDIR)/}.obj:: |
801 !ENDIF | 858 !ENDIF |
802 $(CC) $(CFLAGS) $< | 859 $(CC) $(CFLAGS) $< |
803 | 860 |
804 # Create a default rule for transforming .cpp files to .obj files in $(OUTDIR) | 861 # Create a default rule for transforming .cpp files to .obj files in $(OUTDIR) |
805 # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later) | 862 # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later) |
806 !IF "$(_NMAKE_VER)" == "" | 863 !IF "$(MSVCVER)" == "4.0" |
807 .cpp{$(OUTDIR)/}.obj: | 864 .cpp{$(OUTDIR)/}.obj: |
808 !ELSE | 865 !ELSE |
809 .cpp{$(OUTDIR)/}.obj:: | 866 .cpp{$(OUTDIR)/}.obj:: |
810 !ENDIF | 867 !ENDIF |
811 $(CC) $(CFLAGS) $< | 868 $(CC) $(CFLAGS) $< |