blob: 57012a48bf3676efd017cca8af7130c76a017676 [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
205NETBEANS_OBJ = $(OBJDIR)/netbeans.obj $(OBJDIR)/gui_beval.obj
206NETBEANS_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 Moolenaar34114692005-01-02 11:28:13 +0000299PDB =
300LINK_PDB =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000301! ifdef USE_MSVCRT
302CFLAGS = $(CFLAGS) -MD
303LIBC = msvcrt.lib
304! elseif defined(MULTITHREADED)
305LIBC = libcmt.lib
306! else
307LIBC = libc.lib
308! endif
309!else # DEBUG
310VIM = vimd
311# MSVC 4.1
312PDB = /Fd$(OUTDIR)/
313LINK_PDB = /PDB:$(OUTDIR)/
314# MSVC 2.2
315# PDB = /Fd$(OUTDIR)/vim.pdb
316# LINK_PDB = /PDB:$(OUTDIR)/vim.pdb
317CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Zi /Od
318RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
319# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
320! if "$(_NMAKE_VER)" == ""
321LIBC =
322! else
323LIBC = /fixed:no
324! endif
325
326! ifndef USE_MSVCRT
327LIBC = $(LIBC) libcd.lib
328! else
329CFLAGS = $(CFLAGS) -MDd
330LIBC = $(LIBC) msvcrtd.lib
331! endif
332!endif # DEBUG
333
334INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
335 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
336 $(NBDEBUG_INCL)
337
338OBJ = \
339 $(OUTDIR)\buffer.obj \
340 $(OUTDIR)\charset.obj \
341 $(OUTDIR)\diff.obj \
342 $(OUTDIR)\digraph.obj \
343 $(OUTDIR)\edit.obj \
344 $(OUTDIR)\eval.obj \
345 $(OUTDIR)\ex_cmds.obj \
346 $(OUTDIR)\ex_cmds2.obj \
347 $(OUTDIR)\ex_docmd.obj \
348 $(OUTDIR)\ex_eval.obj \
349 $(OUTDIR)\ex_getln.obj \
350 $(OUTDIR)\fileio.obj \
351 $(OUTDIR)\fold.obj \
352 $(OUTDIR)\getchar.obj \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000353 $(OUTDIR)\hashtable.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000354 $(OUTDIR)\main.obj \
355 $(OUTDIR)\mark.obj \
356 $(OUTDIR)\mbyte.obj \
357 $(OUTDIR)\memfile.obj \
358 $(OUTDIR)\memline.obj \
359 $(OUTDIR)\menu.obj \
360 $(OUTDIR)\message.obj \
361 $(OUTDIR)\misc1.obj \
362 $(OUTDIR)\misc2.obj \
363 $(OUTDIR)\move.obj \
364 $(OUTDIR)\normal.obj \
365 $(OUTDIR)\ops.obj \
366 $(OUTDIR)\option.obj \
367 $(OUTDIR)\os_mswin.obj \
368 $(OUTDIR)\os_win32.obj \
369 $(OUTDIR)\pathdef.obj \
370 $(OUTDIR)\quickfix.obj \
371 $(OUTDIR)\regexp.obj \
372 $(OUTDIR)\screen.obj \
373 $(OUTDIR)\search.obj \
374 $(OUTDIR)\syntax.obj \
375 $(OUTDIR)\tag.obj \
376 $(OUTDIR)\term.obj \
377 $(OUTDIR)\ui.obj \
378 $(OUTDIR)\undo.obj \
379 $(OUTDIR)\window.obj \
380 $(OUTDIR)\vim.res
381
382!if "$(OLE)" == "yes"
383CFLAGS = $(CFLAGS) -DFEAT_OLE
384RCFLAGS = $(RCFLAGS) -DFEAT_OLE
385OLE_OBJ = $(OUTDIR)\if_ole.obj
386OLE_IDL = if_ole.idl
387OLE_LIB = oleaut32.lib
388!endif
389
390!if "$(IME)" == "yes"
391CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
392!ifndef DYNAMIC_IME
393DYNAMIC_IME = yes
394!endif
395!if "$(DYNAMIC_IME)" == "yes"
396CFLAGS = $(CFLAGS) -DDYNAMIC_IME
397!else
398IME_LIB = imm32.lib
399!endif
400!endif
401
402!if "$(GIME)" == "yes"
403CFLAGS = $(CFLAGS) -DGLOBAL_IME
404OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
405MBYTE = yes
406!endif
407
408!if "$(MBYTE)" == "yes"
409CFLAGS = $(CFLAGS) -DFEAT_MBYTE
410!endif
411
412!if "$(GUI)" == "yes"
413SUBSYSTEM = windows
414CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
415RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
416VIM = g$(VIM)
417GUI_INCL = \
418 gui.h \
419 regexp.h \
420 ascii.h \
421 ex_cmds.h \
422 farsi.h \
423 feature.h \
424 globals.h \
425 keymap.h \
426 macros.h \
427 option.h \
428 os_dos.h \
429 os_win32.h
430GUI_OBJ = \
431 $(OUTDIR)\gui.obj \
432 $(OUTDIR)\gui_w32.obj \
433 $(OUTDIR)\os_w32exe.obj
434GUI_LIB = \
435 oldnames.lib kernel32.lib gdi32.lib $(IME_LIB) \
436 winspool.lib comctl32.lib advapi32.lib shell32.lib \
437 /machine:$(CPU) /nodefaultlib
438!else
439SUBSYSTEM = console
440!endif
441
442# iconv.dll library (dynamically loaded)
443!ifndef ICONV
444ICONV = yes
445!endif
446!if "$(ICONV)" == "yes"
447CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
448!endif
449
450# libintl.dll library
451!ifndef GETTEXT
452GETTEXT = yes
453!endif
454!if "$(GETTEXT)" == "yes"
455CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
456!endif
457
458# TCL interface
459!ifdef TCL
460!ifndef TCL_VER
461TCL_VER = 83
462TCL_VER_LONG = 8.3
463!endif
464!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
465!if "$(DYNAMIC_TCL)" == "yes"
466!message Tcl DLL will be loaded dynamically
467TCL_DLL = tcl$(TCL_VER).dll
468CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
469TCL_OBJ = $(OUTDIR)\if_tcl.obj
470TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
471TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
472!else
473CFLAGS = $(CFLAGS) -DFEAT_TCL
474TCL_OBJ = $(OUTDIR)\if_tcl.obj
475TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
476TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
477!endif
478!endif
479
480# PYTHON interface
481!ifdef PYTHON
482!ifndef PYTHON_VER
483PYTHON_VER = 22
484!endif
485!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
486!if "$(DYNAMIC_PYTHON)" == "yes"
487!message Python DLL will be loaded dynamically
488!endif
489CFLAGS = $(CFLAGS) -DFEAT_PYTHON
490PYTHON_OBJ = $(OUTDIR)\if_python.obj
491PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
492!if "$(DYNAMIC_PYTHON)" == "yes"
493CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
494PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
495!else
496PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
497!endif
498!endif
499
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000500# MzScheme interface
501!ifdef MZSCHEME
502!message MzScheme requested - root dir is "$(MZSCHEME)"
503!ifndef MZSCHEME_VER
504MZSCHEME_VER = 205_000
505!endif
506CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000507!if "$(DYNAMIC_MZSCHEME)" == "yes"
508!message MzScheme DLLs will be loaded dynamically
509CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
510!else
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000511MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
512!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000513MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
514!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000515
Bram Moolenaar071d4272004-06-13 20:20:40 +0000516# Perl interface
517!ifdef PERL
518!ifndef PERL_VER
519PERL_VER = 56
520!endif
521!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
522!if "$(DYNAMIC_PERL)" == "yes"
523!if $(PERL_VER) >= 56
524!message Perl DLL will be loaded dynamically
525!else
526!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
527!message Reverting to static loading...
528!undef DYNAMIC_PERL
529!endif
530!endif
531
532# Is Perl installed in architecture-specific directories?
533!if exist($(PERL)\Bin\MSWin32-x86)
534PERL_ARCH = \MSWin32-x86
535!endif
536
537PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
538
539# Version-dependent stuff
540!if $(PERL_VER) == 55
541PERL_LIB = $(PERL_INCDIR)\perl.lib
542!else
543PERL_DLL = perl$(PERL_VER).dll
544PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
545!endif
546
547CFLAGS = $(CFLAGS) -DFEAT_PERL
548
549# Do we want to load Perl dynamically?
550!if "$(DYNAMIC_PERL)" == "yes"
551CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
552!undef PERL_LIB
553!endif
554
555PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
556PERL_INC = /I $(PERL_INCDIR)
557PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
558XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
559XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
560
561!endif
562
563#
564# Support Ruby interface
565#
566!ifdef RUBY
567# Set default value
568!ifndef RUBY_VER
569RUBY_VER = 18
570!endif
571!ifndef RUBY_VER_LONG
572RUBY_VER_LONG = 1.8
573!endif
574
575!if $(RUBY_VER) >= 18
576!ifndef RUBY_PLATFORM
577RUBY_PLATFORM = i386-mswin32
578!endif
579!ifndef RUBY_INSTALL_NAME
580RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
581!endif
582!else
583!ifndef RUBY_PLATFORM
584RUBY_PLATFORM = i586-mswin32
585!endif
586!ifndef RUBY_INSTALL_NAME
587RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
588!endif
589!endif # $(RUBY_VER) >= 18
590
591!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
592CFLAGS = $(CFLAGS) -DFEAT_RUBY
593RUBY_OBJ = $(OUTDIR)\if_ruby.obj
594RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
595RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
596# Do we want to load Ruby dynamically?
597!if "$(DYNAMIC_RUBY)" == "yes"
598!message Ruby DLL will be loaded dynamically
599CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" -DDYNAMIC_RUBY_VER=$(RUBY_VER)
600!undef RUBY_LIB
601!endif
602!endif # RUBY
603
604#
605# Support PostScript printing
606#
607!if "$(POSTSCRIPT)" == "yes"
608CFLAGS = $(CFLAGS) -DMSWINPS
609!endif # POSTSCRIPT
610
611#
612# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
613#
614!if "$(FEATURES)"==""
615FEATURES = BIG
616!endif
617CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
618
619#
620# End extra featuare include
621#
622!message
623
624conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
625
626!IF "$(MAP)" == "yes"
627# "/map" is for debugging
628conflags = $(conflags) /map
629!ELSEIF "$(MAP)" == "lines"
630# "/mapinfo:lines" is for debugging, only works for VC6 and later
631conflags = $(conflags) /map /mapinfo:lines
632!ENDIF
633
634LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
635LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000636 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) $(TCL_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000637 $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
638
639all: $(VIM) vimrun.exe install.exe uninstal.exe xxd/xxd.exe GvimExt/gvimext.dll
640
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000641$(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 +0000642 $(CC) $(CFLAGS) version.c /Fo$(OUTDIR)/version.obj $(PDB)
643 $(link) $(LINKARGS1) -out:$*.exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000644 $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000645 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
646 $(OUTDIR)\version.obj $(LINKARGS2)
647
648$(VIM).exe: $(VIM)
649
650$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000651 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000652
653install.exe: dosinst.c
654 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib ole32.lib advapi32.lib uuid.lib
655 - if exist install.exe del install.exe
656 ren dosinst.exe install.exe
657
658uninstal.exe: uninstal.c
659 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
660
661vimrun.exe: vimrun.c
662 $(CC) /nologo -DNDEBUG vimrun.c
663
664xxd/xxd.exe: xxd/xxd.c
665 cd xxd
666 $(MAKE) /NOLOGO -f Make_mvc.mak
667 cd ..
668
669GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
670 cd GvimExt
671 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
672 cd ..
673
674
675tags: notags
676 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
677
678notags:
679 - if exist tags del tags
680
681clean:
682 - $(DEL_TREE) $(OUTDIR) auto
683 - if exist *.obj del *.obj
684 - if exist $(VIM).exe del $(VIM).exe
685 - if exist $(VIM).ilk del $(VIM).ilk
686 - if exist $(VIM).pdb del $(VIM).pdb
687 - if exist $(VIM).map del $(VIM).map
688 - if exist $(VIM).ncb del $(VIM).ncb
689 - if exist vimrun.exe del vimrun.exe
690 - if exist install.exe del install.exe
691 - if exist uninstal.exe del uninstal.exe
692 - if exist if_perl.c del if_perl.c
693 - if exist dimm.h del dimm.h
694 - if exist dimm_i.c del dimm_i.c
695 - if exist dimm.tlb del dimm.tlb
696 - if exist dosinst.exe del dosinst.exe
697 cd xxd
698 $(MAKE) /NOLOGO -f Make_mvc.mak clean
699 cd ..
700 cd GvimExt
701 $(MAKE) /NOLOGO -f Makefile clean
702 cd ..
703 cd GvimExt
704 $(MAKE) /NOLOGO -f Makefile clean
705 cd ..
706 - if exist testdir\*.out del testdir\*.out
707
708test:
709 cd testdir
710 $(MAKE) /NOLOGO -f Make_dos.mak win32
711 cd ..
712
Bram Moolenaar34114692005-01-02 11:28:13 +0000713testclean:
714 cd testdir
715 $(MAKE) /NOLOGO -f Make_dos.mak clean
716 cd ..
717
Bram Moolenaar071d4272004-06-13 20:20:40 +0000718###########################################################################
719
720# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
721# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
722!IF "$(_NMAKE_VER)" == ""
723.c{$(OUTDIR)/}.obj:
724!ELSE
725.c{$(OUTDIR)/}.obj::
726!ENDIF
727 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
728
729# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
730# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
731!IF "$(_NMAKE_VER)" == ""
732.cpp{$(OUTDIR)/}.obj:
733!ELSE
734.cpp{$(OUTDIR)/}.obj::
735!ENDIF
736 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
737
738$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
739
740$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
741
742$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
743
744$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
745
746$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
747
748$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
749
750$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
751
752$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
753
754$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
755
756$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
757
758$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
759
760$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
761
762$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
763
764$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
765
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000766$(OUTDIR)/hashtable.obj: $(OUTDIR) hashtable.c $(INCL)
767
Bram Moolenaar071d4272004-06-13 20:20:40 +0000768$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
769
770$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
771
772$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
773
774if_perl.c : if_perl.xs typemap
775 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) -typemap typemap if_perl.xs > if_perl.c
776
777$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
778 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c /Fo$(OUTDIR)/if_perl.obj $(PDB)
779
780$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
781 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c /Fo$(OUTDIR)/if_perlsfio.obj $(PDB)
782
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000783$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL)
784 $(CC) $(CFLAGS) $(PERL_INC) if_mzsch.c /Fo$(OUTDIR)/if_mzsch.obj $(PDB) -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
785
Bram Moolenaar071d4272004-06-13 20:20:40 +0000786$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
787 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c /Fo$(OUTDIR)/if_python.obj $(PDB)
788
789$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
790
791$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
792 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c /Fo$(OUTDIR)/if_ruby.obj $(PDB)
793
794$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
795 $(CC) $(CFLAGS) if_sniff.c /Fo$(OUTDIR)/if_sniff.obj $(PDB)
796
797$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
798 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c /Fo$(OUTDIR)/if_tcl.obj $(PDB)
799
800$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
801
802$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
803
804$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
805
806$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
807
808$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
809
810$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
811
812$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
813
814$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
815
816$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
817
818$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
819
820$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
821
822$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
823
824$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
825
826$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
827
828$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
829
830$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
831
832$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
833
834$(OUTDIR)/pathdef.obj: $(OUTDIR) auto/pathdef.c $(INCL)
835 $(CC) $(CFLAGS) auto/pathdef.c /Fo$(OUTDIR)/pathdef.obj $(PDB)
836
837$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
838
839$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
840
841$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
842
843$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
844
845$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
846
847$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
848
849$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
850
851$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
852
853$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
854
855$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
856
857$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
858 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c /Fo$(OUTDIR)/xpm_w32.obj $(PDB)
859
860$(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
861 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
862
863iid_ole.c if_ole.h vim.tlb: if_ole.idl $(INTDIR) $(OUTDIR)
864 midl /nologo /proxy nul /iid iid_ole.c /tlb vim.tlb /header if_ole.h if_ole.idl
865
866dimm.h dimm_i.c: dimm.idl
867 midl /nologo /proxy nul dimm.idl
868
869$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
870
871$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
872
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000873# $CFLAGS may contain backslashes and double quotes, escape them both.
874E0_CFLAGS = $(CFLAGS:\=\\)
875E_CFLAGS = $(E0_CFLAGS:"=\")
876
Bram Moolenaar071d4272004-06-13 20:20:40 +0000877auto/pathdef.c: auto
878 @echo creating auto/pathdef.c
879 @echo /* pathdef.c */ > auto\pathdef.c
880 @echo #include "vim.h" >> auto\pathdef.c
881 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> auto\pathdef.c
882 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> auto\pathdef.c
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000883 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> auto\pathdef.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000884 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> auto\pathdef.c
885 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> auto\pathdef.c
886 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> auto\pathdef.c
887
888auto:
889 if not exist auto/nul mkdir auto
890
891# End Custom Build
892proto.h: \
893 proto/buffer.pro \
894 proto/charset.pro \
895 proto/diff.pro \
896 proto/digraph.pro \
897 proto/edit.pro \
898 proto/eval.pro \
899 proto/ex_cmds.pro \
900 proto/ex_cmds2.pro \
901 proto/ex_docmd.pro \
902 proto/ex_eval.pro \
903 proto/ex_getln.pro \
904 proto/fileio.pro \
905 proto/getchar.pro \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000906 proto/hashtable.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000907 proto/main.pro \
908 proto/mark.pro \
909 proto/memfile.pro \
910 proto/memline.pro \
911 proto/menu.pro \
912 proto/message.pro \
913 proto/misc1.pro \
914 proto/misc2.pro \
915 proto/move.pro \
916 proto/mbyte.pro \
917 proto/normal.pro \
918 proto/ops.pro \
919 proto/option.pro \
920 proto/os_mswin.pro \
921 proto/os_win32.pro \
922 proto/quickfix.pro \
923 proto/regexp.pro \
924 proto/screen.pro \
925 proto/search.pro \
926 proto/syntax.pro \
927 proto/tag.pro \
928 proto/term.pro \
929 proto/ui.pro \
930 proto/undo.pro \
931 proto/window.pro \
932 $(NETBEANS_PRO)
933
934# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: