blob: 7a144cc30c2e2dea2f56d4e39e3977de0ce24e8a [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 Moolenaar0ba04292010-07-14 23:23:17 +020033# Lua interface:
34# LUA=[Path to Lua directory]
35# DYNAMIC_LUA=yes (to load the Lua DLL dynamically)
36# LUA_VER=[Lua version] (default is 51)
37#
Bram Moolenaar65c1b012005-01-31 19:02:28 +000038# MzScheme interface:
39# MZSCHEME=[Path to MzScheme directory]
40# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically)
41# MZSCHEME_VER=[version, 205_000, ...]
Bram Moolenaar9e70cf12009-05-26 20:59:55 +000042# MZSCHEME_DEBUG=no
Bram Moolenaar7887d882005-07-01 22:33:52 +000043#
Bram Moolenaar071d4272004-06-13 20:20:40 +000044# Perl interface:
45# PERL=[Path to Perl directory]
46# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
Bram Moolenaar7887d882005-07-01 22:33:52 +000047# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc]
48# (default is 56)
49#
Bram Moolenaar071d4272004-06-13 20:20:40 +000050# Python interface:
51# PYTHON=[Path to Python directory]
52# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
53# PYTHON_VER=[Python version, eg 15, 20] (default is 22)
Bram Moolenaar7887d882005-07-01 22:33:52 +000054#
Bram Moolenaar071d4272004-06-13 20:20:40 +000055# Ruby interface:
56# RUBY=[Path to Ruby directory]
57# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
58# RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
59# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
60# You must set RUBY_VER_LONG when change RUBY_VER.
Bram Moolenaar7887d882005-07-01 22:33:52 +000061#
Bram Moolenaar071d4272004-06-13 20:20:40 +000062# Tcl interface:
63# TCL=[Path to Tcl directory]
64# DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
65# TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
66# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
67# You must set TCL_VER_LONG when you set TCL_VER.
Bram Moolenaar7887d882005-07-01 22:33:52 +000068#
69# SNiFF+ interface: SNIFF=yes
70#
71# Cscope support: CSCOPE=yes
72#
73# Iconv library support (always dynamically loaded):
74# ICONV=[yes or no] (default is yes)
75#
76# Intl library support (always dynamically loaded):
77# GETTEXT=[yes or no] (default is yes)
78# See http://sourceforge.net/projects/gettext/
79#
80# PostScript printing: POSTSCRIPT=yes (default is no)
81#
82# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
83#
84# XPM Image Support: XPM=[path to XPM directory]
85#
86# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
87#
88# Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
89# i386)
90#
91# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
92#
Bram Moolenaar071d4272004-06-13 20:20:40 +000093# Debug version: DEBUG=yes
94# Mapfile: MAP=[no, yes or lines] (default is yes)
95# no: Don't write a mapfile.
96# yes: Write a normal mapfile.
97# lines: Write a mapfile with line numbers (only for VC6 and later)
Bram Moolenaar7887d882005-07-01 22:33:52 +000098#
99# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
100# doesn't work)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000101#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000102# Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
103#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000104# You can combine any of these interfaces
105#
106# Example: To build the non-debug, GUI version with Perl interface:
107# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
108#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109# DEBUG with Make_mvc.mak and Make_dvc.mak:
110# This makefile gives a fineness of control which is not supported in
111# Visual C++ configuration files. Therefore, debugging requires a bit of
112# extra work.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000113# Make_dvc.mak is a Visual C++ project to access that support. It may be
114# badly out of date for the Visual C++ you are using...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000115# To use Make_dvc.mak:
116# 1) Build Vim with Make_mvc.mak.
117# Use a "DEBUG=yes" argument to build Vim with debug support.
118# E.g. the following builds gvimd.exe:
119# nmake -f Make_mvc.mak debug=yes gui=yes
120# 2) Use MS Devstudio and set it up to allow that file to be debugged:
121# i) Pass Make_dvc.mak to the IDE.
122# Use the "open workspace" menu entry to load Make_dvc.mak.
123# Alternatively, from the command line:
124# msdev /nologo Make_dvc.mak
125# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
126# this and offer to convert it to their own format. Accept that.
127# It creates a file called Make_dvc.dsw which can then be used
128# for further operations. E.g.
129# msdev /nologo Make_dvc.dsw
130# ii) Set the built executable for debugging:
131# a) Alt+F7/Debug takes you to the Debug dialog.
132# b) Fill "Executable for debug session". e.g. gvimd.exe
133# c) Fill "Program arguments". e.g. -R dosinst.c
134# d) Complete the dialog
135# 3) You can now debug the executable you built with Make_mvc.mak
136#
137# Note: Make_dvc.mak builds vimrun.exe, because it must build something
138# to be a valid makefile..
139
140### See feature.h for a list of optionals.
141# If you want to build some optional features without modifying the source,
142# you can set DEFINES on the command line, e.g.,
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000143# nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000144
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000145# Build on both Windows NT/XP and Windows 9x
Bram Moolenaar071d4272004-06-13 20:20:40 +0000146
147TARGETOS = BOTH
148
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000149# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
150# interfaces.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000151# If you change something else, do "make clean" first!
152!if "$(GUI)" == "yes"
153OBJDIR = .\ObjG
154!else
155OBJDIR = .\ObjC
156!endif
157!if "$(OLE)" == "yes"
158OBJDIR = $(OBJDIR)O
159!endif
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200160!ifdef LUA
161OBJDIR = $(OBJDIR)U
162!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000163!ifdef PERL
164OBJDIR = $(OBJDIR)L
165!endif
166!ifdef PYTHON
167OBJDIR = $(OBJDIR)Y
168!endif
169!ifdef TCL
170OBJDIR = $(OBJDIR)T
171!endif
172!ifdef RUBY
173OBJDIR = $(OBJDIR)R
174!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000175!ifdef MZSCHEME
176OBJDIR = $(OBJDIR)Z
177!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000178!if "$(DEBUG)" == "yes"
179OBJDIR = $(OBJDIR)d
180!endif
181
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000182# Win32.mak requires that CPU be set appropriately.
183# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000184
185!ifdef PROCESSOR_ARCHITECTURE
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000186# We're on Windows NT or using VC 6+
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000187! ifdef CPU
188ASSEMBLY_ARCHITECTURE=$(CPU)
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000189# Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7.
190! if ("$(ASSEMBLY_ARCHITECTURE)" == "i386") || ("$(ASSEMBLY_ARCHITECTURE)" == "I386")
191ASSEMBLY_ARCHITECTURE = x86
192! endif
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000193! else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000194CPU = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000195ASSEMBLY_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000196! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000197CPU = i386
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000198! endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000199! endif
200!else # !PROCESSOR_ARCHITECTURE
201# We're on Windows 95
202CPU = i386
203!endif # !PROCESSOR_ARCHITECTURE
204
Bram Moolenaar071d4272004-06-13 20:20:40 +0000205# Build a retail version by default
206
207!if "$(DEBUG)" != "yes"
208NODEBUG = 1
209!else
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000210!undef NODEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000211MAKEFLAGS_GVIMEXT = DEBUG=yes
212!endif
213
214
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000215# Get all sorts of useful, standard macros from the Platform SDK.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000216
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000217!include <Win32.mak>
Bram Moolenaar071d4272004-06-13 20:20:40 +0000218
Bram Moolenaar8cd213c2010-06-01 21:57:09 +0200219# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200220WP64CHECK = /Wp64
Bram Moolenaar071d4272004-06-13 20:20:40 +0000221
222#>>>>> path of the compiler and linker; name of include and lib directories
223# PATH = c:\msvc20\bin;$(PATH)
224# INCLUDE = c:\msvc20\include
225# LIB = c:\msvc20\lib
226
227!ifndef CTAGS
228CTAGS = ctags
229!endif
230
231!if "$(SNIFF)" == "yes"
232# SNIFF - Include support for SNiFF+.
233SNIFF_INCL = if_sniff.h
234SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
Bram Moolenaarb6356332005-07-18 21:40:44 +0000235SNIFF_LIB = shell32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000236SNIFF_DEFS = -DFEAT_SNIFF
237# The SNiFF integration needs multithreaded libraries!
238MULTITHREADED = yes
239!endif
240
241!ifndef CSCOPE
242CSCOPE = yes
243!endif
244
245!if "$(CSCOPE)" == "yes"
246# CSCOPE - Include support for Cscope
247CSCOPE_INCL = if_cscope.h
248CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
249CSCOPE_DEFS = -DFEAT_CSCOPE
250!endif
251
252!ifndef NETBEANS
253NETBEANS = $(GUI)
254!endif
255
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000256# Only allow NETBEANS and XPM for a GUI build.
257!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000258!if "$(NETBEANS)" == "yes"
259# NETBEANS - Include support for Netbeans integration
260NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000261NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000262NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000263
264!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000265NBDEBUG_DEFS = -DNBDEBUG
266NBDEBUG_INCL = nbdebug.h
267NBDEBUG_SRC = nbdebug.c
268!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000269NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000270!endif
271
272!ifdef XPM
273# XPM - Include support for XPM signs
274# you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
275XPM_OBJ = $(OBJDIR)/xpm_w32.obj
276XPM_DEFS = -DFEAT_XPM_W32
277XPM_LIB = $(XPM)\lib\libXpm.lib
278XPM_INC = -I $(XPM)\include
279!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000280!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000281
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000282# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000283!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000284# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000285# !elseif defined(MULTITHREADED)
286# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000287!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000288# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000289# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000290!endif
291
292# need advapi32.lib for GetUserName()
293# need shell32.lib for ExtractIcon()
294# gdi32.lib and comdlg32.lib for printing support
295# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000296CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
297 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000298!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000299CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
300!endif
301
302### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
303# When set to 0x0500 ":browse" stops working.
304!ifndef WINVER
305WINVER = 0x0400
306!endif
307
308# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
309# default, use these lines.
310#VIMRCLOC = somewhere
311#VIMRUNTIMEDIR = somewhere
312
313CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
314 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
315 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000316 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
317 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000318
319#>>>>> end of choices
320###########################################################################
321
322!ifdef OS
323OS_TYPE = winnt
324DEL_TREE = rmdir /s /q
325!else
326OS_TYPE = win95
327DEL_TREE = deltree /y
328!endif
329
330INTDIR=$(OBJDIR)
331OUTDIR=$(OBJDIR)
332
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000333# Derive version of VC being used from nmake if not specified
334!if "$(MSVCVER)" == ""
335!if "$(_NMAKE_VER)" == ""
336MSVCVER = 4.0
337!endif
338!if "$(_NMAKE_VER)" == "162"
339MSVCVER = 5.0
340!endif
341!if "$(_NMAKE_VER)" == "6.00.8168.0"
342MSVCVER = 6.0
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000343CPU = ix86
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000344!endif
345!if "$(_NMAKE_VER)" == "7.00.9466"
346MSVCVER = 7.0
347!endif
348!if "$(_NMAKE_VER)" == "7.10.3077"
349MSVCVER = 7.1
350!endif
351!if "$(_NMAKE_VER)" == "8.00.50727.42"
352MSVCVER = 8.0
353!endif
354!if "$(_NMAKE_VER)" == "8.00.50727.762"
355MSVCVER = 8.0
356!endif
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000357!if "$(_NMAKE_VER)" == "9.00.20706.01"
358MSVCVER = 9.0
359!endif
Bram Moolenaara7241f52008-06-24 20:39:31 +0000360!if "$(_NMAKE_VER)" == "9.00.21022.08"
361MSVCVER = 9.0
362!endif
Bram Moolenaar13658312009-02-04 17:35:52 +0000363!if "$(_NMAKE_VER)" == "9.00.30729.01"
364MSVCVER = 9.0
365!endif
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000366!if "$(_NMAKE_VER)" == "10.00.20506.01"
367MSVCVER = 10.0
368!endif
Bram Moolenaar2498b3a2010-03-02 17:59:44 +0100369!if "$(_NMAKE_VER)" == "10.00.30128.01"
370MSVCVER = 10.0
371!endif
Bram Moolenaar218116c2010-05-20 21:46:00 +0200372!if "$(_NMAKE_VER)" == "10.00.30319.01"
373MSVCVER = 10.0
374!endif
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200375!if "$(_NMAKE_VER)" == "9.00.30729.01"
376MSVCVER = 9.0
377!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000378!endif
379
380# Abort bulding VIM if version of VC is unrecognised.
381!ifndef MSVCVER
382!message *** ERROR
383!message Cannot determine Visual C version being used. If you are using the
384!message Windows SDK then you must have the environment variable MSVCVER set to
385!message your version of the VC compiler. If you are not using the Express
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000386!message version of Visual C, you can either set MSVCVER or update this makefile
387!message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)".
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000388!error Make aborted.
389!endif
390
Bram Moolenaar071d4272004-06-13 20:20:40 +0000391# Convert processor ID to MVC-compatible number
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000392!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000393!if "$(CPUNR)" == "i386"
394CPUARG = /G3
395!elseif "$(CPUNR)" == "i486"
396CPUARG = /G4
397!elseif "$(CPUNR)" == "i586"
398CPUARG = /G5
399!elseif "$(CPUNR)" == "i686"
400CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000401!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000402CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000403!else
404CPUARG =
405!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000406!else
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000407# VC8/9 only allows specifying SSE architecture
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000408!if "$(CPUNR)" == "pentium4"
409CPUARG = /arch:SSE2
410!endif
411!endif
412
413LIBC =
414DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000415
416!ifdef NODEBUG
417VIM = vim
418!if "$(OPTIMIZE)" == "SPACE"
419OPTFLAG = /O1
420!elseif "$(OPTIMIZE)" == "SPEED"
421OPTFLAG = /O2
422!else # MAXSPEED
423OPTFLAG = /Ox
424!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200425
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000426!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000427# Use link time code generation if not worried about size
428!if "$(OPTIMIZE)" != "SPACE"
429OPTFLAG = $(OPTFLAG) /GL
430!endif
431!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200432
433# (/Wp64 is deprecated in VC9 and generates an obnoxious warning.)
434!if ("$(MSVCVER)" == "7.0") || ("$(MSVCVER)" == "7.1") || ("$(MSVCVER)" == "8.0")
435CFLAGS=$(CFLAGS) $(WP64CHECK)
436!endif
437
Bram Moolenaar34114692005-01-02 11:28:13 +0000438CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000439RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000440! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000441CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000442LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000443! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000444LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000445CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000446! endif
447!else # DEBUG
448VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000449! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000450DEBUGINFO = /ZI
451! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000452CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000453RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
454# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000455! if "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000456LIBC =
457! else
458LIBC = /fixed:no
459! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000460! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000461CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000462LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000463! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000464LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000465CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000466! endif
467!endif # DEBUG
468
469INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
470 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
471 $(NBDEBUG_INCL)
472
473OBJ = \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200474 $(OUTDIR)\blowfish.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475 $(OUTDIR)\buffer.obj \
476 $(OUTDIR)\charset.obj \
477 $(OUTDIR)\diff.obj \
478 $(OUTDIR)\digraph.obj \
479 $(OUTDIR)\edit.obj \
480 $(OUTDIR)\eval.obj \
481 $(OUTDIR)\ex_cmds.obj \
482 $(OUTDIR)\ex_cmds2.obj \
483 $(OUTDIR)\ex_docmd.obj \
484 $(OUTDIR)\ex_eval.obj \
485 $(OUTDIR)\ex_getln.obj \
486 $(OUTDIR)\fileio.obj \
487 $(OUTDIR)\fold.obj \
488 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000489 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000490 $(OUTDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000491 $(OUTDIR)\main.obj \
492 $(OUTDIR)\mark.obj \
493 $(OUTDIR)\mbyte.obj \
494 $(OUTDIR)\memfile.obj \
495 $(OUTDIR)\memline.obj \
496 $(OUTDIR)\menu.obj \
497 $(OUTDIR)\message.obj \
498 $(OUTDIR)\misc1.obj \
499 $(OUTDIR)\misc2.obj \
500 $(OUTDIR)\move.obj \
501 $(OUTDIR)\normal.obj \
502 $(OUTDIR)\ops.obj \
503 $(OUTDIR)\option.obj \
504 $(OUTDIR)\os_mswin.obj \
505 $(OUTDIR)\os_win32.obj \
506 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000507 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000508 $(OUTDIR)\quickfix.obj \
509 $(OUTDIR)\regexp.obj \
510 $(OUTDIR)\screen.obj \
511 $(OUTDIR)\search.obj \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200512 $(OUTDIR)\sha256.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000513 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000514 $(OUTDIR)\syntax.obj \
515 $(OUTDIR)\tag.obj \
516 $(OUTDIR)\term.obj \
517 $(OUTDIR)\ui.obj \
518 $(OUTDIR)\undo.obj \
519 $(OUTDIR)\window.obj \
520 $(OUTDIR)\vim.res
521
522!if "$(OLE)" == "yes"
523CFLAGS = $(CFLAGS) -DFEAT_OLE
524RCFLAGS = $(RCFLAGS) -DFEAT_OLE
525OLE_OBJ = $(OUTDIR)\if_ole.obj
526OLE_IDL = if_ole.idl
527OLE_LIB = oleaut32.lib
528!endif
529
530!if "$(IME)" == "yes"
531CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
532!ifndef DYNAMIC_IME
533DYNAMIC_IME = yes
534!endif
535!if "$(DYNAMIC_IME)" == "yes"
536CFLAGS = $(CFLAGS) -DDYNAMIC_IME
537!else
538IME_LIB = imm32.lib
539!endif
540!endif
541
542!if "$(GIME)" == "yes"
543CFLAGS = $(CFLAGS) -DGLOBAL_IME
544OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
545MBYTE = yes
546!endif
547
548!if "$(MBYTE)" == "yes"
549CFLAGS = $(CFLAGS) -DFEAT_MBYTE
550!endif
551
552!if "$(GUI)" == "yes"
553SUBSYSTEM = windows
554CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
555RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
556VIM = g$(VIM)
557GUI_INCL = \
558 gui.h \
559 regexp.h \
560 ascii.h \
561 ex_cmds.h \
562 farsi.h \
563 feature.h \
564 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000565 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000566 keymap.h \
567 macros.h \
568 option.h \
569 os_dos.h \
570 os_win32.h
571GUI_OBJ = \
572 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000573 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000574 $(OUTDIR)\gui_w32.obj \
575 $(OUTDIR)\os_w32exe.obj
576GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000577 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000578 winspool.lib comctl32.lib advapi32.lib shell32.lib \
579 /machine:$(CPU) /nodefaultlib
580!else
581SUBSYSTEM = console
582!endif
583
584# iconv.dll library (dynamically loaded)
585!ifndef ICONV
586ICONV = yes
587!endif
588!if "$(ICONV)" == "yes"
589CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
590!endif
591
592# libintl.dll library
593!ifndef GETTEXT
594GETTEXT = yes
595!endif
596!if "$(GETTEXT)" == "yes"
597CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
598!endif
599
600# TCL interface
601!ifdef TCL
602!ifndef TCL_VER
603TCL_VER = 83
604TCL_VER_LONG = 8.3
605!endif
606!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
607!if "$(DYNAMIC_TCL)" == "yes"
608!message Tcl DLL will be loaded dynamically
609TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000610CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
611 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000612TCL_OBJ = $(OUTDIR)\if_tcl.obj
613TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
614TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
615!else
616CFLAGS = $(CFLAGS) -DFEAT_TCL
617TCL_OBJ = $(OUTDIR)\if_tcl.obj
618TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
619TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
620!endif
621!endif
622
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200623# Lua interface
624!ifdef LUA
625!ifndef LUA_VER
626LUA_VER = 51
627!endif
628!message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)"
629!if "$(DYNAMIC_LUA)" == "yes"
630!message Lua DLL will be loaded dynamically
631!endif
632CFLAGS = $(CFLAGS) -DFEAT_LUA
633LUA_OBJ = $(OUTDIR)\if_lua.obj
634LUA_INC = /I "$(LUA)\include" /I "$(LUA)"
635!if "$(DYNAMIC_LUA)" == "yes"
636CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \
637 -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
638LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib
639!else
640LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib"
641!endif
642!endif
643
Bram Moolenaar071d4272004-06-13 20:20:40 +0000644# PYTHON interface
645!ifdef PYTHON
646!ifndef PYTHON_VER
647PYTHON_VER = 22
648!endif
649!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
650!if "$(DYNAMIC_PYTHON)" == "yes"
651!message Python DLL will be loaded dynamically
652!endif
653CFLAGS = $(CFLAGS) -DFEAT_PYTHON
654PYTHON_OBJ = $(OUTDIR)\if_python.obj
655PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
656!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000657CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
658 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000659PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
660!else
661PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
662!endif
663!endif
664
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000665# MzScheme interface
666!ifdef MZSCHEME
667!message MzScheme requested - root dir is "$(MZSCHEME)"
668!ifndef MZSCHEME_VER
669MZSCHEME_VER = 205_000
670!endif
671CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000672!if EXIST("$(MZSCHEME)\collects\scheme\base.ss")
673# for MzScheme 4.x we need to include byte code for basic Scheme stuff
674MZSCHEME_EXTRA_DEP = mzscheme_base.c
675CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
676!endif
677!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib") \
678 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
679!message Building with Precise GC
680MZSCHEME_PRECISE_GC = yes
681CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
682!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000683!if "$(DYNAMIC_MZSCHEME)" == "yes"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000684!if "$(MZSCHEME_PRECISE_GC)" == "yes"
685!error MzScheme with Precise GC cannot be loaded dynamically
686!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000687!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000688CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
689 -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" \
690 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000691!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000692!if "$(MZSCHEME_DEBUG)" == "yes"
693CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
694!endif
695!if "$(MZSCHEME_PRECISE_GC)" == "yes"
696# Precise GC does not use separate dll
697MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
698!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000699MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
700 $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000701!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000702!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000703MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
704!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000705
Bram Moolenaar071d4272004-06-13 20:20:40 +0000706# Perl interface
707!ifdef PERL
708!ifndef PERL_VER
709PERL_VER = 56
710!endif
711!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
712!if "$(DYNAMIC_PERL)" == "yes"
713!if $(PERL_VER) >= 56
714!message Perl DLL will be loaded dynamically
715!else
716!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
717!message Reverting to static loading...
718!undef DYNAMIC_PERL
719!endif
720!endif
721
722# Is Perl installed in architecture-specific directories?
723!if exist($(PERL)\Bin\MSWin32-x86)
724PERL_ARCH = \MSWin32-x86
725!endif
726
727PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
728
729# Version-dependent stuff
730!if $(PERL_VER) == 55
731PERL_LIB = $(PERL_INCDIR)\perl.lib
732!else
733PERL_DLL = perl$(PERL_VER).dll
734PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
735!endif
736
737CFLAGS = $(CFLAGS) -DFEAT_PERL
738
739# Do we want to load Perl dynamically?
740!if "$(DYNAMIC_PERL)" == "yes"
741CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
742!undef PERL_LIB
743!endif
744
745PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
746PERL_INC = /I $(PERL_INCDIR)
747PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
748XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
749XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
750
751!endif
752
753#
754# Support Ruby interface
755#
756!ifdef RUBY
757# Set default value
758!ifndef RUBY_VER
759RUBY_VER = 18
760!endif
761!ifndef RUBY_VER_LONG
762RUBY_VER_LONG = 1.8
763!endif
764
765!if $(RUBY_VER) >= 18
766!ifndef RUBY_PLATFORM
767RUBY_PLATFORM = i386-mswin32
768!endif
769!ifndef RUBY_INSTALL_NAME
770RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
771!endif
772!else
773!ifndef RUBY_PLATFORM
774RUBY_PLATFORM = i586-mswin32
775!endif
776!ifndef RUBY_INSTALL_NAME
777RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
778!endif
779!endif # $(RUBY_VER) >= 18
780
781!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
782CFLAGS = $(CFLAGS) -DFEAT_RUBY
783RUBY_OBJ = $(OUTDIR)\if_ruby.obj
784RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
785RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
786# Do we want to load Ruby dynamically?
787!if "$(DYNAMIC_RUBY)" == "yes"
788!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000789CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
790 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000791!undef RUBY_LIB
792!endif
793!endif # RUBY
794
795#
796# Support PostScript printing
797#
798!if "$(POSTSCRIPT)" == "yes"
799CFLAGS = $(CFLAGS) -DMSWINPS
800!endif # POSTSCRIPT
801
802#
803# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
804#
805!if "$(FEATURES)"==""
806FEATURES = BIG
807!endif
808CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
809
810#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000811# Always generate the .pdb file, so that we get debug symbols that can be used
812# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000813# Generate edit-and-continue debug info when no optimization - allows to
814# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000815#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000816CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
817LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000818
819#
820# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000821#
822!message
823
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000824conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000825
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000826PATHDEF_SRC = $(OUTDIR)\pathdef.c
827
Bram Moolenaar071d4272004-06-13 20:20:40 +0000828!IF "$(MAP)" == "yes"
829# "/map" is for debugging
830conflags = $(conflags) /map
831!ELSEIF "$(MAP)" == "lines"
832# "/mapinfo:lines" is for debugging, only works for VC6 and later
833conflags = $(conflags) /map /mapinfo:lines
834!ENDIF
835
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000836LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000837LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200838 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000839 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000840
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000841# Report link time code generation progress if used.
842!ifdef NODEBUG
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000843!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000844!if "$(OPTIMIZE)" != "SPACE"
845LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
846!endif
847!endif
848!endif
849
Bram Moolenaarb6356332005-07-18 21:40:44 +0000850all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
851 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000852
Bram Moolenaarb6356332005-07-18 21:40:44 +0000853$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200854 $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
855 $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
856 version.c version.h
Bram Moolenaarb6356332005-07-18 21:40:44 +0000857 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000858 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200859 $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000860 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
861 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000862
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000863$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000864
865$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000866 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000867
868install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +0000869 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +0200870 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000871 - if exist install.exe del install.exe
872 ren dosinst.exe install.exe
873
874uninstal.exe: uninstal.c
875 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
876
877vimrun.exe: vimrun.c
878 $(CC) /nologo -DNDEBUG vimrun.c
879
880xxd/xxd.exe: xxd/xxd.c
881 cd xxd
882 $(MAKE) /NOLOGO -f Make_mvc.mak
883 cd ..
884
885GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
886 cd GvimExt
887 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
888 cd ..
889
890
891tags: notags
892 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
893
894notags:
895 - if exist tags del tags
896
897clean:
Bram Moolenaar02743632005-07-25 20:42:36 +0000898 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000899 - if exist *.obj del *.obj
900 - if exist $(VIM).exe del $(VIM).exe
901 - if exist $(VIM).ilk del $(VIM).ilk
902 - if exist $(VIM).pdb del $(VIM).pdb
903 - if exist $(VIM).map del $(VIM).map
904 - if exist $(VIM).ncb del $(VIM).ncb
905 - if exist vimrun.exe del vimrun.exe
906 - if exist install.exe del install.exe
907 - if exist uninstal.exe del uninstal.exe
908 - if exist if_perl.c del if_perl.c
909 - if exist dimm.h del dimm.h
910 - if exist dimm_i.c del dimm_i.c
911 - if exist dimm.tlb del dimm.tlb
912 - if exist dosinst.exe del dosinst.exe
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000913 - if exist mzscheme_base.c del mzscheme_base.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000914 cd xxd
915 $(MAKE) /NOLOGO -f Make_mvc.mak clean
916 cd ..
917 cd GvimExt
918 $(MAKE) /NOLOGO -f Makefile clean
919 cd ..
920 cd GvimExt
921 $(MAKE) /NOLOGO -f Makefile clean
922 cd ..
923 - if exist testdir\*.out del testdir\*.out
924
925test:
926 cd testdir
927 $(MAKE) /NOLOGO -f Make_dos.mak win32
928 cd ..
929
Bram Moolenaar34114692005-01-02 11:28:13 +0000930testclean:
931 cd testdir
932 $(MAKE) /NOLOGO -f Make_dos.mak clean
933 cd ..
934
Bram Moolenaar071d4272004-06-13 20:20:40 +0000935###########################################################################
936
937# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
938# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000939!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000940.c{$(OUTDIR)/}.obj:
941!ELSE
942.c{$(OUTDIR)/}.obj::
943!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +0000944 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000945
946# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
947# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000948!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000949.cpp{$(OUTDIR)/}.obj:
950!ELSE
951.cpp{$(OUTDIR)/}.obj::
952!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +0000953 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000954
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200955$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
956
Bram Moolenaaredac1852010-05-18 20:34:20 +0200957$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200958
Bram Moolenaar071d4272004-06-13 20:20:40 +0000959$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
960
961$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
962
963$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
964
965$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
966
967$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
968
969$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
970
971$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
972
973$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
974
975$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
976
977$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
978
979$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
980
981$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
982
983$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
984
Bram Moolenaar58d98232005-07-23 22:25:46 +0000985$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
986
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000987$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000988
Bram Moolenaar071d4272004-06-13 20:20:40 +0000989$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
990
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000991$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
992
Bram Moolenaar071d4272004-06-13 20:20:40 +0000993$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
994
995$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
996
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200997$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
998 $(CC) $(CFLAGS) $(LUA_INC) if_lua.c
999
Bram Moolenaar071d4272004-06-13 20:20:40 +00001000if_perl.c : if_perl.xs typemap
Bram Moolenaarb6356332005-07-18 21:40:44 +00001001 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
1002 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001003
1004$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001005 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001006
1007$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001008 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001009
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001010$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +00001011 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001012 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001013mzscheme_base.c:
1014 $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001015
Bram Moolenaar071d4272004-06-13 20:20:40 +00001016$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001017 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001018
1019$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
1020
1021$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001022 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001023
1024$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001025 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001026
1027$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001028 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001029
1030$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
1031
1032$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
1033
1034$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
1035
1036$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1037
1038$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1039
1040$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1041
1042$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1043
1044$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1045
1046$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1047
1048$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1049
1050$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1051
1052$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1053
1054$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1055
1056$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1057
1058$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1059
1060$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1061
1062$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1063
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001064$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1065 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001066
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001067$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001068
Bram Moolenaar071d4272004-06-13 20:20:40 +00001069$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1070
1071$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
1072
1073$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1074
1075$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1076
Bram Moolenaaredac1852010-05-18 20:34:20 +02001077$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1078
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001079$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1080
Bram Moolenaar071d4272004-06-13 20:20:40 +00001081$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1082
1083$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1084
1085$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1086
1087$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1088
1089$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1090
1091$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1092
1093$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001094 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001095
Bram Moolenaarcc448b32010-07-14 16:52:17 +02001096$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
1097 tearoff.bmp vim.ico vim_error.ico \
1098 vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001099 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1100
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001101iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001102 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1103 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001104
1105dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001106 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001107
1108$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1109
1110$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1111
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001112# $CFLAGS may contain backslashes and double quotes, escape them both.
1113E0_CFLAGS = $(CFLAGS:\=\\)
1114E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001115# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001116
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001117$(PATHDEF_SRC): auto
1118 @echo creating $(PATHDEF_SRC)
1119 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1120 @echo #include "vim.h" >> $(PATHDEF_SRC)
1121 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1122 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1123 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
1124 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> $(PATHDEF_SRC)
1125 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1126 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001127
1128auto:
1129 if not exist auto/nul mkdir auto
1130
1131# End Custom Build
1132proto.h: \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001133 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001134 proto/buffer.pro \
1135 proto/charset.pro \
1136 proto/diff.pro \
1137 proto/digraph.pro \
1138 proto/edit.pro \
1139 proto/eval.pro \
1140 proto/ex_cmds.pro \
1141 proto/ex_cmds2.pro \
1142 proto/ex_docmd.pro \
1143 proto/ex_eval.pro \
1144 proto/ex_getln.pro \
1145 proto/fileio.pro \
1146 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001147 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001148 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001149 proto/main.pro \
1150 proto/mark.pro \
1151 proto/memfile.pro \
1152 proto/memline.pro \
1153 proto/menu.pro \
1154 proto/message.pro \
1155 proto/misc1.pro \
1156 proto/misc2.pro \
1157 proto/move.pro \
1158 proto/mbyte.pro \
1159 proto/normal.pro \
1160 proto/ops.pro \
1161 proto/option.pro \
1162 proto/os_mswin.pro \
1163 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001164 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001165 proto/quickfix.pro \
1166 proto/regexp.pro \
1167 proto/screen.pro \
1168 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001169 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001170 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001171 proto/syntax.pro \
1172 proto/tag.pro \
1173 proto/term.pro \
1174 proto/ui.pro \
1175 proto/undo.pro \
1176 proto/window.pro \
1177 $(NETBEANS_PRO)
1178
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001179.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001180
1181# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1182# foo.cod"
1183.c.cod:
1184 $(CC) $(CFLAGS) /FAcs $<
1185
1186# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1187.c.i:
1188 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001189
1190
Bram Moolenaar071d4272004-06-13 20:20:40 +00001191# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: