blob: 14c46ed52d4471529805be0c8f76c50db1028dbb [file] [log] [blame]
Bram Moolenaareb3593b2006-04-22 22:33:57 +00001# Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me)
2# and Win64, using the Microsoft Visual C++ compilers. Known to work with
Bram Moolenaar0fde2902008-03-16 13:54:13 +00003# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005),
Bram Moolenaarda2f99a2009-06-16 14:34:38 +00004# VC9 (VS2008), and VC10 (VS2010).
Bram Moolenaar071d4272004-06-13 20:20:40 +00005#
Bram Moolenaareb3593b2006-04-22 22:33:57 +00006# To build using other Windows compilers, see INSTALLpc.txt
Bram Moolenaar7887d882005-07-01 22:33:52 +00007#
Bram Moolenaar071d4272004-06-13 20:20:40 +00008# This makefile can build the console, GUI, OLE-enable, Perl-enabled and
Bram Moolenaarda2f99a2009-06-16 14:34:38 +00009# Python-enabled versions of Vim for Win32 platforms.
Bram Moolenaar071d4272004-06-13 20:20:40 +000010#
Bram Moolenaarda2f99a2009-06-16 14:34:38 +000011# The basic command line to build Vim is:
Bram Moolenaar7887d882005-07-01 22:33:52 +000012#
Bram Moolenaar071d4272004-06-13 20:20:40 +000013# nmake -f Make_mvc.mak
Bram Moolenaar7887d882005-07-01 22:33:52 +000014#
Bram Moolenaarda2f99a2009-06-16 14:34:38 +000015# This will build the console version of Vim with no additional interfaces.
Bram Moolenaar7887d882005-07-01 22:33:52 +000016# To add features, define any of the following:
17#
18# !!!! After changing features do "nmake clean" first !!!!
19#
20# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is BIG)
21#
Bram Moolenaar071d4272004-06-13 20:20:40 +000022# GUI interface: GUI=yes (default is no)
Bram Moolenaar7887d882005-07-01 22:33:52 +000023#
Bram Moolenaar071d4272004-06-13 20:20:40 +000024# OLE interface: OLE=yes (usually with GUI=yes)
Bram Moolenaar7887d882005-07-01 22:33:52 +000025#
Bram Moolenaara83c3e02006-03-17 23:10:44 +000026# Multibyte support: MBYTE=yes (default is no)
Bram Moolenaar7887d882005-07-01 22:33:52 +000027#
Bram Moolenaar071d4272004-06-13 20:20:40 +000028# IME support: IME=yes (requires GUI=yes)
29# DYNAMIC_IME=[yes or no] (to load the imm32.dll dynamically, default
30# is yes)
31# Global IME support: GIME=yes (requires GUI=yes)
Bram Moolenaar7887d882005-07-01 22:33:52 +000032#
Bram Moolenaar65c1b012005-01-31 19:02:28 +000033# MzScheme interface:
34# MZSCHEME=[Path to MzScheme directory]
35# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically)
36# MZSCHEME_VER=[version, 205_000, ...]
Bram Moolenaar9e70cf12009-05-26 20:59:55 +000037# MZSCHEME_DEBUG=no
Bram Moolenaar7887d882005-07-01 22:33:52 +000038#
Bram Moolenaar071d4272004-06-13 20:20:40 +000039# Perl interface:
40# PERL=[Path to Perl directory]
41# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
Bram Moolenaar7887d882005-07-01 22:33:52 +000042# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc]
43# (default is 56)
44#
Bram Moolenaar071d4272004-06-13 20:20:40 +000045# Python interface:
46# PYTHON=[Path to Python directory]
47# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
48# PYTHON_VER=[Python version, eg 15, 20] (default is 22)
Bram Moolenaar7887d882005-07-01 22:33:52 +000049#
Bram Moolenaar071d4272004-06-13 20:20:40 +000050# Ruby interface:
51# RUBY=[Path to Ruby directory]
52# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
53# RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
54# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
55# You must set RUBY_VER_LONG when change RUBY_VER.
Bram Moolenaar7887d882005-07-01 22:33:52 +000056#
Bram Moolenaar071d4272004-06-13 20:20:40 +000057# Tcl interface:
58# TCL=[Path to Tcl directory]
59# DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
60# TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
61# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
62# You must set TCL_VER_LONG when you set TCL_VER.
Bram Moolenaar7887d882005-07-01 22:33:52 +000063#
64# SNiFF+ interface: SNIFF=yes
65#
66# Cscope support: CSCOPE=yes
67#
68# Iconv library support (always dynamically loaded):
69# ICONV=[yes or no] (default is yes)
70#
71# Intl library support (always dynamically loaded):
72# GETTEXT=[yes or no] (default is yes)
73# See http://sourceforge.net/projects/gettext/
74#
75# PostScript printing: POSTSCRIPT=yes (default is no)
76#
77# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
78#
79# XPM Image Support: XPM=[path to XPM directory]
80#
81# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
82#
83# Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
84# i386)
85#
86# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
87#
Bram Moolenaar071d4272004-06-13 20:20:40 +000088# Debug version: DEBUG=yes
89# Mapfile: MAP=[no, yes or lines] (default is yes)
90# no: Don't write a mapfile.
91# yes: Write a normal mapfile.
92# lines: Write a mapfile with line numbers (only for VC6 and later)
Bram Moolenaar7887d882005-07-01 22:33:52 +000093#
94# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
95# doesn't work)
Bram Moolenaar071d4272004-06-13 20:20:40 +000096#
Bram Moolenaarf22129b2007-10-03 11:29:44 +000097# Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
98#
Bram Moolenaar071d4272004-06-13 20:20:40 +000099# You can combine any of these interfaces
100#
101# Example: To build the non-debug, GUI version with Perl interface:
102# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
103#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104# DEBUG with Make_mvc.mak and Make_dvc.mak:
105# This makefile gives a fineness of control which is not supported in
106# Visual C++ configuration files. Therefore, debugging requires a bit of
107# extra work.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000108# Make_dvc.mak is a Visual C++ project to access that support. It may be
109# badly out of date for the Visual C++ you are using...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000110# To use Make_dvc.mak:
111# 1) Build Vim with Make_mvc.mak.
112# Use a "DEBUG=yes" argument to build Vim with debug support.
113# E.g. the following builds gvimd.exe:
114# nmake -f Make_mvc.mak debug=yes gui=yes
115# 2) Use MS Devstudio and set it up to allow that file to be debugged:
116# i) Pass Make_dvc.mak to the IDE.
117# Use the "open workspace" menu entry to load Make_dvc.mak.
118# Alternatively, from the command line:
119# msdev /nologo Make_dvc.mak
120# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
121# this and offer to convert it to their own format. Accept that.
122# It creates a file called Make_dvc.dsw which can then be used
123# for further operations. E.g.
124# msdev /nologo Make_dvc.dsw
125# ii) Set the built executable for debugging:
126# a) Alt+F7/Debug takes you to the Debug dialog.
127# b) Fill "Executable for debug session". e.g. gvimd.exe
128# c) Fill "Program arguments". e.g. -R dosinst.c
129# d) Complete the dialog
130# 3) You can now debug the executable you built with Make_mvc.mak
131#
132# Note: Make_dvc.mak builds vimrun.exe, because it must build something
133# to be a valid makefile..
134
135### See feature.h for a list of optionals.
136# If you want to build some optional features without modifying the source,
137# you can set DEFINES on the command line, e.g.,
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000138# nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000139
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000140# Build on both Windows NT/XP and Windows 9x
Bram Moolenaar071d4272004-06-13 20:20:40 +0000141
142TARGETOS = BOTH
143
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000144# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
145# interfaces.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000146# If you change something else, do "make clean" first!
147!if "$(GUI)" == "yes"
148OBJDIR = .\ObjG
149!else
150OBJDIR = .\ObjC
151!endif
152!if "$(OLE)" == "yes"
153OBJDIR = $(OBJDIR)O
154!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000155!ifdef PERL
156OBJDIR = $(OBJDIR)L
157!endif
158!ifdef PYTHON
159OBJDIR = $(OBJDIR)Y
160!endif
161!ifdef TCL
162OBJDIR = $(OBJDIR)T
163!endif
164!ifdef RUBY
165OBJDIR = $(OBJDIR)R
166!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000167!ifdef MZSCHEME
168OBJDIR = $(OBJDIR)Z
169!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000170!if "$(DEBUG)" == "yes"
171OBJDIR = $(OBJDIR)d
172!endif
173
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000174# Win32.mak requires that CPU be set appropriately.
175# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000176
177!ifdef PROCESSOR_ARCHITECTURE
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000178# We're on Windows NT or using VC 6+
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000179! ifdef CPU
180ASSEMBLY_ARCHITECTURE=$(CPU)
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000181# Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7.
182! if ("$(ASSEMBLY_ARCHITECTURE)" == "i386") || ("$(ASSEMBLY_ARCHITECTURE)" == "I386")
183ASSEMBLY_ARCHITECTURE = x86
184! endif
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000185! else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000186CPU = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000187ASSEMBLY_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000188! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000189CPU = i386
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000190! endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000191! endif
192!else # !PROCESSOR_ARCHITECTURE
193# We're on Windows 95
194CPU = i386
195!endif # !PROCESSOR_ARCHITECTURE
196
Bram Moolenaar071d4272004-06-13 20:20:40 +0000197# Build a retail version by default
198
199!if "$(DEBUG)" != "yes"
200NODEBUG = 1
201!else
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000202!undef NODEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000203MAKEFLAGS_GVIMEXT = DEBUG=yes
204!endif
205
206
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000207# Get all sorts of useful, standard macros from the Platform SDK.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000208
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000209!include <Win32.mak>
Bram Moolenaar071d4272004-06-13 20:20:40 +0000210
Bram Moolenaar8cd213c2010-06-01 21:57:09 +0200211# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200212WP64CHECK = /Wp64
Bram Moolenaar071d4272004-06-13 20:20:40 +0000213
214#>>>>> path of the compiler and linker; name of include and lib directories
215# PATH = c:\msvc20\bin;$(PATH)
216# INCLUDE = c:\msvc20\include
217# LIB = c:\msvc20\lib
218
219!ifndef CTAGS
220CTAGS = ctags
221!endif
222
223!if "$(SNIFF)" == "yes"
224# SNIFF - Include support for SNiFF+.
225SNIFF_INCL = if_sniff.h
226SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
Bram Moolenaarb6356332005-07-18 21:40:44 +0000227SNIFF_LIB = shell32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000228SNIFF_DEFS = -DFEAT_SNIFF
229# The SNiFF integration needs multithreaded libraries!
230MULTITHREADED = yes
231!endif
232
233!ifndef CSCOPE
234CSCOPE = yes
235!endif
236
237!if "$(CSCOPE)" == "yes"
238# CSCOPE - Include support for Cscope
239CSCOPE_INCL = if_cscope.h
240CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
241CSCOPE_DEFS = -DFEAT_CSCOPE
242!endif
243
244!ifndef NETBEANS
245NETBEANS = $(GUI)
246!endif
247
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000248# Only allow NETBEANS and XPM for a GUI build.
249!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000250!if "$(NETBEANS)" == "yes"
251# NETBEANS - Include support for Netbeans integration
252NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000253NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000254NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000255
256!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000257NBDEBUG_DEFS = -DNBDEBUG
258NBDEBUG_INCL = nbdebug.h
259NBDEBUG_SRC = nbdebug.c
260!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000261NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000262!endif
263
264!ifdef XPM
265# XPM - Include support for XPM signs
266# you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
267XPM_OBJ = $(OBJDIR)/xpm_w32.obj
268XPM_DEFS = -DFEAT_XPM_W32
269XPM_LIB = $(XPM)\lib\libXpm.lib
270XPM_INC = -I $(XPM)\include
271!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000272!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000273
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000274# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000275!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000276# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000277# !elseif defined(MULTITHREADED)
278# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000279!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000280# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000281# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000282!endif
283
284# need advapi32.lib for GetUserName()
285# need shell32.lib for ExtractIcon()
286# gdi32.lib and comdlg32.lib for printing support
287# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000288CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
289 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000290!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000291CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
292!endif
293
294### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
295# When set to 0x0500 ":browse" stops working.
296!ifndef WINVER
297WINVER = 0x0400
298!endif
299
300# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
301# default, use these lines.
302#VIMRCLOC = somewhere
303#VIMRUNTIMEDIR = somewhere
304
305CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
306 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
307 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000308 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
309 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000310
311#>>>>> end of choices
312###########################################################################
313
314!ifdef OS
315OS_TYPE = winnt
316DEL_TREE = rmdir /s /q
317!else
318OS_TYPE = win95
319DEL_TREE = deltree /y
320!endif
321
322INTDIR=$(OBJDIR)
323OUTDIR=$(OBJDIR)
324
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000325# Derive version of VC being used from nmake if not specified
326!if "$(MSVCVER)" == ""
327!if "$(_NMAKE_VER)" == ""
328MSVCVER = 4.0
329!endif
330!if "$(_NMAKE_VER)" == "162"
331MSVCVER = 5.0
332!endif
333!if "$(_NMAKE_VER)" == "6.00.8168.0"
334MSVCVER = 6.0
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000335CPU = ix86
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000336!endif
337!if "$(_NMAKE_VER)" == "7.00.9466"
338MSVCVER = 7.0
339!endif
340!if "$(_NMAKE_VER)" == "7.10.3077"
341MSVCVER = 7.1
342!endif
343!if "$(_NMAKE_VER)" == "8.00.50727.42"
344MSVCVER = 8.0
345!endif
346!if "$(_NMAKE_VER)" == "8.00.50727.762"
347MSVCVER = 8.0
348!endif
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000349!if "$(_NMAKE_VER)" == "9.00.20706.01"
350MSVCVER = 9.0
351!endif
Bram Moolenaara7241f52008-06-24 20:39:31 +0000352!if "$(_NMAKE_VER)" == "9.00.21022.08"
353MSVCVER = 9.0
354!endif
Bram Moolenaar13658312009-02-04 17:35:52 +0000355!if "$(_NMAKE_VER)" == "9.00.30729.01"
356MSVCVER = 9.0
357!endif
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000358!if "$(_NMAKE_VER)" == "10.00.20506.01"
359MSVCVER = 10.0
360!endif
Bram Moolenaar2498b3a2010-03-02 17:59:44 +0100361!if "$(_NMAKE_VER)" == "10.00.30128.01"
362MSVCVER = 10.0
363!endif
Bram Moolenaar218116c2010-05-20 21:46:00 +0200364!if "$(_NMAKE_VER)" == "10.00.30319.01"
365MSVCVER = 10.0
366!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000367!endif
368
369# Abort bulding VIM if version of VC is unrecognised.
370!ifndef MSVCVER
371!message *** ERROR
372!message Cannot determine Visual C version being used. If you are using the
373!message Windows SDK then you must have the environment variable MSVCVER set to
374!message your version of the VC compiler. If you are not using the Express
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000375!message version of Visual C, you can either set MSVCVER or update this makefile
376!message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)".
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000377!error Make aborted.
378!endif
379
Bram Moolenaar071d4272004-06-13 20:20:40 +0000380# Convert processor ID to MVC-compatible number
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000381!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000382!if "$(CPUNR)" == "i386"
383CPUARG = /G3
384!elseif "$(CPUNR)" == "i486"
385CPUARG = /G4
386!elseif "$(CPUNR)" == "i586"
387CPUARG = /G5
388!elseif "$(CPUNR)" == "i686"
389CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000390!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000391CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000392!else
393CPUARG =
394!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000395!else
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000396# VC8/9 only allows specifying SSE architecture
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000397!if "$(CPUNR)" == "pentium4"
398CPUARG = /arch:SSE2
399!endif
400!endif
401
402LIBC =
403DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000404
405!ifdef NODEBUG
406VIM = vim
407!if "$(OPTIMIZE)" == "SPACE"
408OPTFLAG = /O1
409!elseif "$(OPTIMIZE)" == "SPEED"
410OPTFLAG = /O2
411!else # MAXSPEED
412OPTFLAG = /Ox
413!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200414
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000415!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000416# Use link time code generation if not worried about size
417!if "$(OPTIMIZE)" != "SPACE"
418OPTFLAG = $(OPTFLAG) /GL
419!endif
420!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200421
422# (/Wp64 is deprecated in VC9 and generates an obnoxious warning.)
423!if ("$(MSVCVER)" == "7.0") || ("$(MSVCVER)" == "7.1") || ("$(MSVCVER)" == "8.0")
424CFLAGS=$(CFLAGS) $(WP64CHECK)
425!endif
426
Bram Moolenaar34114692005-01-02 11:28:13 +0000427CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000428RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000429! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000430CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000431LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000432! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000433LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000434CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000435! endif
436!else # DEBUG
437VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000438! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000439DEBUGINFO = /ZI
440! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000441CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000442RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
443# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000444! if "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000445LIBC =
446! else
447LIBC = /fixed:no
448! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000449! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000450CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000451LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000452! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000453LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000454CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000455! endif
456!endif # DEBUG
457
458INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
459 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
460 $(NBDEBUG_INCL)
461
462OBJ = \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200463 $(OUTDIR)\blowfish.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000464 $(OUTDIR)\buffer.obj \
465 $(OUTDIR)\charset.obj \
466 $(OUTDIR)\diff.obj \
467 $(OUTDIR)\digraph.obj \
468 $(OUTDIR)\edit.obj \
469 $(OUTDIR)\eval.obj \
470 $(OUTDIR)\ex_cmds.obj \
471 $(OUTDIR)\ex_cmds2.obj \
472 $(OUTDIR)\ex_docmd.obj \
473 $(OUTDIR)\ex_eval.obj \
474 $(OUTDIR)\ex_getln.obj \
475 $(OUTDIR)\fileio.obj \
476 $(OUTDIR)\fold.obj \
477 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000478 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000479 $(OUTDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000480 $(OUTDIR)\main.obj \
481 $(OUTDIR)\mark.obj \
482 $(OUTDIR)\mbyte.obj \
483 $(OUTDIR)\memfile.obj \
484 $(OUTDIR)\memline.obj \
485 $(OUTDIR)\menu.obj \
486 $(OUTDIR)\message.obj \
487 $(OUTDIR)\misc1.obj \
488 $(OUTDIR)\misc2.obj \
489 $(OUTDIR)\move.obj \
490 $(OUTDIR)\normal.obj \
491 $(OUTDIR)\ops.obj \
492 $(OUTDIR)\option.obj \
493 $(OUTDIR)\os_mswin.obj \
494 $(OUTDIR)\os_win32.obj \
495 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000496 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000497 $(OUTDIR)\quickfix.obj \
498 $(OUTDIR)\regexp.obj \
499 $(OUTDIR)\screen.obj \
500 $(OUTDIR)\search.obj \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200501 $(OUTDIR)\sha256.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000502 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000503 $(OUTDIR)\syntax.obj \
504 $(OUTDIR)\tag.obj \
505 $(OUTDIR)\term.obj \
506 $(OUTDIR)\ui.obj \
507 $(OUTDIR)\undo.obj \
508 $(OUTDIR)\window.obj \
509 $(OUTDIR)\vim.res
510
511!if "$(OLE)" == "yes"
512CFLAGS = $(CFLAGS) -DFEAT_OLE
513RCFLAGS = $(RCFLAGS) -DFEAT_OLE
514OLE_OBJ = $(OUTDIR)\if_ole.obj
515OLE_IDL = if_ole.idl
516OLE_LIB = oleaut32.lib
517!endif
518
519!if "$(IME)" == "yes"
520CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
521!ifndef DYNAMIC_IME
522DYNAMIC_IME = yes
523!endif
524!if "$(DYNAMIC_IME)" == "yes"
525CFLAGS = $(CFLAGS) -DDYNAMIC_IME
526!else
527IME_LIB = imm32.lib
528!endif
529!endif
530
531!if "$(GIME)" == "yes"
532CFLAGS = $(CFLAGS) -DGLOBAL_IME
533OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
534MBYTE = yes
535!endif
536
537!if "$(MBYTE)" == "yes"
538CFLAGS = $(CFLAGS) -DFEAT_MBYTE
539!endif
540
541!if "$(GUI)" == "yes"
542SUBSYSTEM = windows
543CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
544RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
545VIM = g$(VIM)
546GUI_INCL = \
547 gui.h \
548 regexp.h \
549 ascii.h \
550 ex_cmds.h \
551 farsi.h \
552 feature.h \
553 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000554 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000555 keymap.h \
556 macros.h \
557 option.h \
558 os_dos.h \
559 os_win32.h
560GUI_OBJ = \
561 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000562 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000563 $(OUTDIR)\gui_w32.obj \
564 $(OUTDIR)\os_w32exe.obj
565GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000566 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000567 winspool.lib comctl32.lib advapi32.lib shell32.lib \
568 /machine:$(CPU) /nodefaultlib
569!else
570SUBSYSTEM = console
571!endif
572
573# iconv.dll library (dynamically loaded)
574!ifndef ICONV
575ICONV = yes
576!endif
577!if "$(ICONV)" == "yes"
578CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
579!endif
580
581# libintl.dll library
582!ifndef GETTEXT
583GETTEXT = yes
584!endif
585!if "$(GETTEXT)" == "yes"
586CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
587!endif
588
589# TCL interface
590!ifdef TCL
591!ifndef TCL_VER
592TCL_VER = 83
593TCL_VER_LONG = 8.3
594!endif
595!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
596!if "$(DYNAMIC_TCL)" == "yes"
597!message Tcl DLL will be loaded dynamically
598TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000599CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
600 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000601TCL_OBJ = $(OUTDIR)\if_tcl.obj
602TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
603TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
604!else
605CFLAGS = $(CFLAGS) -DFEAT_TCL
606TCL_OBJ = $(OUTDIR)\if_tcl.obj
607TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
608TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
609!endif
610!endif
611
612# PYTHON interface
613!ifdef PYTHON
614!ifndef PYTHON_VER
615PYTHON_VER = 22
616!endif
617!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
618!if "$(DYNAMIC_PYTHON)" == "yes"
619!message Python DLL will be loaded dynamically
620!endif
621CFLAGS = $(CFLAGS) -DFEAT_PYTHON
622PYTHON_OBJ = $(OUTDIR)\if_python.obj
623PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
624!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000625CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
626 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000627PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
628!else
629PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
630!endif
631!endif
632
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000633# MzScheme interface
634!ifdef MZSCHEME
635!message MzScheme requested - root dir is "$(MZSCHEME)"
636!ifndef MZSCHEME_VER
637MZSCHEME_VER = 205_000
638!endif
639CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000640!if EXIST("$(MZSCHEME)\collects\scheme\base.ss")
641# for MzScheme 4.x we need to include byte code for basic Scheme stuff
642MZSCHEME_EXTRA_DEP = mzscheme_base.c
643CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
644!endif
645!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib") \
646 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
647!message Building with Precise GC
648MZSCHEME_PRECISE_GC = yes
649CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
650!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000651!if "$(DYNAMIC_MZSCHEME)" == "yes"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000652!if "$(MZSCHEME_PRECISE_GC)" == "yes"
653!error MzScheme with Precise GC cannot be loaded dynamically
654!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000655!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000656CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
657 -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" \
658 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000659!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000660!if "$(MZSCHEME_DEBUG)" == "yes"
661CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
662!endif
663!if "$(MZSCHEME_PRECISE_GC)" == "yes"
664# Precise GC does not use separate dll
665MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
666!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000667MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
668 $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000669!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000670!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000671MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
672!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000673
Bram Moolenaar071d4272004-06-13 20:20:40 +0000674# Perl interface
675!ifdef PERL
676!ifndef PERL_VER
677PERL_VER = 56
678!endif
679!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
680!if "$(DYNAMIC_PERL)" == "yes"
681!if $(PERL_VER) >= 56
682!message Perl DLL will be loaded dynamically
683!else
684!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
685!message Reverting to static loading...
686!undef DYNAMIC_PERL
687!endif
688!endif
689
690# Is Perl installed in architecture-specific directories?
691!if exist($(PERL)\Bin\MSWin32-x86)
692PERL_ARCH = \MSWin32-x86
693!endif
694
695PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
696
697# Version-dependent stuff
698!if $(PERL_VER) == 55
699PERL_LIB = $(PERL_INCDIR)\perl.lib
700!else
701PERL_DLL = perl$(PERL_VER).dll
702PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
703!endif
704
705CFLAGS = $(CFLAGS) -DFEAT_PERL
706
707# Do we want to load Perl dynamically?
708!if "$(DYNAMIC_PERL)" == "yes"
709CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
710!undef PERL_LIB
711!endif
712
713PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
714PERL_INC = /I $(PERL_INCDIR)
715PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
716XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
717XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
718
719!endif
720
721#
722# Support Ruby interface
723#
724!ifdef RUBY
725# Set default value
726!ifndef RUBY_VER
727RUBY_VER = 18
728!endif
729!ifndef RUBY_VER_LONG
730RUBY_VER_LONG = 1.8
731!endif
732
733!if $(RUBY_VER) >= 18
734!ifndef RUBY_PLATFORM
735RUBY_PLATFORM = i386-mswin32
736!endif
737!ifndef RUBY_INSTALL_NAME
738RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
739!endif
740!else
741!ifndef RUBY_PLATFORM
742RUBY_PLATFORM = i586-mswin32
743!endif
744!ifndef RUBY_INSTALL_NAME
745RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
746!endif
747!endif # $(RUBY_VER) >= 18
748
749!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
750CFLAGS = $(CFLAGS) -DFEAT_RUBY
751RUBY_OBJ = $(OUTDIR)\if_ruby.obj
752RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
753RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
754# Do we want to load Ruby dynamically?
755!if "$(DYNAMIC_RUBY)" == "yes"
756!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000757CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
758 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000759!undef RUBY_LIB
760!endif
761!endif # RUBY
762
763#
764# Support PostScript printing
765#
766!if "$(POSTSCRIPT)" == "yes"
767CFLAGS = $(CFLAGS) -DMSWINPS
768!endif # POSTSCRIPT
769
770#
771# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
772#
773!if "$(FEATURES)"==""
774FEATURES = BIG
775!endif
776CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
777
778#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000779# Always generate the .pdb file, so that we get debug symbols that can be used
780# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000781# Generate edit-and-continue debug info when no optimization - allows to
782# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000783#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000784CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
785LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000786
787#
788# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000789#
790!message
791
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000792conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000793
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000794PATHDEF_SRC = $(OUTDIR)\pathdef.c
795
Bram Moolenaar071d4272004-06-13 20:20:40 +0000796!IF "$(MAP)" == "yes"
797# "/map" is for debugging
798conflags = $(conflags) /map
799!ELSEIF "$(MAP)" == "lines"
800# "/mapinfo:lines" is for debugging, only works for VC6 and later
801conflags = $(conflags) /map /mapinfo:lines
802!ENDIF
803
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000804LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000805LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000806 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
807 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000808
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000809# Report link time code generation progress if used.
810!ifdef NODEBUG
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000811!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000812!if "$(OPTIMIZE)" != "SPACE"
813LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
814!endif
815!endif
816!endif
817
Bram Moolenaarb6356332005-07-18 21:40:44 +0000818all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
819 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000820
Bram Moolenaarb6356332005-07-18 21:40:44 +0000821$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
822 $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
823 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) version.c version.h
824 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000825 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000826 $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) \
827 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
828 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000829
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000830$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000831
832$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000833 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000834
835install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +0000836 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +0200837 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000838 - if exist install.exe del install.exe
839 ren dosinst.exe install.exe
840
841uninstal.exe: uninstal.c
842 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
843
844vimrun.exe: vimrun.c
845 $(CC) /nologo -DNDEBUG vimrun.c
846
847xxd/xxd.exe: xxd/xxd.c
848 cd xxd
849 $(MAKE) /NOLOGO -f Make_mvc.mak
850 cd ..
851
852GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
853 cd GvimExt
854 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
855 cd ..
856
857
858tags: notags
859 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
860
861notags:
862 - if exist tags del tags
863
864clean:
Bram Moolenaar02743632005-07-25 20:42:36 +0000865 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000866 - if exist *.obj del *.obj
867 - if exist $(VIM).exe del $(VIM).exe
868 - if exist $(VIM).ilk del $(VIM).ilk
869 - if exist $(VIM).pdb del $(VIM).pdb
870 - if exist $(VIM).map del $(VIM).map
871 - if exist $(VIM).ncb del $(VIM).ncb
872 - if exist vimrun.exe del vimrun.exe
873 - if exist install.exe del install.exe
874 - if exist uninstal.exe del uninstal.exe
875 - if exist if_perl.c del if_perl.c
876 - if exist dimm.h del dimm.h
877 - if exist dimm_i.c del dimm_i.c
878 - if exist dimm.tlb del dimm.tlb
879 - if exist dosinst.exe del dosinst.exe
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000880 - if exist mzscheme_base.c del mzscheme_base.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000881 cd xxd
882 $(MAKE) /NOLOGO -f Make_mvc.mak clean
883 cd ..
884 cd GvimExt
885 $(MAKE) /NOLOGO -f Makefile clean
886 cd ..
887 cd GvimExt
888 $(MAKE) /NOLOGO -f Makefile clean
889 cd ..
890 - if exist testdir\*.out del testdir\*.out
891
892test:
893 cd testdir
894 $(MAKE) /NOLOGO -f Make_dos.mak win32
895 cd ..
896
Bram Moolenaar34114692005-01-02 11:28:13 +0000897testclean:
898 cd testdir
899 $(MAKE) /NOLOGO -f Make_dos.mak clean
900 cd ..
901
Bram Moolenaar071d4272004-06-13 20:20:40 +0000902###########################################################################
903
904# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
905# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000906!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000907.c{$(OUTDIR)/}.obj:
908!ELSE
909.c{$(OUTDIR)/}.obj::
910!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +0000911 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000912
913# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
914# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000915!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000916.cpp{$(OUTDIR)/}.obj:
917!ELSE
918.cpp{$(OUTDIR)/}.obj::
919!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +0000920 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000921
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200922$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
923
Bram Moolenaaredac1852010-05-18 20:34:20 +0200924$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200925
Bram Moolenaar071d4272004-06-13 20:20:40 +0000926$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
927
928$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
929
930$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
931
932$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
933
934$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
935
936$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
937
938$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
939
940$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
941
942$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
943
944$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
945
946$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
947
948$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
949
950$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
951
Bram Moolenaar58d98232005-07-23 22:25:46 +0000952$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
953
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000954$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000955
Bram Moolenaar071d4272004-06-13 20:20:40 +0000956$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
957
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000958$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
959
Bram Moolenaar071d4272004-06-13 20:20:40 +0000960$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
961
962$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
963
964if_perl.c : if_perl.xs typemap
Bram Moolenaarb6356332005-07-18 21:40:44 +0000965 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
966 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000967
968$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000969 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000970
971$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000972 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000973
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000974$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000975 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000976 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000977mzscheme_base.c:
978 $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000979
Bram Moolenaar071d4272004-06-13 20:20:40 +0000980$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000981 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000982
983$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
984
985$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000986 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000987
988$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000989 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000990
991$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000992 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000993
994$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
995
996$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
997
998$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
999
1000$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1001
1002$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1003
1004$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1005
1006$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1007
1008$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1009
1010$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1011
1012$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1013
1014$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1015
1016$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1017
1018$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1019
1020$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1021
1022$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1023
1024$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1025
1026$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1027
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001028$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1029 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001030
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001031$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001032
Bram Moolenaar071d4272004-06-13 20:20:40 +00001033$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1034
1035$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
1036
1037$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1038
1039$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1040
Bram Moolenaaredac1852010-05-18 20:34:20 +02001041$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1042
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001043$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1044
Bram Moolenaar071d4272004-06-13 20:20:40 +00001045$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1046
1047$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1048
1049$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1050
1051$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1052
1053$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1054
1055$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1056
1057$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001058 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001059
Bram Moolenaar1e7ac852009-06-16 14:44:48 +00001060$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp tearoff.bmp \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001061 vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001062 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1063
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001064iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001065 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1066 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001067
1068dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001069 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001070
1071$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1072
1073$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1074
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001075# $CFLAGS may contain backslashes and double quotes, escape them both.
1076E0_CFLAGS = $(CFLAGS:\=\\)
1077E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001078# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001079
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001080$(PATHDEF_SRC): auto
1081 @echo creating $(PATHDEF_SRC)
1082 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1083 @echo #include "vim.h" >> $(PATHDEF_SRC)
1084 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1085 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1086 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
1087 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> $(PATHDEF_SRC)
1088 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1089 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001090
1091auto:
1092 if not exist auto/nul mkdir auto
1093
1094# End Custom Build
1095proto.h: \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001096 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001097 proto/buffer.pro \
1098 proto/charset.pro \
1099 proto/diff.pro \
1100 proto/digraph.pro \
1101 proto/edit.pro \
1102 proto/eval.pro \
1103 proto/ex_cmds.pro \
1104 proto/ex_cmds2.pro \
1105 proto/ex_docmd.pro \
1106 proto/ex_eval.pro \
1107 proto/ex_getln.pro \
1108 proto/fileio.pro \
1109 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001110 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001111 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001112 proto/main.pro \
1113 proto/mark.pro \
1114 proto/memfile.pro \
1115 proto/memline.pro \
1116 proto/menu.pro \
1117 proto/message.pro \
1118 proto/misc1.pro \
1119 proto/misc2.pro \
1120 proto/move.pro \
1121 proto/mbyte.pro \
1122 proto/normal.pro \
1123 proto/ops.pro \
1124 proto/option.pro \
1125 proto/os_mswin.pro \
1126 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001127 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001128 proto/quickfix.pro \
1129 proto/regexp.pro \
1130 proto/screen.pro \
1131 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001132 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001133 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001134 proto/syntax.pro \
1135 proto/tag.pro \
1136 proto/term.pro \
1137 proto/ui.pro \
1138 proto/undo.pro \
1139 proto/window.pro \
1140 $(NETBEANS_PRO)
1141
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001142.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001143
1144# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1145# foo.cod"
1146.c.cod:
1147 $(CC) $(CFLAGS) /FAcs $<
1148
1149# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1150.c.i:
1151 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001152
1153
Bram Moolenaar071d4272004-06-13 20:20:40 +00001154# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: