blob: 4d4ea225e39db8e487e077a5b84c0df9dcbe2c73 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001# Makefile for Vim on Win32 (Windows NT and Windows 95), using the
2# Microsoft Visual C++ 2.x and MSVC 4.x compilers (or newer).
3# It builds on Windows 95 and all four NT platforms: i386, Alpha, MIPS, and
4# PowerPC. The NT/i386 binary and the Windows 95 binary are identical.
5#
6# This makefile can build the console, GUI, OLE-enable, Perl-enabled and
7# Python-enabled versions of vim for Win32 platforms.
8#
9# When compiling different versions, do "nmake clean" first!
10#
11# The basic command line to build vim is:
12# nmake -f Make_mvc.mak
13# This will build the console version of vim with no additional interfaces.
14# To add interfaces, define any of the following:
15# GUI interface: GUI=yes (default is no)
16# OLE interface: OLE=yes (usually with GUI=yes)
17# Multibyte support: MBYTE=yes
18# IME support: IME=yes (requires GUI=yes)
19# DYNAMIC_IME=[yes or no] (to load the imm32.dll dynamically, default
20# is yes)
21# Global IME support: GIME=yes (requires GUI=yes)
Bram Moolenaar65c1b012005-01-31 19:02:28 +000022# MzScheme interface:
23# MZSCHEME=[Path to MzScheme directory]
24# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically)
25# MZSCHEME_VER=[version, 205_000, ...]
Bram Moolenaar071d4272004-06-13 20:20:40 +000026# Perl interface:
27# PERL=[Path to Perl directory]
28# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
29# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc] (default is 56)
30# Python interface:
31# PYTHON=[Path to Python directory]
32# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
33# PYTHON_VER=[Python version, eg 15, 20] (default is 22)
34# Ruby interface:
35# RUBY=[Path to Ruby directory]
36# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
37# RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
38# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
39# You must set RUBY_VER_LONG when change RUBY_VER.
40# Tcl interface:
41# TCL=[Path to Tcl directory]
42# DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
43# TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
44# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
45# You must set TCL_VER_LONG when you set TCL_VER.
46# Debug version: DEBUG=yes
47# Mapfile: MAP=[no, yes or lines] (default is yes)
48# no: Don't write a mapfile.
49# yes: Write a normal mapfile.
50# lines: Write a mapfile with line numbers (only for VC6 and later)
51# SNiFF+ interface: SNIFF=yes
52# Cscope support: CSCOPE=yes
53# Iconv library support (always dynamically loaded):
54# ICONV=[yes or no] (default is yes)
55# Intl library support (always dynamically loaded):
56# GETTEXT=[yes or no] (default is yes)
57# See http://sourceforge.net/projects/gettext/
58# PostScript printing: POSTSCRIPT=yes (default is no)
Bram Moolenaar34114692005-01-02 11:28:13 +000059# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is BIG)
Bram Moolenaar071d4272004-06-13 20:20:40 +000060# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
Bram Moolenaarcf3630f2005-01-08 16:04:29 +000061# Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is i386)
Bram Moolenaar071d4272004-06-13 20:20:40 +000062# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
63# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +000064# Netbeans Debugging Support: NBDEBUG=[yes or no] (default is no)
Bram Moolenaar071d4272004-06-13 20:20:40 +000065# XPM Image Support: XPM=[path to XPM directory]
66#
67# You can combine any of these interfaces
68#
69# Example: To build the non-debug, GUI version with Perl interface:
70# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
71#
72# To build using Borland C++, use Make_bc3.mak or Make_bc5.mak.
73#
74# DEBUG with Make_mvc.mak and Make_dvc.mak:
75# This makefile gives a fineness of control which is not supported in
76# Visual C++ configuration files. Therefore, debugging requires a bit of
77# extra work.
78# Make_dvc.mak is a Visual C++ project to access that support.
79# To use Make_dvc.mak:
80# 1) Build Vim with Make_mvc.mak.
81# Use a "DEBUG=yes" argument to build Vim with debug support.
82# E.g. the following builds gvimd.exe:
83# nmake -f Make_mvc.mak debug=yes gui=yes
84# 2) Use MS Devstudio and set it up to allow that file to be debugged:
85# i) Pass Make_dvc.mak to the IDE.
86# Use the "open workspace" menu entry to load Make_dvc.mak.
87# Alternatively, from the command line:
88# msdev /nologo Make_dvc.mak
89# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
90# this and offer to convert it to their own format. Accept that.
91# It creates a file called Make_dvc.dsw which can then be used
92# for further operations. E.g.
93# msdev /nologo Make_dvc.dsw
94# ii) Set the built executable for debugging:
95# a) Alt+F7/Debug takes you to the Debug dialog.
96# b) Fill "Executable for debug session". e.g. gvimd.exe
97# c) Fill "Program arguments". e.g. -R dosinst.c
98# d) Complete the dialog
99# 3) You can now debug the executable you built with Make_mvc.mak
100#
101# Note: Make_dvc.mak builds vimrun.exe, because it must build something
102# to be a valid makefile..
103
104### See feature.h for a list of optionals.
105# If you want to build some optional features without modifying the source,
106# you can set DEFINES on the command line, e.g.,
107# nmake -f makefile.mvc "DEFINES=-DEMACS_TAGS"
108
109# Build on both Windows NT and Windows 95
110
111TARGETOS = BOTH
112
113# Select one of eight object code directories, depends on GUI, OLE and DEBUG.
114# If you change something else, do "make clean" first!
115!if "$(GUI)" == "yes"
116OBJDIR = .\ObjG
117!else
118OBJDIR = .\ObjC
119!endif
120!if "$(OLE)" == "yes"
121OBJDIR = $(OBJDIR)O
122!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000123!ifdef MZSCHEME
124OBJDIR = $(OBJDIR)Z
125!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000126!if "$(DEBUG)" == "yes"
127OBJDIR = $(OBJDIR)d
128!endif
129
130# ntwin32.mak requires that CPU be set appropriately
131
132!ifdef PROCESSOR_ARCHITECTURE
133# We're on Windows NT or using VC 6
134CPU = $(PROCESSOR_ARCHITECTURE)
135! if "$(CPU)" == "x86"
136CPU = i386
137! endif
138!else # !PROCESSOR_ARCHITECTURE
139# We're on Windows 95
140CPU = i386
141!endif # !PROCESSOR_ARCHITECTURE
142
143
144# Build a retail version by default
145
146!if "$(DEBUG)" != "yes"
147NODEBUG = 1
148!else
149MAKEFLAGS_GVIMEXT = DEBUG=yes
150!endif
151
152
153# Build a multithreaded version for the Windows 95 dead keys hack
154# Commented out because it doesn't work.
155# MULTITHREADED = 1
156
157
158# Get all sorts of useful, standard macros from the SDK. (Note that
159# MSVC 2.2 does not install <ntwin32.mak> in the \msvc20\include
160# directory, but you can find it in \msvc20\include on the CD-ROM.
161# You may also need <win32.mak> from the same place.)
162
163!include <ntwin32.mak>
164
165
166#>>>>> path of the compiler and linker; name of include and lib directories
167# PATH = c:\msvc20\bin;$(PATH)
168# INCLUDE = c:\msvc20\include
169# LIB = c:\msvc20\lib
170
171!ifndef CTAGS
172CTAGS = ctags
173!endif
174
175!if "$(SNIFF)" == "yes"
176# SNIFF - Include support for SNiFF+.
177SNIFF_INCL = if_sniff.h
178SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
179SNIFF_LIB = shell32.lib
180SNIFF_DEFS = -DFEAT_SNIFF
181# The SNiFF integration needs multithreaded libraries!
182MULTITHREADED = yes
183!endif
184
185!ifndef CSCOPE
186CSCOPE = yes
187!endif
188
189!if "$(CSCOPE)" == "yes"
190# CSCOPE - Include support for Cscope
191CSCOPE_INCL = if_cscope.h
192CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
193CSCOPE_DEFS = -DFEAT_CSCOPE
194!endif
195
196!ifndef NETBEANS
197NETBEANS = $(GUI)
198!endif
199
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000200# Only allow NETBEANS and XPM for a GUI build.
201!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000202!if "$(NETBEANS)" == "yes"
203# NETBEANS - Include support for Netbeans integration
204NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000205NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000206NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000207
208!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000209NBDEBUG_DEFS = -DNBDEBUG
210NBDEBUG_INCL = nbdebug.h
211NBDEBUG_SRC = nbdebug.c
212!endif
213NETBEANS_LIB = WSock32.lib
214!endif
215
216!ifdef XPM
217# XPM - Include support for XPM signs
218# you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
219XPM_OBJ = $(OBJDIR)/xpm_w32.obj
220XPM_DEFS = -DFEAT_XPM_W32
221XPM_LIB = $(XPM)\lib\libXpm.lib
222XPM_INC = -I $(XPM)\include
223!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000224!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000225
226!if defined(USE_MSVCRT)
227CVARS = $(cvarsdll)
228!elseif defined(MULTITHREADED)
229CVARS = $(cvarsmt)
230!else
231CVARS = $(cvars)
232!endif
233
234# need advapi32.lib for GetUserName()
235# need shell32.lib for ExtractIcon()
236# gdi32.lib and comdlg32.lib for printing support
237# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
238CON_LIB = advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib
239!if "$(VC6)" == "yes"
240CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
241!endif
242
243### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
244# When set to 0x0500 ":browse" stops working.
245!ifndef WINVER
246WINVER = 0x0400
247!endif
248
249# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
250# default, use these lines.
251#VIMRCLOC = somewhere
252#VIMRUNTIMEDIR = somewhere
253
254CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
255 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
256 $(NBDEBUG_DEFS) $(XPM_DEFS) \
257 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
258
259#>>>>> end of choices
260###########################################################################
261
262!ifdef OS
263OS_TYPE = winnt
264DEL_TREE = rmdir /s /q
265!else
266OS_TYPE = win95
267DEL_TREE = deltree /y
268!endif
269
270INTDIR=$(OBJDIR)
271OUTDIR=$(OBJDIR)
272
273# Convert processor ID to MVC-compatible number
274!if "$(CPUNR)" == "i386"
275CPUARG = /G3
276!elseif "$(CPUNR)" == "i486"
277CPUARG = /G4
278!elseif "$(CPUNR)" == "i586"
279CPUARG = /G5
280!elseif "$(CPUNR)" == "i686"
281CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000282!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000283CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000284!else
285CPUARG =
286!endif
287
288!ifdef NODEBUG
289VIM = vim
290!if "$(OPTIMIZE)" == "SPACE"
291OPTFLAG = /O1
292!elseif "$(OPTIMIZE)" == "SPEED"
293OPTFLAG = /O2
294!else # MAXSPEED
295OPTFLAG = /Ox
296!endif
Bram Moolenaar34114692005-01-02 11:28:13 +0000297CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000298RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000299! ifdef USE_MSVCRT
300CFLAGS = $(CFLAGS) -MD
301LIBC = msvcrt.lib
302! elseif defined(MULTITHREADED)
303LIBC = libcmt.lib
304! else
305LIBC = libc.lib
306! endif
307!else # DEBUG
308VIM = vimd
Bram Moolenaard9d30582005-05-18 22:10:28 +0000309CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000310RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
311# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
312! if "$(_NMAKE_VER)" == ""
313LIBC =
314! else
315LIBC = /fixed:no
316! endif
317
318! ifndef USE_MSVCRT
319LIBC = $(LIBC) libcd.lib
320! else
321CFLAGS = $(CFLAGS) -MDd
322LIBC = $(LIBC) msvcrtd.lib
323! endif
324!endif # DEBUG
325
326INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
327 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
328 $(NBDEBUG_INCL)
329
330OBJ = \
331 $(OUTDIR)\buffer.obj \
332 $(OUTDIR)\charset.obj \
333 $(OUTDIR)\diff.obj \
334 $(OUTDIR)\digraph.obj \
335 $(OUTDIR)\edit.obj \
336 $(OUTDIR)\eval.obj \
337 $(OUTDIR)\ex_cmds.obj \
338 $(OUTDIR)\ex_cmds2.obj \
339 $(OUTDIR)\ex_docmd.obj \
340 $(OUTDIR)\ex_eval.obj \
341 $(OUTDIR)\ex_getln.obj \
342 $(OUTDIR)\fileio.obj \
343 $(OUTDIR)\fold.obj \
344 $(OUTDIR)\getchar.obj \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000345 $(OUTDIR)\hashtable.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000346 $(OUTDIR)\main.obj \
347 $(OUTDIR)\mark.obj \
348 $(OUTDIR)\mbyte.obj \
349 $(OUTDIR)\memfile.obj \
350 $(OUTDIR)\memline.obj \
351 $(OUTDIR)\menu.obj \
352 $(OUTDIR)\message.obj \
353 $(OUTDIR)\misc1.obj \
354 $(OUTDIR)\misc2.obj \
355 $(OUTDIR)\move.obj \
356 $(OUTDIR)\normal.obj \
357 $(OUTDIR)\ops.obj \
358 $(OUTDIR)\option.obj \
359 $(OUTDIR)\os_mswin.obj \
360 $(OUTDIR)\os_win32.obj \
361 $(OUTDIR)\pathdef.obj \
362 $(OUTDIR)\quickfix.obj \
363 $(OUTDIR)\regexp.obj \
364 $(OUTDIR)\screen.obj \
365 $(OUTDIR)\search.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000366 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000367 $(OUTDIR)\syntax.obj \
368 $(OUTDIR)\tag.obj \
369 $(OUTDIR)\term.obj \
370 $(OUTDIR)\ui.obj \
371 $(OUTDIR)\undo.obj \
372 $(OUTDIR)\window.obj \
373 $(OUTDIR)\vim.res
374
375!if "$(OLE)" == "yes"
376CFLAGS = $(CFLAGS) -DFEAT_OLE
377RCFLAGS = $(RCFLAGS) -DFEAT_OLE
378OLE_OBJ = $(OUTDIR)\if_ole.obj
379OLE_IDL = if_ole.idl
380OLE_LIB = oleaut32.lib
381!endif
382
383!if "$(IME)" == "yes"
384CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
385!ifndef DYNAMIC_IME
386DYNAMIC_IME = yes
387!endif
388!if "$(DYNAMIC_IME)" == "yes"
389CFLAGS = $(CFLAGS) -DDYNAMIC_IME
390!else
391IME_LIB = imm32.lib
392!endif
393!endif
394
395!if "$(GIME)" == "yes"
396CFLAGS = $(CFLAGS) -DGLOBAL_IME
397OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
398MBYTE = yes
399!endif
400
401!if "$(MBYTE)" == "yes"
402CFLAGS = $(CFLAGS) -DFEAT_MBYTE
403!endif
404
405!if "$(GUI)" == "yes"
406SUBSYSTEM = windows
407CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
408RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
409VIM = g$(VIM)
410GUI_INCL = \
411 gui.h \
412 regexp.h \
413 ascii.h \
414 ex_cmds.h \
415 farsi.h \
416 feature.h \
417 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000418 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000419 keymap.h \
420 macros.h \
421 option.h \
422 os_dos.h \
423 os_win32.h
424GUI_OBJ = \
425 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000426 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000427 $(OUTDIR)\gui_w32.obj \
428 $(OUTDIR)\os_w32exe.obj
429GUI_LIB = \
430 oldnames.lib kernel32.lib gdi32.lib $(IME_LIB) \
431 winspool.lib comctl32.lib advapi32.lib shell32.lib \
432 /machine:$(CPU) /nodefaultlib
433!else
434SUBSYSTEM = console
435!endif
436
437# iconv.dll library (dynamically loaded)
438!ifndef ICONV
439ICONV = yes
440!endif
441!if "$(ICONV)" == "yes"
442CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
443!endif
444
445# libintl.dll library
446!ifndef GETTEXT
447GETTEXT = yes
448!endif
449!if "$(GETTEXT)" == "yes"
450CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
451!endif
452
453# TCL interface
454!ifdef TCL
455!ifndef TCL_VER
456TCL_VER = 83
457TCL_VER_LONG = 8.3
458!endif
459!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
460!if "$(DYNAMIC_TCL)" == "yes"
461!message Tcl DLL will be loaded dynamically
462TCL_DLL = tcl$(TCL_VER).dll
463CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
464TCL_OBJ = $(OUTDIR)\if_tcl.obj
465TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
466TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
467!else
468CFLAGS = $(CFLAGS) -DFEAT_TCL
469TCL_OBJ = $(OUTDIR)\if_tcl.obj
470TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
471TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
472!endif
473!endif
474
475# PYTHON interface
476!ifdef PYTHON
477!ifndef PYTHON_VER
478PYTHON_VER = 22
479!endif
480!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
481!if "$(DYNAMIC_PYTHON)" == "yes"
482!message Python DLL will be loaded dynamically
483!endif
484CFLAGS = $(CFLAGS) -DFEAT_PYTHON
485PYTHON_OBJ = $(OUTDIR)\if_python.obj
486PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
487!if "$(DYNAMIC_PYTHON)" == "yes"
488CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
489PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
490!else
491PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
492!endif
493!endif
494
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000495# MzScheme interface
496!ifdef MZSCHEME
497!message MzScheme requested - root dir is "$(MZSCHEME)"
498!ifndef MZSCHEME_VER
499MZSCHEME_VER = 205_000
500!endif
501CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000502!if "$(DYNAMIC_MZSCHEME)" == "yes"
503!message MzScheme DLLs will be loaded dynamically
504CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
505!else
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000506MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
507!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000508MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
509!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000510
Bram Moolenaar071d4272004-06-13 20:20:40 +0000511# Perl interface
512!ifdef PERL
513!ifndef PERL_VER
514PERL_VER = 56
515!endif
516!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
517!if "$(DYNAMIC_PERL)" == "yes"
518!if $(PERL_VER) >= 56
519!message Perl DLL will be loaded dynamically
520!else
521!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
522!message Reverting to static loading...
523!undef DYNAMIC_PERL
524!endif
525!endif
526
527# Is Perl installed in architecture-specific directories?
528!if exist($(PERL)\Bin\MSWin32-x86)
529PERL_ARCH = \MSWin32-x86
530!endif
531
532PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
533
534# Version-dependent stuff
535!if $(PERL_VER) == 55
536PERL_LIB = $(PERL_INCDIR)\perl.lib
537!else
538PERL_DLL = perl$(PERL_VER).dll
539PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
540!endif
541
542CFLAGS = $(CFLAGS) -DFEAT_PERL
543
544# Do we want to load Perl dynamically?
545!if "$(DYNAMIC_PERL)" == "yes"
546CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
547!undef PERL_LIB
548!endif
549
550PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
551PERL_INC = /I $(PERL_INCDIR)
552PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
553XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
554XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
555
556!endif
557
558#
559# Support Ruby interface
560#
561!ifdef RUBY
562# Set default value
563!ifndef RUBY_VER
564RUBY_VER = 18
565!endif
566!ifndef RUBY_VER_LONG
567RUBY_VER_LONG = 1.8
568!endif
569
570!if $(RUBY_VER) >= 18
571!ifndef RUBY_PLATFORM
572RUBY_PLATFORM = i386-mswin32
573!endif
574!ifndef RUBY_INSTALL_NAME
575RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
576!endif
577!else
578!ifndef RUBY_PLATFORM
579RUBY_PLATFORM = i586-mswin32
580!endif
581!ifndef RUBY_INSTALL_NAME
582RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
583!endif
584!endif # $(RUBY_VER) >= 18
585
586!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
587CFLAGS = $(CFLAGS) -DFEAT_RUBY
588RUBY_OBJ = $(OUTDIR)\if_ruby.obj
589RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
590RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
591# Do we want to load Ruby dynamically?
592!if "$(DYNAMIC_RUBY)" == "yes"
593!message Ruby DLL will be loaded dynamically
594CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" -DDYNAMIC_RUBY_VER=$(RUBY_VER)
595!undef RUBY_LIB
596!endif
597!endif # RUBY
598
599#
600# Support PostScript printing
601#
602!if "$(POSTSCRIPT)" == "yes"
603CFLAGS = $(CFLAGS) -DMSWINPS
604!endif # POSTSCRIPT
605
606#
607# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
608#
609!if "$(FEATURES)"==""
610FEATURES = BIG
611!endif
612CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
613
614#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000615# Always generate the .pdb file, so that we get debug symbols that can be used
616# on a crash (doesn't add overhead to the executable).
617#
618CFLAGS = $(CFLAGS) /Zi
619PDB = /Fd$(OUTDIR)/
620LINK_PDB = /PDB:$(OUTDIR)/$(VIM).pdb -debug:full -debugtype:cv,fixup
621
622#
623# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000624#
625!message
626
627conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
628
629!IF "$(MAP)" == "yes"
630# "/map" is for debugging
631conflags = $(conflags) /map
632!ELSEIF "$(MAP)" == "lines"
633# "/mapinfo:lines" is for debugging, only works for VC6 and later
634conflags = $(conflags) /map /mapinfo:lines
635!ENDIF
636
637LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
638LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000639 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) $(TCL_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000640 $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
641
642all: $(VIM) vimrun.exe install.exe uninstal.exe xxd/xxd.exe GvimExt/gvimext.dll
643
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000644$(VIM): $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) version.c version.h
Bram Moolenaar071d4272004-06-13 20:20:40 +0000645 $(CC) $(CFLAGS) version.c /Fo$(OUTDIR)/version.obj $(PDB)
646 $(link) $(LINKARGS1) -out:$*.exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000647 $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000648 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
649 $(OUTDIR)\version.obj $(LINKARGS2)
650
651$(VIM).exe: $(VIM)
652
653$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000654 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000655
656install.exe: dosinst.c
657 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib ole32.lib advapi32.lib uuid.lib
658 - if exist install.exe del install.exe
659 ren dosinst.exe install.exe
660
661uninstal.exe: uninstal.c
662 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
663
664vimrun.exe: vimrun.c
665 $(CC) /nologo -DNDEBUG vimrun.c
666
667xxd/xxd.exe: xxd/xxd.c
668 cd xxd
669 $(MAKE) /NOLOGO -f Make_mvc.mak
670 cd ..
671
672GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
673 cd GvimExt
674 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
675 cd ..
676
677
678tags: notags
679 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
680
681notags:
682 - if exist tags del tags
683
684clean:
685 - $(DEL_TREE) $(OUTDIR) auto
686 - if exist *.obj del *.obj
687 - if exist $(VIM).exe del $(VIM).exe
688 - if exist $(VIM).ilk del $(VIM).ilk
689 - if exist $(VIM).pdb del $(VIM).pdb
690 - if exist $(VIM).map del $(VIM).map
691 - if exist $(VIM).ncb del $(VIM).ncb
692 - if exist vimrun.exe del vimrun.exe
693 - if exist install.exe del install.exe
694 - if exist uninstal.exe del uninstal.exe
695 - if exist if_perl.c del if_perl.c
696 - if exist dimm.h del dimm.h
697 - if exist dimm_i.c del dimm_i.c
698 - if exist dimm.tlb del dimm.tlb
699 - if exist dosinst.exe del dosinst.exe
700 cd xxd
701 $(MAKE) /NOLOGO -f Make_mvc.mak clean
702 cd ..
703 cd GvimExt
704 $(MAKE) /NOLOGO -f Makefile clean
705 cd ..
706 cd GvimExt
707 $(MAKE) /NOLOGO -f Makefile clean
708 cd ..
709 - if exist testdir\*.out del testdir\*.out
710
711test:
712 cd testdir
713 $(MAKE) /NOLOGO -f Make_dos.mak win32
714 cd ..
715
Bram Moolenaar34114692005-01-02 11:28:13 +0000716testclean:
717 cd testdir
718 $(MAKE) /NOLOGO -f Make_dos.mak clean
719 cd ..
720
Bram Moolenaar071d4272004-06-13 20:20:40 +0000721###########################################################################
722
723# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
724# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
725!IF "$(_NMAKE_VER)" == ""
726.c{$(OUTDIR)/}.obj:
727!ELSE
728.c{$(OUTDIR)/}.obj::
729!ENDIF
730 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
731
732# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
733# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
734!IF "$(_NMAKE_VER)" == ""
735.cpp{$(OUTDIR)/}.obj:
736!ELSE
737.cpp{$(OUTDIR)/}.obj::
738!ENDIF
739 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
740
741$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
742
743$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
744
745$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
746
747$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
748
749$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
750
751$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
752
753$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
754
755$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
756
757$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
758
759$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
760
761$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
762
763$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
764
765$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
766
767$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
768
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000769$(OUTDIR)/hashtable.obj: $(OUTDIR) hashtable.c $(INCL)
770
Bram Moolenaar071d4272004-06-13 20:20:40 +0000771$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
772
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000773$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
774
Bram Moolenaar071d4272004-06-13 20:20:40 +0000775$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
776
777$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
778
779if_perl.c : if_perl.xs typemap
780 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) -typemap typemap if_perl.xs > if_perl.c
781
782$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
783 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c /Fo$(OUTDIR)/if_perl.obj $(PDB)
784
785$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
786 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c /Fo$(OUTDIR)/if_perlsfio.obj $(PDB)
787
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000788$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL)
789 $(CC) $(CFLAGS) $(PERL_INC) if_mzsch.c /Fo$(OUTDIR)/if_mzsch.obj $(PDB) -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
790
Bram Moolenaar071d4272004-06-13 20:20:40 +0000791$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
792 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c /Fo$(OUTDIR)/if_python.obj $(PDB)
793
794$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
795
796$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
797 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c /Fo$(OUTDIR)/if_ruby.obj $(PDB)
798
799$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
800 $(CC) $(CFLAGS) if_sniff.c /Fo$(OUTDIR)/if_sniff.obj $(PDB)
801
802$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
803 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c /Fo$(OUTDIR)/if_tcl.obj $(PDB)
804
805$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
806
807$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
808
809$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
810
811$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
812
813$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
814
815$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
816
817$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
818
819$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
820
821$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
822
823$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
824
825$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
826
827$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
828
829$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
830
831$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
832
833$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
834
835$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
836
837$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
838
839$(OUTDIR)/pathdef.obj: $(OUTDIR) auto/pathdef.c $(INCL)
840 $(CC) $(CFLAGS) auto/pathdef.c /Fo$(OUTDIR)/pathdef.obj $(PDB)
841
842$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
843
844$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
845
846$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
847
848$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
849
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000850$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
851
Bram Moolenaar071d4272004-06-13 20:20:40 +0000852$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
853
854$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
855
856$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
857
858$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
859
860$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
861
862$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
863
864$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
865 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c /Fo$(OUTDIR)/xpm_w32.obj $(PDB)
866
867$(OUTDIR)/vim.res: $(OUTDIR) vim.rc version.h tools.bmp tearoff.bmp vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
868 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
869
870iid_ole.c if_ole.h vim.tlb: if_ole.idl $(INTDIR) $(OUTDIR)
871 midl /nologo /proxy nul /iid iid_ole.c /tlb vim.tlb /header if_ole.h if_ole.idl
872
873dimm.h dimm_i.c: dimm.idl
874 midl /nologo /proxy nul dimm.idl
875
876$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
877
878$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
879
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000880# $CFLAGS may contain backslashes and double quotes, escape them both.
881E0_CFLAGS = $(CFLAGS:\=\\)
882E_CFLAGS = $(E0_CFLAGS:"=\")
883
Bram Moolenaar071d4272004-06-13 20:20:40 +0000884auto/pathdef.c: auto
885 @echo creating auto/pathdef.c
886 @echo /* pathdef.c */ > auto\pathdef.c
887 @echo #include "vim.h" >> auto\pathdef.c
888 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> auto\pathdef.c
889 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> auto\pathdef.c
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000890 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> auto\pathdef.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000891 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> auto\pathdef.c
892 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> auto\pathdef.c
893 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> auto\pathdef.c
894
895auto:
896 if not exist auto/nul mkdir auto
897
898# End Custom Build
899proto.h: \
900 proto/buffer.pro \
901 proto/charset.pro \
902 proto/diff.pro \
903 proto/digraph.pro \
904 proto/edit.pro \
905 proto/eval.pro \
906 proto/ex_cmds.pro \
907 proto/ex_cmds2.pro \
908 proto/ex_docmd.pro \
909 proto/ex_eval.pro \
910 proto/ex_getln.pro \
911 proto/fileio.pro \
912 proto/getchar.pro \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000913 proto/hashtable.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000914 proto/main.pro \
915 proto/mark.pro \
916 proto/memfile.pro \
917 proto/memline.pro \
918 proto/menu.pro \
919 proto/message.pro \
920 proto/misc1.pro \
921 proto/misc2.pro \
922 proto/move.pro \
923 proto/mbyte.pro \
924 proto/normal.pro \
925 proto/ops.pro \
926 proto/option.pro \
927 proto/os_mswin.pro \
928 proto/os_win32.pro \
929 proto/quickfix.pro \
930 proto/regexp.pro \
931 proto/screen.pro \
932 proto/search.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000933 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000934 proto/syntax.pro \
935 proto/tag.pro \
936 proto/term.pro \
937 proto/ui.pro \
938 proto/undo.pro \
939 proto/window.pro \
940 $(NETBEANS_PRO)
941
942# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: