merge changes from upstream
[MacVim/jjgod.git] / src / Make_mvc.mak
blobb407fbe06f2750b744466784412d612d0e7d494e
1 # Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me)
2 # and Win64, using the Microsoft Visual C++ compilers. Known to work with
3 # VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), and VC8 (VS2005).
5 # To build using other Windows compilers, see INSTALLpc.txt
7 # This makefile can build the console, GUI, OLE-enable, Perl-enabled and
8 # Python-enabled versions of vim for Win32 platforms.
10 # The basic command line to build vim is:
12 # nmake -f Make_mvc.mak
14 # This will build the console version of vim with no additional interfaces.
15 # To add features, define any of the following:
17 # !!!! After changing features do "nmake clean" first !!!!
19 # Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is BIG)
21 # GUI interface: GUI=yes (default is no)
23 # OLE interface: OLE=yes (usually with GUI=yes)
25 # Multibyte support: MBYTE=yes (default is no)
27 # IME support: IME=yes (requires GUI=yes)
28 # DYNAMIC_IME=[yes or no] (to load the imm32.dll dynamically, default
29 # is yes)
30 # Global IME support: GIME=yes (requires GUI=yes)
32 # MzScheme interface:
33 # MZSCHEME=[Path to MzScheme directory]
34 # DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically)
35 # MZSCHEME_VER=[version, 205_000, ...]
37 # Perl interface:
38 # PERL=[Path to Perl directory]
39 # DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
40 # PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc]
41 # (default is 56)
43 # Python interface:
44 # PYTHON=[Path to Python directory]
45 # DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
46 # PYTHON_VER=[Python version, eg 15, 20] (default is 22)
48 # Ruby interface:
49 # RUBY=[Path to Ruby directory]
50 # DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
51 # RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
52 # RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
53 # You must set RUBY_VER_LONG when change RUBY_VER.
55 # Tcl interface:
56 # TCL=[Path to Tcl directory]
57 # DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
58 # TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
59 # TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
60 # You must set TCL_VER_LONG when you set TCL_VER.
62 # SNiFF+ interface: SNIFF=yes
64 # Cscope support: CSCOPE=yes
66 # Iconv library support (always dynamically loaded):
67 # ICONV=[yes or no] (default is yes)
69 # Intl library support (always dynamically loaded):
70 # GETTEXT=[yes or no] (default is yes)
71 # See http://sourceforge.net/projects/gettext/
73 # PostScript printing: POSTSCRIPT=yes (default is no)
75 # Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
77 # XPM Image Support: XPM=[path to XPM directory]
79 # Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
81 # Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
82 # i386)
84 # Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
86 # Debug version: DEBUG=yes
87 # Mapfile: MAP=[no, yes or lines] (default is yes)
88 # no: Don't write a mapfile.
89 # yes: Write a normal mapfile.
90 # lines: Write a mapfile with line numbers (only for VC6 and later)
92 # Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
93 # doesn't work)
95 # Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
97 # You can combine any of these interfaces
99 # Example: To build the non-debug, GUI version with Perl interface:
100 # nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
102 # DEBUG with Make_mvc.mak and Make_dvc.mak:
103 # This makefile gives a fineness of control which is not supported in
104 # Visual C++ configuration files. Therefore, debugging requires a bit of
105 # extra work.
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...
108 # To use Make_dvc.mak:
109 # 1) Build Vim with Make_mvc.mak.
110 # Use a "DEBUG=yes" argument to build Vim with debug support.
111 # E.g. the following builds gvimd.exe:
112 # nmake -f Make_mvc.mak debug=yes gui=yes
113 # 2) Use MS Devstudio and set it up to allow that file to be debugged:
114 # i) Pass Make_dvc.mak to the IDE.
115 # Use the "open workspace" menu entry to load Make_dvc.mak.
116 # Alternatively, from the command line:
117 # msdev /nologo Make_dvc.mak
118 # Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
119 # this and offer to convert it to their own format. Accept that.
120 # It creates a file called Make_dvc.dsw which can then be used
121 # for further operations. E.g.
122 # msdev /nologo Make_dvc.dsw
123 # ii) Set the built executable for debugging:
124 # a) Alt+F7/Debug takes you to the Debug dialog.
125 # b) Fill "Executable for debug session". e.g. gvimd.exe
126 # c) Fill "Program arguments". e.g. -R dosinst.c
127 # d) Complete the dialog
128 # 3) You can now debug the executable you built with Make_mvc.mak
130 # Note: Make_dvc.mak builds vimrun.exe, because it must build something
131 # to be a valid makefile..
133 ### See feature.h for a list of optionals.
134 # If you want to build some optional features without modifying the source,
135 # you can set DEFINES on the command line, e.g.,
136 # nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
138 # Build on both Windows NT/XP and Windows 9x
140 TARGETOS = BOTH
142 # Select one of eight object code directories, depends on GUI, OLE, DEBUG and
143 # interfaces.
144 # If you change something else, do "make clean" first!
145 !if "$(GUI)" == "yes"
146 OBJDIR = .\ObjG
147 !else
148 OBJDIR = .\ObjC
149 !endif
150 !if "$(OLE)" == "yes"
151 OBJDIR = $(OBJDIR)O
152 !endif
153 !ifdef PERL
154 OBJDIR = $(OBJDIR)L
155 !endif
156 !ifdef PYTHON
157 OBJDIR = $(OBJDIR)Y
158 !endif
159 !ifdef TCL
160 OBJDIR = $(OBJDIR)T
161 !endif
162 !ifdef RUBY
163 OBJDIR = $(OBJDIR)R
164 !endif
165 !ifdef MZSCHEME
166 OBJDIR = $(OBJDIR)Z
167 !endif
168 !if "$(DEBUG)" == "yes"
169 OBJDIR = $(OBJDIR)d
170 !endif
172 # Win32.mak requires that CPU be set appropriately.
173 # To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
175 !ifdef PROCESSOR_ARCHITECTURE
176 # We're on Windows NT or using VC 6+
177 ! ifdef CPU
178 ASSEMBLY_ARCHITECTURE=$(CPU)
179 # Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7.
180 ! if ("$(ASSEMBLY_ARCHITECTURE)" == "i386") || ("$(ASSEMBLY_ARCHITECTURE)" == "I386")
181 ASSEMBLY_ARCHITECTURE = x86
182 ! endif
183 ! else
184 CPU = $(PROCESSOR_ARCHITECTURE)
185 ASSEMBLY_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
186 ! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
187 CPU = i386
188 ! endif
189 ! endif
190 !else # !PROCESSOR_ARCHITECTURE
191 # We're on Windows 95
192 CPU = i386
193 !endif # !PROCESSOR_ARCHITECTURE
195 !if ("$(CPU)" == "AMD64") || ("$(CPU)" == "IA64")
196 DEFINES=$(DEFINES) /Wp64
197 !endif
199 # Build a retail version by default
201 !if "$(DEBUG)" != "yes"
202 NODEBUG = 1
203 !else
204 !undef NODEBUG
205 MAKEFLAGS_GVIMEXT = DEBUG=yes
206 !endif
209 # Get all sorts of useful, standard macros from the Platform SDK.
211 !include <Win32.mak>
214 #>>>>> path of the compiler and linker; name of include and lib directories
215 # PATH = c:\msvc20\bin;$(PATH)
216 # INCLUDE = c:\msvc20\include
217 # LIB = c:\msvc20\lib
219 !ifndef CTAGS
220 CTAGS = ctags
221 !endif
223 !if "$(SNIFF)" == "yes"
224 # SNIFF - Include support for SNiFF+.
225 SNIFF_INCL = if_sniff.h
226 SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
227 SNIFF_LIB = shell32.lib
228 SNIFF_DEFS = -DFEAT_SNIFF
229 # The SNiFF integration needs multithreaded libraries!
230 MULTITHREADED = yes
231 !endif
233 !ifndef CSCOPE
234 CSCOPE = yes
235 !endif
237 !if "$(CSCOPE)" == "yes"
238 # CSCOPE - Include support for Cscope
239 CSCOPE_INCL = if_cscope.h
240 CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
241 CSCOPE_DEFS = -DFEAT_CSCOPE
242 !endif
244 !ifndef NETBEANS
245 NETBEANS = $(GUI)
246 !endif
248 # Only allow NETBEANS and XPM for a GUI build.
249 !if "$(GUI)" == "yes"
250 !if "$(NETBEANS)" == "yes"
251 # NETBEANS - Include support for Netbeans integration
252 NETBEANS_PRO = proto/netbeans.pro
253 NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
254 NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
256 !if "$(NBDEBUG)" == "yes"
257 NBDEBUG_DEFS = -DNBDEBUG
258 NBDEBUG_INCL = nbdebug.h
259 NBDEBUG_SRC = nbdebug.c
260 !endif
261 NETBEANS_LIB = WSock32.lib
262 !endif
264 !ifdef XPM
265 # XPM - Include support for XPM signs
266 # you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
267 XPM_OBJ = $(OBJDIR)/xpm_w32.obj
268 XPM_DEFS = -DFEAT_XPM_W32
269 XPM_LIB = $(XPM)\lib\libXpm.lib
270 XPM_INC = -I $(XPM)\include
271 !endif
272 !endif
274 # Set which version of the CRT to use
275 !if defined(USE_MSVCRT)
276 # CVARS = $(cvarsdll)
277 # !elseif defined(MULTITHREADED)
278 # CVARS = $(cvarsmt)
279 !else
280 # CVARS = $(cvars)
281 # CVARS = $(cvarsmt)
282 !endif
284 # need advapi32.lib for GetUserName()
285 # need shell32.lib for ExtractIcon()
286 # gdi32.lib and comdlg32.lib for printing support
287 # ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
288 CON_LIB = advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib
289 !if "$(DELAYLOAD)" == "yes"
290 CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
291 !endif
293 ### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
294 # When set to 0x0500 ":browse" stops working.
295 !ifndef WINVER
296 WINVER = 0x0400
297 !endif
299 # If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
300 # default, use these lines.
301 #VIMRCLOC = somewhere
302 #VIMRUNTIMEDIR = somewhere
304 CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
305 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
306 $(NBDEBUG_DEFS) $(XPM_DEFS) \
307 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
308 /Fo$(OUTDIR)/
310 #>>>>> end of choices
311 ###########################################################################
313 !ifdef OS
314 OS_TYPE = winnt
315 DEL_TREE = rmdir /s /q
316 !else
317 OS_TYPE = win95
318 DEL_TREE = deltree /y
319 !endif
321 INTDIR=$(OBJDIR)
322 OUTDIR=$(OBJDIR)
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
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
360 # Convert processor ID to MVC-compatible number
361 !if "$(MSVCVER)" != "8.0"
362 !if "$(CPUNR)" == "i386"
363 CPUARG = /G3
364 !elseif "$(CPUNR)" == "i486"
365 CPUARG = /G4
366 !elseif "$(CPUNR)" == "i586"
367 CPUARG = /G5
368 !elseif "$(CPUNR)" == "i686"
369 CPUARG = /G6
370 !elseif "$(CPUNR)" == "pentium4"
371 CPUARG = /G7 /arch:SSE2
372 !else
373 CPUARG =
374 !endif
375 !else
376 # VC8 only allows specifying SSE architecture
377 !if "$(CPUNR)" == "pentium4"
378 CPUARG = /arch:SSE2
379 !endif
380 !endif
382 LIBC =
383 DEBUGINFO = /Zi
385 !ifdef NODEBUG
386 VIM = vim
387 !if "$(OPTIMIZE)" == "SPACE"
388 OPTFLAG = /O1
389 !elseif "$(OPTIMIZE)" == "SPEED"
390 OPTFLAG = /O2
391 !else # MAXSPEED
392 OPTFLAG = /Ox
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
400 CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
401 RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
402 ! ifdef USE_MSVCRT
403 CFLAGS = $(CFLAGS) /MD
404 LIBC = msvcrt.lib
405 ! else
406 LIBC = libcmt.lib
407 CFLAGS = $(CFLAGS) /MT
408 ! endif
409 !else # DEBUG
410 VIM = vimd
411 ! if "$(CPU)" == "i386"
412 DEBUGINFO = /ZI
413 ! endif
414 CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
415 RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
416 # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
417 ! if "$(MSVCVER)" == "4.0"
418 LIBC =
419 ! else
420 LIBC = /fixed:no
421 ! endif
422 ! ifdef USE_MSVCRT
423 CFLAGS = $(CFLAGS) /MDd
424 LIBC = $(LIBC) msvcrtd.lib
425 ! else
426 LIBC = $(LIBC) libcmtd.lib
427 CFLAGS = $(CFLAGS) /MTd
428 ! endif
429 !endif # DEBUG
431 INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
432 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
433 $(NBDEBUG_INCL)
435 OBJ = \
436 $(OUTDIR)\buffer.obj \
437 $(OUTDIR)\charset.obj \
438 $(OUTDIR)\diff.obj \
439 $(OUTDIR)\digraph.obj \
440 $(OUTDIR)\edit.obj \
441 $(OUTDIR)\eval.obj \
442 $(OUTDIR)\ex_cmds.obj \
443 $(OUTDIR)\ex_cmds2.obj \
444 $(OUTDIR)\ex_docmd.obj \
445 $(OUTDIR)\ex_eval.obj \
446 $(OUTDIR)\ex_getln.obj \
447 $(OUTDIR)\fileio.obj \
448 $(OUTDIR)\fold.obj \
449 $(OUTDIR)\getchar.obj \
450 $(OUTDIR)\hardcopy.obj \
451 $(OUTDIR)\hashtab.obj \
452 $(OUTDIR)\main.obj \
453 $(OUTDIR)\mark.obj \
454 $(OUTDIR)\mbyte.obj \
455 $(OUTDIR)\memfile.obj \
456 $(OUTDIR)\memline.obj \
457 $(OUTDIR)\menu.obj \
458 $(OUTDIR)\message.obj \
459 $(OUTDIR)\misc1.obj \
460 $(OUTDIR)\misc2.obj \
461 $(OUTDIR)\move.obj \
462 $(OUTDIR)\normal.obj \
463 $(OUTDIR)\ops.obj \
464 $(OUTDIR)\option.obj \
465 $(OUTDIR)\os_mswin.obj \
466 $(OUTDIR)\os_win32.obj \
467 $(OUTDIR)\pathdef.obj \
468 $(OUTDIR)\popupmnu.obj \
469 $(OUTDIR)\quickfix.obj \
470 $(OUTDIR)\regexp.obj \
471 $(OUTDIR)\screen.obj \
472 $(OUTDIR)\search.obj \
473 $(OUTDIR)\spell.obj \
474 $(OUTDIR)\syntax.obj \
475 $(OUTDIR)\tag.obj \
476 $(OUTDIR)\term.obj \
477 $(OUTDIR)\ui.obj \
478 $(OUTDIR)\undo.obj \
479 $(OUTDIR)\window.obj \
480 $(OUTDIR)\vim.res
482 !if "$(OLE)" == "yes"
483 CFLAGS = $(CFLAGS) -DFEAT_OLE
484 RCFLAGS = $(RCFLAGS) -DFEAT_OLE
485 OLE_OBJ = $(OUTDIR)\if_ole.obj
486 OLE_IDL = if_ole.idl
487 OLE_LIB = oleaut32.lib
488 !endif
490 !if "$(IME)" == "yes"
491 CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
492 !ifndef DYNAMIC_IME
493 DYNAMIC_IME = yes
494 !endif
495 !if "$(DYNAMIC_IME)" == "yes"
496 CFLAGS = $(CFLAGS) -DDYNAMIC_IME
497 !else
498 IME_LIB = imm32.lib
499 !endif
500 !endif
502 !if "$(GIME)" == "yes"
503 CFLAGS = $(CFLAGS) -DGLOBAL_IME
504 OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
505 MBYTE = yes
506 !endif
508 !if "$(MBYTE)" == "yes"
509 CFLAGS = $(CFLAGS) -DFEAT_MBYTE
510 !endif
512 !if "$(GUI)" == "yes"
513 SUBSYSTEM = windows
514 CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
515 RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
516 VIM = g$(VIM)
517 GUI_INCL = \
518 gui.h \
519 regexp.h \
520 ascii.h \
521 ex_cmds.h \
522 farsi.h \
523 feature.h \
524 globals.h \
525 gui_beval.h \
526 keymap.h \
527 macros.h \
528 option.h \
529 os_dos.h \
530 os_win32.h
531 GUI_OBJ = \
532 $(OUTDIR)\gui.obj \
533 $(OUTDIR)\gui_beval.obj \
534 $(OUTDIR)\gui_w32.obj \
535 $(OUTDIR)\os_w32exe.obj
536 GUI_LIB = \
537 oldnames.lib kernel32.lib gdi32.lib version.lib $(IME_LIB) \
538 winspool.lib comctl32.lib advapi32.lib shell32.lib \
539 /machine:$(CPU) /nodefaultlib
540 !else
541 SUBSYSTEM = console
542 !endif
544 # iconv.dll library (dynamically loaded)
545 !ifndef ICONV
546 ICONV = yes
547 !endif
548 !if "$(ICONV)" == "yes"
549 CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
550 !endif
552 # libintl.dll library
553 !ifndef GETTEXT
554 GETTEXT = yes
555 !endif
556 !if "$(GETTEXT)" == "yes"
557 CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
558 !endif
560 # TCL interface
561 !ifdef TCL
562 !ifndef TCL_VER
563 TCL_VER = 83
564 TCL_VER_LONG = 8.3
565 !endif
566 !message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
567 !if "$(DYNAMIC_TCL)" == "yes"
568 !message Tcl DLL will be loaded dynamically
569 TCL_DLL = tcl$(TCL_VER).dll
570 CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
571 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
572 TCL_OBJ = $(OUTDIR)\if_tcl.obj
573 TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
574 TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
575 !else
576 CFLAGS = $(CFLAGS) -DFEAT_TCL
577 TCL_OBJ = $(OUTDIR)\if_tcl.obj
578 TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
579 TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
580 !endif
581 !endif
583 # PYTHON interface
584 !ifdef PYTHON
585 !ifndef PYTHON_VER
586 PYTHON_VER = 22
587 !endif
588 !message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
589 !if "$(DYNAMIC_PYTHON)" == "yes"
590 !message Python DLL will be loaded dynamically
591 !endif
592 CFLAGS = $(CFLAGS) -DFEAT_PYTHON
593 PYTHON_OBJ = $(OUTDIR)\if_python.obj
594 PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
595 !if "$(DYNAMIC_PYTHON)" == "yes"
596 CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
597 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
598 PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
599 !else
600 PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
601 !endif
602 !endif
604 # MzScheme interface
605 !ifdef MZSCHEME
606 !message MzScheme requested - root dir is "$(MZSCHEME)"
607 !ifndef MZSCHEME_VER
608 MZSCHEME_VER = 205_000
609 !endif
610 CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
611 !if "$(DYNAMIC_MZSCHEME)" == "yes"
612 !message MzScheme DLLs will be loaded dynamically
613 CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
614 -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" \
615 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
616 !else
617 MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
618 $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
619 !endif
620 MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
621 !endif
623 # Perl interface
624 !ifdef PERL
625 !ifndef PERL_VER
626 PERL_VER = 56
627 !endif
628 !message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
629 !if "$(DYNAMIC_PERL)" == "yes"
630 !if $(PERL_VER) >= 56
631 !message Perl DLL will be loaded dynamically
632 !else
633 !message Dynamic loading is not supported for Perl versions earlier than 5.6.0
634 !message Reverting to static loading...
635 !undef DYNAMIC_PERL
636 !endif
637 !endif
639 # Is Perl installed in architecture-specific directories?
640 !if exist($(PERL)\Bin\MSWin32-x86)
641 PERL_ARCH = \MSWin32-x86
642 !endif
644 PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
646 # Version-dependent stuff
647 !if $(PERL_VER) == 55
648 PERL_LIB = $(PERL_INCDIR)\perl.lib
649 !else
650 PERL_DLL = perl$(PERL_VER).dll
651 PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
652 !endif
654 CFLAGS = $(CFLAGS) -DFEAT_PERL
656 # Do we want to load Perl dynamically?
657 !if "$(DYNAMIC_PERL)" == "yes"
658 CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
659 !undef PERL_LIB
660 !endif
662 PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
663 PERL_INC = /I $(PERL_INCDIR)
664 PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
665 XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
666 XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
668 !endif
671 # Support Ruby interface
673 !ifdef RUBY
674 # Set default value
675 !ifndef RUBY_VER
676 RUBY_VER = 18
677 !endif
678 !ifndef RUBY_VER_LONG
679 RUBY_VER_LONG = 1.8
680 !endif
682 !if $(RUBY_VER) >= 18
683 !ifndef RUBY_PLATFORM
684 RUBY_PLATFORM = i386-mswin32
685 !endif
686 !ifndef RUBY_INSTALL_NAME
687 RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
688 !endif
689 !else
690 !ifndef RUBY_PLATFORM
691 RUBY_PLATFORM = i586-mswin32
692 !endif
693 !ifndef RUBY_INSTALL_NAME
694 RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
695 !endif
696 !endif # $(RUBY_VER) >= 18
698 !message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
699 CFLAGS = $(CFLAGS) -DFEAT_RUBY
700 RUBY_OBJ = $(OUTDIR)\if_ruby.obj
701 RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
702 RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
703 # Do we want to load Ruby dynamically?
704 !if "$(DYNAMIC_RUBY)" == "yes"
705 !message Ruby DLL will be loaded dynamically
706 CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
707 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
708 !undef RUBY_LIB
709 !endif
710 !endif # RUBY
713 # Support PostScript printing
715 !if "$(POSTSCRIPT)" == "yes"
716 CFLAGS = $(CFLAGS) -DMSWINPS
717 !endif # POSTSCRIPT
720 # FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
722 !if "$(FEATURES)"==""
723 FEATURES = BIG
724 !endif
725 CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
728 # Always generate the .pdb file, so that we get debug symbols that can be used
729 # on a crash (doesn't add overhead to the executable).
730 # Generate edit-and-continue debug info when no optimization - allows to
731 # debug more conveniently (able to look at variables which are in registers)
733 CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
734 LINK_PDB = /PDB:$(VIM).pdb -debug
737 # End extra feature include
739 !message
741 conflags = /nologo /subsystem:$(SUBSYSTEM)
743 PATHDEF_SRC = $(OUTDIR)\pathdef.c
745 !IF "$(MAP)" == "yes"
746 # "/map" is for debugging
747 conflags = $(conflags) /map
748 !ELSEIF "$(MAP)" == "lines"
749 # "/mapinfo:lines" is for debugging, only works for VC6 and later
750 conflags = $(conflags) /map /mapinfo:lines
751 !ENDIF
753 LINKARGS1 = $(linkdebug) $(conflags)
754 LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
755 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
756 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
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
767 all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
768 GvimExt/gvimext.dll
770 $(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
771 $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
772 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) version.c version.h
773 $(CC) $(CFLAGS) version.c
774 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
775 $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) \
776 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
777 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
779 $(VIM): $(VIM).exe
781 $(OUTDIR):
782 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
784 install.exe: dosinst.c
785 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
786 ole32.lib advapi32.lib uuid.lib
787 - if exist install.exe del install.exe
788 ren dosinst.exe install.exe
790 uninstal.exe: uninstal.c
791 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
793 vimrun.exe: vimrun.c
794 $(CC) /nologo -DNDEBUG vimrun.c
796 xxd/xxd.exe: xxd/xxd.c
797 cd xxd
798 $(MAKE) /NOLOGO -f Make_mvc.mak
799 cd ..
801 GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
802 cd GvimExt
803 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
804 cd ..
807 tags: notags
808 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
810 notags:
811 - if exist tags del tags
813 clean:
814 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
815 - if exist *.obj del *.obj
816 - if exist $(VIM).exe del $(VIM).exe
817 - if exist $(VIM).ilk del $(VIM).ilk
818 - if exist $(VIM).pdb del $(VIM).pdb
819 - if exist $(VIM).map del $(VIM).map
820 - if exist $(VIM).ncb del $(VIM).ncb
821 - if exist vimrun.exe del vimrun.exe
822 - if exist install.exe del install.exe
823 - if exist uninstal.exe del uninstal.exe
824 - if exist if_perl.c del if_perl.c
825 - if exist dimm.h del dimm.h
826 - if exist dimm_i.c del dimm_i.c
827 - if exist dimm.tlb del dimm.tlb
828 - if exist dosinst.exe del dosinst.exe
829 cd xxd
830 $(MAKE) /NOLOGO -f Make_mvc.mak clean
831 cd ..
832 cd GvimExt
833 $(MAKE) /NOLOGO -f Makefile clean
834 cd ..
835 cd GvimExt
836 $(MAKE) /NOLOGO -f Makefile clean
837 cd ..
838 - if exist testdir\*.out del testdir\*.out
840 test:
841 cd testdir
842 $(MAKE) /NOLOGO -f Make_dos.mak win32
843 cd ..
845 testclean:
846 cd testdir
847 $(MAKE) /NOLOGO -f Make_dos.mak clean
848 cd ..
850 ###########################################################################
852 # Create a default rule for transforming .c files to .obj files in $(OUTDIR)
853 # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
854 !IF "$(MSVCVER)" == "4.0"
855 .c{$(OUTDIR)/}.obj:
856 !ELSE
857 .c{$(OUTDIR)/}.obj::
858 !ENDIF
859 $(CC) $(CFLAGS) $<
861 # Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
862 # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
863 !IF "$(MSVCVER)" == "4.0"
864 .cpp{$(OUTDIR)/}.obj:
865 !ELSE
866 .cpp{$(OUTDIR)/}.obj::
867 !ENDIF
868 $(CC) $(CFLAGS) $<
870 $(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
872 $(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
874 $(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
876 $(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
878 $(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
880 $(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
882 $(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
884 $(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
886 $(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
888 $(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
890 $(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
892 $(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
894 $(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
896 $(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
898 $(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
900 $(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
902 $(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
904 $(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
906 $(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
908 $(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
910 if_perl.c : if_perl.xs typemap
911 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
912 -typemap typemap if_perl.xs > if_perl.c
914 $(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
915 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
917 $(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
918 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
920 $(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL)
921 $(CC) $(CFLAGS) if_mzsch.c \
922 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
924 $(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
925 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
927 $(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
929 $(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
930 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
932 $(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
933 $(CC) $(CFLAGS) if_sniff.c
935 $(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
936 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
938 $(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
940 $(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
942 $(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
944 $(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
946 $(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
948 $(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
950 $(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
952 $(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
954 $(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
956 $(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
958 $(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
960 $(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
962 $(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
964 $(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
966 $(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
968 $(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
970 $(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
972 $(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
973 $(CC) $(CFLAGS) $(PATHDEF_SRC)
975 $(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
977 $(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
979 $(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
981 $(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
983 $(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
985 $(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
987 $(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
989 $(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
991 $(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
993 $(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
995 $(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
997 $(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
999 $(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
1000 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
1002 $(OUTDIR)/vim.res: $(OUTDIR) vim.rc version.h tools.bmp tearoff.bmp \
1003 vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
1004 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1006 iid_ole.c if_ole.h vim.tlb: if_ole.idl
1007 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1008 /header if_ole.h if_ole.idl
1010 dimm.h dimm_i.c: dimm.idl
1011 midl /nologo /error none /proxy nul dimm.idl
1013 $(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1015 $(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1017 # $CFLAGS may contain backslashes and double quotes, escape them both.
1018 E0_CFLAGS = $(CFLAGS:\=\\)
1019 E_CFLAGS = $(E0_CFLAGS:"=\")
1020 # ") stop the string
1022 $(PATHDEF_SRC): auto
1023 @echo creating $(PATHDEF_SRC)
1024 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1025 @echo #include "vim.h" >> $(PATHDEF_SRC)
1026 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1027 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1028 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
1029 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> $(PATHDEF_SRC)
1030 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1031 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
1033 auto:
1034 if not exist auto/nul mkdir auto
1036 # End Custom Build
1037 proto.h: \
1038 proto/buffer.pro \
1039 proto/charset.pro \
1040 proto/diff.pro \
1041 proto/digraph.pro \
1042 proto/edit.pro \
1043 proto/eval.pro \
1044 proto/ex_cmds.pro \
1045 proto/ex_cmds2.pro \
1046 proto/ex_docmd.pro \
1047 proto/ex_eval.pro \
1048 proto/ex_getln.pro \
1049 proto/fileio.pro \
1050 proto/getchar.pro \
1051 proto/hardcopy.pro \
1052 proto/hashtab.pro \
1053 proto/main.pro \
1054 proto/mark.pro \
1055 proto/memfile.pro \
1056 proto/memline.pro \
1057 proto/menu.pro \
1058 proto/message.pro \
1059 proto/misc1.pro \
1060 proto/misc2.pro \
1061 proto/move.pro \
1062 proto/mbyte.pro \
1063 proto/normal.pro \
1064 proto/ops.pro \
1065 proto/option.pro \
1066 proto/os_mswin.pro \
1067 proto/os_win32.pro \
1068 proto/popupmnu.pro \
1069 proto/quickfix.pro \
1070 proto/regexp.pro \
1071 proto/screen.pro \
1072 proto/search.pro \
1073 proto/spell.pro \
1074 proto/syntax.pro \
1075 proto/tag.pro \
1076 proto/term.pro \
1077 proto/ui.pro \
1078 proto/undo.pro \
1079 proto/window.pro \
1080 $(NETBEANS_PRO)
1082 .SUFFIXES: .cod .i
1084 # Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1085 # foo.cod"
1086 .c.cod:
1087 $(CC) $(CFLAGS) /FAcs $<
1089 # Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1090 .c.i:
1091 $(CC) $(CFLAGS) /P /C $<
1094 # vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: