blob: eb5aa7e9e71203af3916af4fc3b161fe5bfb9647 [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
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000113# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
114# interfaces.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000115# If you change something else, do "make clean" first!
116!if "$(GUI)" == "yes"
117OBJDIR = .\ObjG
118!else
119OBJDIR = .\ObjC
120!endif
121!if "$(OLE)" == "yes"
122OBJDIR = $(OBJDIR)O
123!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000124!ifdef PERL
125OBJDIR = $(OBJDIR)L
126!endif
127!ifdef PYTHON
128OBJDIR = $(OBJDIR)Y
129!endif
130!ifdef TCL
131OBJDIR = $(OBJDIR)T
132!endif
133!ifdef RUBY
134OBJDIR = $(OBJDIR)R
135!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000136!ifdef MZSCHEME
137OBJDIR = $(OBJDIR)Z
138!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000139!if "$(DEBUG)" == "yes"
140OBJDIR = $(OBJDIR)d
141!endif
142
143# ntwin32.mak requires that CPU be set appropriately
144
145!ifdef PROCESSOR_ARCHITECTURE
146# We're on Windows NT or using VC 6
147CPU = $(PROCESSOR_ARCHITECTURE)
148! if "$(CPU)" == "x86"
149CPU = i386
150! endif
151!else # !PROCESSOR_ARCHITECTURE
152# We're on Windows 95
153CPU = i386
154!endif # !PROCESSOR_ARCHITECTURE
155
156
157# Build a retail version by default
158
159!if "$(DEBUG)" != "yes"
160NODEBUG = 1
161!else
162MAKEFLAGS_GVIMEXT = DEBUG=yes
163!endif
164
165
166# Build a multithreaded version for the Windows 95 dead keys hack
167# Commented out because it doesn't work.
168# MULTITHREADED = 1
169
170
171# Get all sorts of useful, standard macros from the SDK. (Note that
172# MSVC 2.2 does not install <ntwin32.mak> in the \msvc20\include
173# directory, but you can find it in \msvc20\include on the CD-ROM.
174# You may also need <win32.mak> from the same place.)
175
176!include <ntwin32.mak>
177
178
179#>>>>> path of the compiler and linker; name of include and lib directories
180# PATH = c:\msvc20\bin;$(PATH)
181# INCLUDE = c:\msvc20\include
182# LIB = c:\msvc20\lib
183
184!ifndef CTAGS
185CTAGS = ctags
186!endif
187
188!if "$(SNIFF)" == "yes"
189# SNIFF - Include support for SNiFF+.
190SNIFF_INCL = if_sniff.h
191SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
192SNIFF_LIB = shell32.lib
193SNIFF_DEFS = -DFEAT_SNIFF
194# The SNiFF integration needs multithreaded libraries!
195MULTITHREADED = yes
196!endif
197
198!ifndef CSCOPE
199CSCOPE = yes
200!endif
201
202!if "$(CSCOPE)" == "yes"
203# CSCOPE - Include support for Cscope
204CSCOPE_INCL = if_cscope.h
205CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
206CSCOPE_DEFS = -DFEAT_CSCOPE
207!endif
208
209!ifndef NETBEANS
210NETBEANS = $(GUI)
211!endif
212
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000213# Only allow NETBEANS and XPM for a GUI build.
214!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000215!if "$(NETBEANS)" == "yes"
216# NETBEANS - Include support for Netbeans integration
217NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000218NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000219NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000220
221!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000222NBDEBUG_DEFS = -DNBDEBUG
223NBDEBUG_INCL = nbdebug.h
224NBDEBUG_SRC = nbdebug.c
225!endif
226NETBEANS_LIB = WSock32.lib
227!endif
228
229!ifdef XPM
230# XPM - Include support for XPM signs
231# you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
232XPM_OBJ = $(OBJDIR)/xpm_w32.obj
233XPM_DEFS = -DFEAT_XPM_W32
234XPM_LIB = $(XPM)\lib\libXpm.lib
235XPM_INC = -I $(XPM)\include
236!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000237!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000238
239!if defined(USE_MSVCRT)
240CVARS = $(cvarsdll)
241!elseif defined(MULTITHREADED)
242CVARS = $(cvarsmt)
243!else
244CVARS = $(cvars)
245!endif
246
247# need advapi32.lib for GetUserName()
248# need shell32.lib for ExtractIcon()
249# gdi32.lib and comdlg32.lib for printing support
250# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
251CON_LIB = advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib
252!if "$(VC6)" == "yes"
253CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
254!endif
255
256### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
257# When set to 0x0500 ":browse" stops working.
258!ifndef WINVER
259WINVER = 0x0400
260!endif
261
262# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
263# default, use these lines.
264#VIMRCLOC = somewhere
265#VIMRUNTIMEDIR = somewhere
266
267CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
268 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
269 $(NBDEBUG_DEFS) $(XPM_DEFS) \
270 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
271
272#>>>>> end of choices
273###########################################################################
274
275!ifdef OS
276OS_TYPE = winnt
277DEL_TREE = rmdir /s /q
278!else
279OS_TYPE = win95
280DEL_TREE = deltree /y
281!endif
282
283INTDIR=$(OBJDIR)
284OUTDIR=$(OBJDIR)
285
286# Convert processor ID to MVC-compatible number
287!if "$(CPUNR)" == "i386"
288CPUARG = /G3
289!elseif "$(CPUNR)" == "i486"
290CPUARG = /G4
291!elseif "$(CPUNR)" == "i586"
292CPUARG = /G5
293!elseif "$(CPUNR)" == "i686"
294CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000295!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000296CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000297!else
298CPUARG =
299!endif
300
301!ifdef NODEBUG
302VIM = vim
303!if "$(OPTIMIZE)" == "SPACE"
304OPTFLAG = /O1
305!elseif "$(OPTIMIZE)" == "SPEED"
306OPTFLAG = /O2
307!else # MAXSPEED
308OPTFLAG = /Ox
309!endif
Bram Moolenaar34114692005-01-02 11:28:13 +0000310CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000311RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000312! ifdef USE_MSVCRT
313CFLAGS = $(CFLAGS) -MD
314LIBC = msvcrt.lib
315! elseif defined(MULTITHREADED)
316LIBC = libcmt.lib
317! else
318LIBC = libc.lib
319! endif
320!else # DEBUG
321VIM = vimd
Bram Moolenaard9d30582005-05-18 22:10:28 +0000322CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000323RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
324# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
325! if "$(_NMAKE_VER)" == ""
326LIBC =
327! else
328LIBC = /fixed:no
329! endif
330
331! ifndef USE_MSVCRT
332LIBC = $(LIBC) libcd.lib
333! else
334CFLAGS = $(CFLAGS) -MDd
335LIBC = $(LIBC) msvcrtd.lib
336! endif
337!endif # DEBUG
338
339INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
340 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
341 $(NBDEBUG_INCL)
342
343OBJ = \
344 $(OUTDIR)\buffer.obj \
345 $(OUTDIR)\charset.obj \
346 $(OUTDIR)\diff.obj \
347 $(OUTDIR)\digraph.obj \
348 $(OUTDIR)\edit.obj \
349 $(OUTDIR)\eval.obj \
350 $(OUTDIR)\ex_cmds.obj \
351 $(OUTDIR)\ex_cmds2.obj \
352 $(OUTDIR)\ex_docmd.obj \
353 $(OUTDIR)\ex_eval.obj \
354 $(OUTDIR)\ex_getln.obj \
355 $(OUTDIR)\fileio.obj \
356 $(OUTDIR)\fold.obj \
357 $(OUTDIR)\getchar.obj \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000358 $(OUTDIR)\hashtable.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000359 $(OUTDIR)\main.obj \
360 $(OUTDIR)\mark.obj \
361 $(OUTDIR)\mbyte.obj \
362 $(OUTDIR)\memfile.obj \
363 $(OUTDIR)\memline.obj \
364 $(OUTDIR)\menu.obj \
365 $(OUTDIR)\message.obj \
366 $(OUTDIR)\misc1.obj \
367 $(OUTDIR)\misc2.obj \
368 $(OUTDIR)\move.obj \
369 $(OUTDIR)\normal.obj \
370 $(OUTDIR)\ops.obj \
371 $(OUTDIR)\option.obj \
372 $(OUTDIR)\os_mswin.obj \
373 $(OUTDIR)\os_win32.obj \
374 $(OUTDIR)\pathdef.obj \
375 $(OUTDIR)\quickfix.obj \
376 $(OUTDIR)\regexp.obj \
377 $(OUTDIR)\screen.obj \
378 $(OUTDIR)\search.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000379 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000380 $(OUTDIR)\syntax.obj \
381 $(OUTDIR)\tag.obj \
382 $(OUTDIR)\term.obj \
383 $(OUTDIR)\ui.obj \
384 $(OUTDIR)\undo.obj \
385 $(OUTDIR)\window.obj \
386 $(OUTDIR)\vim.res
387
388!if "$(OLE)" == "yes"
389CFLAGS = $(CFLAGS) -DFEAT_OLE
390RCFLAGS = $(RCFLAGS) -DFEAT_OLE
391OLE_OBJ = $(OUTDIR)\if_ole.obj
392OLE_IDL = if_ole.idl
393OLE_LIB = oleaut32.lib
394!endif
395
396!if "$(IME)" == "yes"
397CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
398!ifndef DYNAMIC_IME
399DYNAMIC_IME = yes
400!endif
401!if "$(DYNAMIC_IME)" == "yes"
402CFLAGS = $(CFLAGS) -DDYNAMIC_IME
403!else
404IME_LIB = imm32.lib
405!endif
406!endif
407
408!if "$(GIME)" == "yes"
409CFLAGS = $(CFLAGS) -DGLOBAL_IME
410OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
411MBYTE = yes
412!endif
413
414!if "$(MBYTE)" == "yes"
415CFLAGS = $(CFLAGS) -DFEAT_MBYTE
416!endif
417
418!if "$(GUI)" == "yes"
419SUBSYSTEM = windows
420CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
421RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
422VIM = g$(VIM)
423GUI_INCL = \
424 gui.h \
425 regexp.h \
426 ascii.h \
427 ex_cmds.h \
428 farsi.h \
429 feature.h \
430 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000431 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000432 keymap.h \
433 macros.h \
434 option.h \
435 os_dos.h \
436 os_win32.h
437GUI_OBJ = \
438 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000439 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000440 $(OUTDIR)\gui_w32.obj \
441 $(OUTDIR)\os_w32exe.obj
442GUI_LIB = \
443 oldnames.lib kernel32.lib gdi32.lib $(IME_LIB) \
444 winspool.lib comctl32.lib advapi32.lib shell32.lib \
445 /machine:$(CPU) /nodefaultlib
446!else
447SUBSYSTEM = console
448!endif
449
450# iconv.dll library (dynamically loaded)
451!ifndef ICONV
452ICONV = yes
453!endif
454!if "$(ICONV)" == "yes"
455CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
456!endif
457
458# libintl.dll library
459!ifndef GETTEXT
460GETTEXT = yes
461!endif
462!if "$(GETTEXT)" == "yes"
463CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
464!endif
465
466# TCL interface
467!ifdef TCL
468!ifndef TCL_VER
469TCL_VER = 83
470TCL_VER_LONG = 8.3
471!endif
472!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
473!if "$(DYNAMIC_TCL)" == "yes"
474!message Tcl DLL will be loaded dynamically
475TCL_DLL = tcl$(TCL_VER).dll
476CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
477TCL_OBJ = $(OUTDIR)\if_tcl.obj
478TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
479TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
480!else
481CFLAGS = $(CFLAGS) -DFEAT_TCL
482TCL_OBJ = $(OUTDIR)\if_tcl.obj
483TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
484TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
485!endif
486!endif
487
488# PYTHON interface
489!ifdef PYTHON
490!ifndef PYTHON_VER
491PYTHON_VER = 22
492!endif
493!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
494!if "$(DYNAMIC_PYTHON)" == "yes"
495!message Python DLL will be loaded dynamically
496!endif
497CFLAGS = $(CFLAGS) -DFEAT_PYTHON
498PYTHON_OBJ = $(OUTDIR)\if_python.obj
499PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
500!if "$(DYNAMIC_PYTHON)" == "yes"
501CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
502PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
503!else
504PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
505!endif
506!endif
507
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000508# MzScheme interface
509!ifdef MZSCHEME
510!message MzScheme requested - root dir is "$(MZSCHEME)"
511!ifndef MZSCHEME_VER
512MZSCHEME_VER = 205_000
513!endif
514CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000515!if "$(DYNAMIC_MZSCHEME)" == "yes"
516!message MzScheme DLLs will be loaded dynamically
517CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
518!else
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000519MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
520!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000521MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
522!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000523
Bram Moolenaar071d4272004-06-13 20:20:40 +0000524# Perl interface
525!ifdef PERL
526!ifndef PERL_VER
527PERL_VER = 56
528!endif
529!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
530!if "$(DYNAMIC_PERL)" == "yes"
531!if $(PERL_VER) >= 56
532!message Perl DLL will be loaded dynamically
533!else
534!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
535!message Reverting to static loading...
536!undef DYNAMIC_PERL
537!endif
538!endif
539
540# Is Perl installed in architecture-specific directories?
541!if exist($(PERL)\Bin\MSWin32-x86)
542PERL_ARCH = \MSWin32-x86
543!endif
544
545PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
546
547# Version-dependent stuff
548!if $(PERL_VER) == 55
549PERL_LIB = $(PERL_INCDIR)\perl.lib
550!else
551PERL_DLL = perl$(PERL_VER).dll
552PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
553!endif
554
555CFLAGS = $(CFLAGS) -DFEAT_PERL
556
557# Do we want to load Perl dynamically?
558!if "$(DYNAMIC_PERL)" == "yes"
559CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
560!undef PERL_LIB
561!endif
562
563PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
564PERL_INC = /I $(PERL_INCDIR)
565PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
566XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
567XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
568
569!endif
570
571#
572# Support Ruby interface
573#
574!ifdef RUBY
575# Set default value
576!ifndef RUBY_VER
577RUBY_VER = 18
578!endif
579!ifndef RUBY_VER_LONG
580RUBY_VER_LONG = 1.8
581!endif
582
583!if $(RUBY_VER) >= 18
584!ifndef RUBY_PLATFORM
585RUBY_PLATFORM = i386-mswin32
586!endif
587!ifndef RUBY_INSTALL_NAME
588RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
589!endif
590!else
591!ifndef RUBY_PLATFORM
592RUBY_PLATFORM = i586-mswin32
593!endif
594!ifndef RUBY_INSTALL_NAME
595RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
596!endif
597!endif # $(RUBY_VER) >= 18
598
599!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
600CFLAGS = $(CFLAGS) -DFEAT_RUBY
601RUBY_OBJ = $(OUTDIR)\if_ruby.obj
602RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
603RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
604# Do we want to load Ruby dynamically?
605!if "$(DYNAMIC_RUBY)" == "yes"
606!message Ruby DLL will be loaded dynamically
607CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" -DDYNAMIC_RUBY_VER=$(RUBY_VER)
608!undef RUBY_LIB
609!endif
610!endif # RUBY
611
612#
613# Support PostScript printing
614#
615!if "$(POSTSCRIPT)" == "yes"
616CFLAGS = $(CFLAGS) -DMSWINPS
617!endif # POSTSCRIPT
618
619#
620# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
621#
622!if "$(FEATURES)"==""
623FEATURES = BIG
624!endif
625CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
626
627#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000628# Always generate the .pdb file, so that we get debug symbols that can be used
629# on a crash (doesn't add overhead to the executable).
630#
631CFLAGS = $(CFLAGS) /Zi
632PDB = /Fd$(OUTDIR)/
633LINK_PDB = /PDB:$(OUTDIR)/$(VIM).pdb -debug:full -debugtype:cv,fixup
634
635#
636# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000637#
638!message
639
640conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
641
642!IF "$(MAP)" == "yes"
643# "/map" is for debugging
644conflags = $(conflags) /map
645!ELSEIF "$(MAP)" == "lines"
646# "/mapinfo:lines" is for debugging, only works for VC6 and later
647conflags = $(conflags) /map /mapinfo:lines
648!ENDIF
649
650LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
651LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000652 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) $(TCL_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000653 $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
654
655all: $(VIM) vimrun.exe install.exe uninstal.exe xxd/xxd.exe GvimExt/gvimext.dll
656
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000657$(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 +0000658 $(CC) $(CFLAGS) version.c /Fo$(OUTDIR)/version.obj $(PDB)
659 $(link) $(LINKARGS1) -out:$*.exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000660 $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000661 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
662 $(OUTDIR)\version.obj $(LINKARGS2)
663
664$(VIM).exe: $(VIM)
665
666$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000667 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000668
669install.exe: dosinst.c
670 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib ole32.lib advapi32.lib uuid.lib
671 - if exist install.exe del install.exe
672 ren dosinst.exe install.exe
673
674uninstal.exe: uninstal.c
675 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
676
677vimrun.exe: vimrun.c
678 $(CC) /nologo -DNDEBUG vimrun.c
679
680xxd/xxd.exe: xxd/xxd.c
681 cd xxd
682 $(MAKE) /NOLOGO -f Make_mvc.mak
683 cd ..
684
685GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
686 cd GvimExt
687 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
688 cd ..
689
690
691tags: notags
692 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
693
694notags:
695 - if exist tags del tags
696
697clean:
698 - $(DEL_TREE) $(OUTDIR) auto
699 - if exist *.obj del *.obj
700 - if exist $(VIM).exe del $(VIM).exe
701 - if exist $(VIM).ilk del $(VIM).ilk
702 - if exist $(VIM).pdb del $(VIM).pdb
703 - if exist $(VIM).map del $(VIM).map
704 - if exist $(VIM).ncb del $(VIM).ncb
705 - if exist vimrun.exe del vimrun.exe
706 - if exist install.exe del install.exe
707 - if exist uninstal.exe del uninstal.exe
708 - if exist if_perl.c del if_perl.c
709 - if exist dimm.h del dimm.h
710 - if exist dimm_i.c del dimm_i.c
711 - if exist dimm.tlb del dimm.tlb
712 - if exist dosinst.exe del dosinst.exe
713 cd xxd
714 $(MAKE) /NOLOGO -f Make_mvc.mak clean
715 cd ..
716 cd GvimExt
717 $(MAKE) /NOLOGO -f Makefile clean
718 cd ..
719 cd GvimExt
720 $(MAKE) /NOLOGO -f Makefile clean
721 cd ..
722 - if exist testdir\*.out del testdir\*.out
723
724test:
725 cd testdir
726 $(MAKE) /NOLOGO -f Make_dos.mak win32
727 cd ..
728
Bram Moolenaar34114692005-01-02 11:28:13 +0000729testclean:
730 cd testdir
731 $(MAKE) /NOLOGO -f Make_dos.mak clean
732 cd ..
733
Bram Moolenaar071d4272004-06-13 20:20:40 +0000734###########################################################################
735
736# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
737# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
738!IF "$(_NMAKE_VER)" == ""
739.c{$(OUTDIR)/}.obj:
740!ELSE
741.c{$(OUTDIR)/}.obj::
742!ENDIF
743 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
744
745# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
746# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
747!IF "$(_NMAKE_VER)" == ""
748.cpp{$(OUTDIR)/}.obj:
749!ELSE
750.cpp{$(OUTDIR)/}.obj::
751!ENDIF
752 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
753
754$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
755
756$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
757
758$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
759
760$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
761
762$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
763
764$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
765
766$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
767
768$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
769
770$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
771
772$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
773
774$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
775
776$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
777
778$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
779
780$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
781
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000782$(OUTDIR)/hashtable.obj: $(OUTDIR) hashtable.c $(INCL)
783
Bram Moolenaar071d4272004-06-13 20:20:40 +0000784$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
785
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000786$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
787
Bram Moolenaar071d4272004-06-13 20:20:40 +0000788$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
789
790$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
791
792if_perl.c : if_perl.xs typemap
793 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) -typemap typemap if_perl.xs > if_perl.c
794
795$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
796 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c /Fo$(OUTDIR)/if_perl.obj $(PDB)
797
798$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
799 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c /Fo$(OUTDIR)/if_perlsfio.obj $(PDB)
800
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000801$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL)
802 $(CC) $(CFLAGS) $(PERL_INC) if_mzsch.c /Fo$(OUTDIR)/if_mzsch.obj $(PDB) -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
803
Bram Moolenaar071d4272004-06-13 20:20:40 +0000804$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
805 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c /Fo$(OUTDIR)/if_python.obj $(PDB)
806
807$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
808
809$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
810 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c /Fo$(OUTDIR)/if_ruby.obj $(PDB)
811
812$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
813 $(CC) $(CFLAGS) if_sniff.c /Fo$(OUTDIR)/if_sniff.obj $(PDB)
814
815$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
816 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c /Fo$(OUTDIR)/if_tcl.obj $(PDB)
817
818$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
819
820$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
821
822$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
823
824$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
825
826$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
827
828$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
829
830$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
831
832$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
833
834$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
835
836$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
837
838$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
839
840$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
841
842$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
843
844$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
845
846$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
847
848$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
849
850$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
851
852$(OUTDIR)/pathdef.obj: $(OUTDIR) auto/pathdef.c $(INCL)
853 $(CC) $(CFLAGS) auto/pathdef.c /Fo$(OUTDIR)/pathdef.obj $(PDB)
854
855$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
856
857$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
858
859$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
860
861$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
862
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000863$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
864
Bram Moolenaar071d4272004-06-13 20:20:40 +0000865$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
866
867$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
868
869$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
870
871$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
872
873$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
874
875$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
876
877$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
878 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c /Fo$(OUTDIR)/xpm_w32.obj $(PDB)
879
880$(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
881 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
882
883iid_ole.c if_ole.h vim.tlb: if_ole.idl $(INTDIR) $(OUTDIR)
884 midl /nologo /proxy nul /iid iid_ole.c /tlb vim.tlb /header if_ole.h if_ole.idl
885
886dimm.h dimm_i.c: dimm.idl
887 midl /nologo /proxy nul dimm.idl
888
889$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
890
891$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
892
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000893# $CFLAGS may contain backslashes and double quotes, escape them both.
894E0_CFLAGS = $(CFLAGS:\=\\)
895E_CFLAGS = $(E0_CFLAGS:"=\")
896
Bram Moolenaar071d4272004-06-13 20:20:40 +0000897auto/pathdef.c: auto
898 @echo creating auto/pathdef.c
899 @echo /* pathdef.c */ > auto\pathdef.c
900 @echo #include "vim.h" >> auto\pathdef.c
901 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> auto\pathdef.c
902 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> auto\pathdef.c
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000903 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> auto\pathdef.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000904 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> auto\pathdef.c
905 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> auto\pathdef.c
906 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> auto\pathdef.c
907
908auto:
909 if not exist auto/nul mkdir auto
910
911# End Custom Build
912proto.h: \
913 proto/buffer.pro \
914 proto/charset.pro \
915 proto/diff.pro \
916 proto/digraph.pro \
917 proto/edit.pro \
918 proto/eval.pro \
919 proto/ex_cmds.pro \
920 proto/ex_cmds2.pro \
921 proto/ex_docmd.pro \
922 proto/ex_eval.pro \
923 proto/ex_getln.pro \
924 proto/fileio.pro \
925 proto/getchar.pro \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000926 proto/hashtable.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000927 proto/main.pro \
928 proto/mark.pro \
929 proto/memfile.pro \
930 proto/memline.pro \
931 proto/menu.pro \
932 proto/message.pro \
933 proto/misc1.pro \
934 proto/misc2.pro \
935 proto/move.pro \
936 proto/mbyte.pro \
937 proto/normal.pro \
938 proto/ops.pro \
939 proto/option.pro \
940 proto/os_mswin.pro \
941 proto/os_win32.pro \
942 proto/quickfix.pro \
943 proto/regexp.pro \
944 proto/screen.pro \
945 proto/search.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000946 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000947 proto/syntax.pro \
948 proto/tag.pro \
949 proto/term.pro \
950 proto/ui.pro \
951 proto/undo.pro \
952 proto/window.pro \
953 $(NETBEANS_PRO)
954
955# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: