blob: 972baf95e9ce3cbf7bd607b9cd245ec490dfe487 [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 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 \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000425 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000426 keymap.h \
427 macros.h \
428 option.h \
429 os_dos.h \
430 os_win32.h
431GUI_OBJ = \
432 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000433 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000434 $(OUTDIR)\gui_w32.obj \
435 $(OUTDIR)\os_w32exe.obj
436GUI_LIB = \
437 oldnames.lib kernel32.lib gdi32.lib $(IME_LIB) \
438 winspool.lib comctl32.lib advapi32.lib shell32.lib \
439 /machine:$(CPU) /nodefaultlib
440!else
441SUBSYSTEM = console
442!endif
443
444# iconv.dll library (dynamically loaded)
445!ifndef ICONV
446ICONV = yes
447!endif
448!if "$(ICONV)" == "yes"
449CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
450!endif
451
452# libintl.dll library
453!ifndef GETTEXT
454GETTEXT = yes
455!endif
456!if "$(GETTEXT)" == "yes"
457CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
458!endif
459
460# TCL interface
461!ifdef TCL
462!ifndef TCL_VER
463TCL_VER = 83
464TCL_VER_LONG = 8.3
465!endif
466!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
467!if "$(DYNAMIC_TCL)" == "yes"
468!message Tcl DLL will be loaded dynamically
469TCL_DLL = tcl$(TCL_VER).dll
470CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
471TCL_OBJ = $(OUTDIR)\if_tcl.obj
472TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
473TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
474!else
475CFLAGS = $(CFLAGS) -DFEAT_TCL
476TCL_OBJ = $(OUTDIR)\if_tcl.obj
477TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
478TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
479!endif
480!endif
481
482# PYTHON interface
483!ifdef PYTHON
484!ifndef PYTHON_VER
485PYTHON_VER = 22
486!endif
487!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
488!if "$(DYNAMIC_PYTHON)" == "yes"
489!message Python DLL will be loaded dynamically
490!endif
491CFLAGS = $(CFLAGS) -DFEAT_PYTHON
492PYTHON_OBJ = $(OUTDIR)\if_python.obj
493PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
494!if "$(DYNAMIC_PYTHON)" == "yes"
495CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
496PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
497!else
498PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
499!endif
500!endif
501
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000502# MzScheme interface
503!ifdef MZSCHEME
504!message MzScheme requested - root dir is "$(MZSCHEME)"
505!ifndef MZSCHEME_VER
506MZSCHEME_VER = 205_000
507!endif
508CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000509!if "$(DYNAMIC_MZSCHEME)" == "yes"
510!message MzScheme DLLs will be loaded dynamically
511CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
512!else
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000513MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
514!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000515MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
516!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000517
Bram Moolenaar071d4272004-06-13 20:20:40 +0000518# Perl interface
519!ifdef PERL
520!ifndef PERL_VER
521PERL_VER = 56
522!endif
523!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
524!if "$(DYNAMIC_PERL)" == "yes"
525!if $(PERL_VER) >= 56
526!message Perl DLL will be loaded dynamically
527!else
528!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
529!message Reverting to static loading...
530!undef DYNAMIC_PERL
531!endif
532!endif
533
534# Is Perl installed in architecture-specific directories?
535!if exist($(PERL)\Bin\MSWin32-x86)
536PERL_ARCH = \MSWin32-x86
537!endif
538
539PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
540
541# Version-dependent stuff
542!if $(PERL_VER) == 55
543PERL_LIB = $(PERL_INCDIR)\perl.lib
544!else
545PERL_DLL = perl$(PERL_VER).dll
546PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
547!endif
548
549CFLAGS = $(CFLAGS) -DFEAT_PERL
550
551# Do we want to load Perl dynamically?
552!if "$(DYNAMIC_PERL)" == "yes"
553CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
554!undef PERL_LIB
555!endif
556
557PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
558PERL_INC = /I $(PERL_INCDIR)
559PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
560XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
561XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
562
563!endif
564
565#
566# Support Ruby interface
567#
568!ifdef RUBY
569# Set default value
570!ifndef RUBY_VER
571RUBY_VER = 18
572!endif
573!ifndef RUBY_VER_LONG
574RUBY_VER_LONG = 1.8
575!endif
576
577!if $(RUBY_VER) >= 18
578!ifndef RUBY_PLATFORM
579RUBY_PLATFORM = i386-mswin32
580!endif
581!ifndef RUBY_INSTALL_NAME
582RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
583!endif
584!else
585!ifndef RUBY_PLATFORM
586RUBY_PLATFORM = i586-mswin32
587!endif
588!ifndef RUBY_INSTALL_NAME
589RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
590!endif
591!endif # $(RUBY_VER) >= 18
592
593!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
594CFLAGS = $(CFLAGS) -DFEAT_RUBY
595RUBY_OBJ = $(OUTDIR)\if_ruby.obj
596RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
597RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
598# Do we want to load Ruby dynamically?
599!if "$(DYNAMIC_RUBY)" == "yes"
600!message Ruby DLL will be loaded dynamically
601CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" -DDYNAMIC_RUBY_VER=$(RUBY_VER)
602!undef RUBY_LIB
603!endif
604!endif # RUBY
605
606#
607# Support PostScript printing
608#
609!if "$(POSTSCRIPT)" == "yes"
610CFLAGS = $(CFLAGS) -DMSWINPS
611!endif # POSTSCRIPT
612
613#
614# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
615#
616!if "$(FEATURES)"==""
617FEATURES = BIG
618!endif
619CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
620
621#
622# End extra featuare include
623#
624!message
625
626conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
627
628!IF "$(MAP)" == "yes"
629# "/map" is for debugging
630conflags = $(conflags) /map
631!ELSEIF "$(MAP)" == "lines"
632# "/mapinfo:lines" is for debugging, only works for VC6 and later
633conflags = $(conflags) /map /mapinfo:lines
634!ENDIF
635
636LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
637LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000638 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) $(TCL_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000639 $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
640
641all: $(VIM) vimrun.exe install.exe uninstal.exe xxd/xxd.exe GvimExt/gvimext.dll
642
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000643$(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 +0000644 $(CC) $(CFLAGS) version.c /Fo$(OUTDIR)/version.obj $(PDB)
645 $(link) $(LINKARGS1) -out:$*.exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000646 $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000647 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
648 $(OUTDIR)\version.obj $(LINKARGS2)
649
650$(VIM).exe: $(VIM)
651
652$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000653 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000654
655install.exe: dosinst.c
656 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib ole32.lib advapi32.lib uuid.lib
657 - if exist install.exe del install.exe
658 ren dosinst.exe install.exe
659
660uninstal.exe: uninstal.c
661 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
662
663vimrun.exe: vimrun.c
664 $(CC) /nologo -DNDEBUG vimrun.c
665
666xxd/xxd.exe: xxd/xxd.c
667 cd xxd
668 $(MAKE) /NOLOGO -f Make_mvc.mak
669 cd ..
670
671GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
672 cd GvimExt
673 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
674 cd ..
675
676
677tags: notags
678 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
679
680notags:
681 - if exist tags del tags
682
683clean:
684 - $(DEL_TREE) $(OUTDIR) auto
685 - if exist *.obj del *.obj
686 - if exist $(VIM).exe del $(VIM).exe
687 - if exist $(VIM).ilk del $(VIM).ilk
688 - if exist $(VIM).pdb del $(VIM).pdb
689 - if exist $(VIM).map del $(VIM).map
690 - if exist $(VIM).ncb del $(VIM).ncb
691 - if exist vimrun.exe del vimrun.exe
692 - if exist install.exe del install.exe
693 - if exist uninstal.exe del uninstal.exe
694 - if exist if_perl.c del if_perl.c
695 - if exist dimm.h del dimm.h
696 - if exist dimm_i.c del dimm_i.c
697 - if exist dimm.tlb del dimm.tlb
698 - if exist dosinst.exe del dosinst.exe
699 cd xxd
700 $(MAKE) /NOLOGO -f Make_mvc.mak clean
701 cd ..
702 cd GvimExt
703 $(MAKE) /NOLOGO -f Makefile clean
704 cd ..
705 cd GvimExt
706 $(MAKE) /NOLOGO -f Makefile clean
707 cd ..
708 - if exist testdir\*.out del testdir\*.out
709
710test:
711 cd testdir
712 $(MAKE) /NOLOGO -f Make_dos.mak win32
713 cd ..
714
Bram Moolenaar34114692005-01-02 11:28:13 +0000715testclean:
716 cd testdir
717 $(MAKE) /NOLOGO -f Make_dos.mak clean
718 cd ..
719
Bram Moolenaar071d4272004-06-13 20:20:40 +0000720###########################################################################
721
722# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
723# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
724!IF "$(_NMAKE_VER)" == ""
725.c{$(OUTDIR)/}.obj:
726!ELSE
727.c{$(OUTDIR)/}.obj::
728!ENDIF
729 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
730
731# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
732# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
733!IF "$(_NMAKE_VER)" == ""
734.cpp{$(OUTDIR)/}.obj:
735!ELSE
736.cpp{$(OUTDIR)/}.obj::
737!ENDIF
738 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
739
740$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
741
742$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
743
744$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
745
746$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
747
748$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
749
750$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
751
752$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
753
754$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
755
756$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
757
758$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
759
760$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
761
762$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
763
764$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
765
766$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
767
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000768$(OUTDIR)/hashtable.obj: $(OUTDIR) hashtable.c $(INCL)
769
Bram Moolenaar071d4272004-06-13 20:20:40 +0000770$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
771
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000772$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
773
Bram Moolenaar071d4272004-06-13 20:20:40 +0000774$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
775
776$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
777
778if_perl.c : if_perl.xs typemap
779 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) -typemap typemap if_perl.xs > if_perl.c
780
781$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
782 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c /Fo$(OUTDIR)/if_perl.obj $(PDB)
783
784$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
785 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c /Fo$(OUTDIR)/if_perlsfio.obj $(PDB)
786
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000787$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL)
788 $(CC) $(CFLAGS) $(PERL_INC) if_mzsch.c /Fo$(OUTDIR)/if_mzsch.obj $(PDB) -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
789
Bram Moolenaar071d4272004-06-13 20:20:40 +0000790$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
791 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c /Fo$(OUTDIR)/if_python.obj $(PDB)
792
793$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
794
795$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
796 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c /Fo$(OUTDIR)/if_ruby.obj $(PDB)
797
798$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
799 $(CC) $(CFLAGS) if_sniff.c /Fo$(OUTDIR)/if_sniff.obj $(PDB)
800
801$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
802 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c /Fo$(OUTDIR)/if_tcl.obj $(PDB)
803
804$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
805
806$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
807
808$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
809
810$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
811
812$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
813
814$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
815
816$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
817
818$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
819
820$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
821
822$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
823
824$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
825
826$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
827
828$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
829
830$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
831
832$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
833
834$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
835
836$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
837
838$(OUTDIR)/pathdef.obj: $(OUTDIR) auto/pathdef.c $(INCL)
839 $(CC) $(CFLAGS) auto/pathdef.c /Fo$(OUTDIR)/pathdef.obj $(PDB)
840
841$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
842
843$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
844
845$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
846
847$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
848
849$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
850
851$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
852
853$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
854
855$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
856
857$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
858
859$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
860
861$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
862 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c /Fo$(OUTDIR)/xpm_w32.obj $(PDB)
863
864$(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
865 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
866
867iid_ole.c if_ole.h vim.tlb: if_ole.idl $(INTDIR) $(OUTDIR)
868 midl /nologo /proxy nul /iid iid_ole.c /tlb vim.tlb /header if_ole.h if_ole.idl
869
870dimm.h dimm_i.c: dimm.idl
871 midl /nologo /proxy nul dimm.idl
872
873$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
874
875$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
876
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000877# $CFLAGS may contain backslashes and double quotes, escape them both.
878E0_CFLAGS = $(CFLAGS:\=\\)
879E_CFLAGS = $(E0_CFLAGS:"=\")
880
Bram Moolenaar071d4272004-06-13 20:20:40 +0000881auto/pathdef.c: auto
882 @echo creating auto/pathdef.c
883 @echo /* pathdef.c */ > auto\pathdef.c
884 @echo #include "vim.h" >> auto\pathdef.c
885 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> auto\pathdef.c
886 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> auto\pathdef.c
Bram Moolenaar89cb5e02004-07-19 20:55:54 +0000887 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> auto\pathdef.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000888 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> auto\pathdef.c
889 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> auto\pathdef.c
890 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> auto\pathdef.c
891
892auto:
893 if not exist auto/nul mkdir auto
894
895# End Custom Build
896proto.h: \
897 proto/buffer.pro \
898 proto/charset.pro \
899 proto/diff.pro \
900 proto/digraph.pro \
901 proto/edit.pro \
902 proto/eval.pro \
903 proto/ex_cmds.pro \
904 proto/ex_cmds2.pro \
905 proto/ex_docmd.pro \
906 proto/ex_eval.pro \
907 proto/ex_getln.pro \
908 proto/fileio.pro \
909 proto/getchar.pro \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000910 proto/hashtable.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000911 proto/main.pro \
912 proto/mark.pro \
913 proto/memfile.pro \
914 proto/memline.pro \
915 proto/menu.pro \
916 proto/message.pro \
917 proto/misc1.pro \
918 proto/misc2.pro \
919 proto/move.pro \
920 proto/mbyte.pro \
921 proto/normal.pro \
922 proto/ops.pro \
923 proto/option.pro \
924 proto/os_mswin.pro \
925 proto/os_win32.pro \
926 proto/quickfix.pro \
927 proto/regexp.pro \
928 proto/screen.pro \
929 proto/search.pro \
930 proto/syntax.pro \
931 proto/tag.pro \
932 proto/term.pro \
933 proto/ui.pro \
934 proto/undo.pro \
935 proto/window.pro \
936 $(NETBEANS_PRO)
937
938# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: