blob: 34c87a598278512e008ec2dfa53d1cadaf981136 [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),
4# and VC9 (VS2008).
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
9# Python-enabled versions of vim for Win32 platforms.
10#
Bram Moolenaar071d4272004-06-13 20:20:40 +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 Moolenaar071d4272004-06-13 20:20:40 +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 Moolenaar7887d882005-07-01 22:33:52 +000037#
Bram Moolenaar071d4272004-06-13 20:20:40 +000038# Perl interface:
39# PERL=[Path to Perl directory]
40# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
Bram Moolenaar7887d882005-07-01 22:33:52 +000041# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc]
42# (default is 56)
43#
Bram Moolenaar071d4272004-06-13 20:20:40 +000044# Python interface:
45# PYTHON=[Path to Python directory]
46# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
47# PYTHON_VER=[Python version, eg 15, 20] (default is 22)
Bram Moolenaar7887d882005-07-01 22:33:52 +000048#
Bram Moolenaar071d4272004-06-13 20:20:40 +000049# Ruby interface:
50# RUBY=[Path to Ruby directory]
51# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
52# RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
53# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
54# You must set RUBY_VER_LONG when change RUBY_VER.
Bram Moolenaar7887d882005-07-01 22:33:52 +000055#
Bram Moolenaar071d4272004-06-13 20:20:40 +000056# Tcl interface:
57# TCL=[Path to Tcl directory]
58# DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
59# TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
60# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
61# You must set TCL_VER_LONG when you set TCL_VER.
Bram Moolenaar7887d882005-07-01 22:33:52 +000062#
63# SNiFF+ interface: SNIFF=yes
64#
65# Cscope support: CSCOPE=yes
66#
67# Iconv library support (always dynamically loaded):
68# ICONV=[yes or no] (default is yes)
69#
70# Intl library support (always dynamically loaded):
71# GETTEXT=[yes or no] (default is yes)
72# See http://sourceforge.net/projects/gettext/
73#
74# PostScript printing: POSTSCRIPT=yes (default is no)
75#
76# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
77#
78# XPM Image Support: XPM=[path to XPM directory]
79#
80# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
81#
82# Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
83# i386)
84#
85# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
86#
Bram Moolenaar071d4272004-06-13 20:20:40 +000087# Debug version: DEBUG=yes
88# Mapfile: MAP=[no, yes or lines] (default is yes)
89# no: Don't write a mapfile.
90# yes: Write a normal mapfile.
91# lines: Write a mapfile with line numbers (only for VC6 and later)
Bram Moolenaar7887d882005-07-01 22:33:52 +000092#
93# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
94# doesn't work)
Bram Moolenaar071d4272004-06-13 20:20:40 +000095#
Bram Moolenaarf22129b2007-10-03 11:29:44 +000096# Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
97#
Bram Moolenaar071d4272004-06-13 20:20:40 +000098# You can combine any of these interfaces
99#
100# Example: To build the non-debug, GUI version with Perl interface:
101# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
102#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000103# DEBUG with Make_mvc.mak and Make_dvc.mak:
104# This makefile gives a fineness of control which is not supported in
105# Visual C++ configuration files. Therefore, debugging requires a bit of
106# extra work.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000107# Make_dvc.mak is a Visual C++ project to access that support. It may be
108# badly out of date for the Visual C++ you are using...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109# To use Make_dvc.mak:
110# 1) Build Vim with Make_mvc.mak.
111# Use a "DEBUG=yes" argument to build Vim with debug support.
112# E.g. the following builds gvimd.exe:
113# nmake -f Make_mvc.mak debug=yes gui=yes
114# 2) Use MS Devstudio and set it up to allow that file to be debugged:
115# i) Pass Make_dvc.mak to the IDE.
116# Use the "open workspace" menu entry to load Make_dvc.mak.
117# Alternatively, from the command line:
118# msdev /nologo Make_dvc.mak
119# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
120# this and offer to convert it to their own format. Accept that.
121# It creates a file called Make_dvc.dsw which can then be used
122# for further operations. E.g.
123# msdev /nologo Make_dvc.dsw
124# ii) Set the built executable for debugging:
125# a) Alt+F7/Debug takes you to the Debug dialog.
126# b) Fill "Executable for debug session". e.g. gvimd.exe
127# c) Fill "Program arguments". e.g. -R dosinst.c
128# d) Complete the dialog
129# 3) You can now debug the executable you built with Make_mvc.mak
130#
131# Note: Make_dvc.mak builds vimrun.exe, because it must build something
132# to be a valid makefile..
133
134### See feature.h for a list of optionals.
135# If you want to build some optional features without modifying the source,
136# you can set DEFINES on the command line, e.g.,
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000137# nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000138
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000139# Build on both Windows NT/XP and Windows 9x
Bram Moolenaar071d4272004-06-13 20:20:40 +0000140
141TARGETOS = BOTH
142
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000143# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
144# interfaces.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000145# If you change something else, do "make clean" first!
146!if "$(GUI)" == "yes"
147OBJDIR = .\ObjG
148!else
149OBJDIR = .\ObjC
150!endif
151!if "$(OLE)" == "yes"
152OBJDIR = $(OBJDIR)O
153!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000154!ifdef PERL
155OBJDIR = $(OBJDIR)L
156!endif
157!ifdef PYTHON
158OBJDIR = $(OBJDIR)Y
159!endif
160!ifdef TCL
161OBJDIR = $(OBJDIR)T
162!endif
163!ifdef RUBY
164OBJDIR = $(OBJDIR)R
165!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000166!ifdef MZSCHEME
167OBJDIR = $(OBJDIR)Z
168!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000169!if "$(DEBUG)" == "yes"
170OBJDIR = $(OBJDIR)d
171!endif
172
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000173# Win32.mak requires that CPU be set appropriately.
174# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000175
176!ifdef PROCESSOR_ARCHITECTURE
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000177# We're on Windows NT or using VC 6+
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000178! ifdef CPU
179ASSEMBLY_ARCHITECTURE=$(CPU)
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000180# Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7.
181! if ("$(ASSEMBLY_ARCHITECTURE)" == "i386") || ("$(ASSEMBLY_ARCHITECTURE)" == "I386")
182ASSEMBLY_ARCHITECTURE = x86
183! endif
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000184! else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000185CPU = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000186ASSEMBLY_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000187! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000188CPU = i386
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000189! endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000190! endif
191!else # !PROCESSOR_ARCHITECTURE
192# We're on Windows 95
193CPU = i386
194!endif # !PROCESSOR_ARCHITECTURE
195
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000196!if ("$(CPU)" == "AMD64") || ("$(CPU)" == "IA64")
197DEFINES=$(DEFINES) /Wp64
198!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000199
200# Build a retail version by default
201
202!if "$(DEBUG)" != "yes"
203NODEBUG = 1
204!else
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000205!undef NODEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000206MAKEFLAGS_GVIMEXT = DEBUG=yes
207!endif
208
209
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000210# Get all sorts of useful, standard macros from the Platform SDK.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000211
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000212!include <Win32.mak>
Bram Moolenaar071d4272004-06-13 20:20:40 +0000213
214
215#>>>>> path of the compiler and linker; name of include and lib directories
216# PATH = c:\msvc20\bin;$(PATH)
217# INCLUDE = c:\msvc20\include
218# LIB = c:\msvc20\lib
219
220!ifndef CTAGS
221CTAGS = ctags
222!endif
223
224!if "$(SNIFF)" == "yes"
225# SNIFF - Include support for SNiFF+.
226SNIFF_INCL = if_sniff.h
227SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
Bram Moolenaarb6356332005-07-18 21:40:44 +0000228SNIFF_LIB = shell32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229SNIFF_DEFS = -DFEAT_SNIFF
230# The SNiFF integration needs multithreaded libraries!
231MULTITHREADED = yes
232!endif
233
234!ifndef CSCOPE
235CSCOPE = yes
236!endif
237
238!if "$(CSCOPE)" == "yes"
239# CSCOPE - Include support for Cscope
240CSCOPE_INCL = if_cscope.h
241CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
242CSCOPE_DEFS = -DFEAT_CSCOPE
243!endif
244
245!ifndef NETBEANS
246NETBEANS = $(GUI)
247!endif
248
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000249# Only allow NETBEANS and XPM for a GUI build.
250!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000251!if "$(NETBEANS)" == "yes"
252# NETBEANS - Include support for Netbeans integration
253NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000254NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000255NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000256
257!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000258NBDEBUG_DEFS = -DNBDEBUG
259NBDEBUG_INCL = nbdebug.h
260NBDEBUG_SRC = nbdebug.c
261!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000262NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000263!endif
264
265!ifdef XPM
266# XPM - Include support for XPM signs
267# you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
268XPM_OBJ = $(OBJDIR)/xpm_w32.obj
269XPM_DEFS = -DFEAT_XPM_W32
270XPM_LIB = $(XPM)\lib\libXpm.lib
271XPM_INC = -I $(XPM)\include
272!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000273!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000274
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000275# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000276!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000277# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000278# !elseif defined(MULTITHREADED)
279# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000280!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000281# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000282# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000283!endif
284
285# need advapi32.lib for GetUserName()
286# need shell32.lib for ExtractIcon()
287# gdi32.lib and comdlg32.lib for printing support
288# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000289CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
290 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000291!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000292CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
293!endif
294
295### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
296# When set to 0x0500 ":browse" stops working.
297!ifndef WINVER
298WINVER = 0x0400
299!endif
300
301# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
302# default, use these lines.
303#VIMRCLOC = somewhere
304#VIMRUNTIMEDIR = somewhere
305
306CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
307 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
308 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000309 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
310 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000311
312#>>>>> end of choices
313###########################################################################
314
315!ifdef OS
316OS_TYPE = winnt
317DEL_TREE = rmdir /s /q
318!else
319OS_TYPE = win95
320DEL_TREE = deltree /y
321!endif
322
323INTDIR=$(OBJDIR)
324OUTDIR=$(OBJDIR)
325
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000326# Derive version of VC being used from nmake if not specified
327!if "$(MSVCVER)" == ""
328!if "$(_NMAKE_VER)" == ""
329MSVCVER = 4.0
330!endif
331!if "$(_NMAKE_VER)" == "162"
332MSVCVER = 5.0
333!endif
334!if "$(_NMAKE_VER)" == "6.00.8168.0"
335MSVCVER = 6.0
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000336CPU = ix86
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000337!endif
338!if "$(_NMAKE_VER)" == "7.00.9466"
339MSVCVER = 7.0
340!endif
341!if "$(_NMAKE_VER)" == "7.10.3077"
342MSVCVER = 7.1
343!endif
344!if "$(_NMAKE_VER)" == "8.00.50727.42"
345MSVCVER = 8.0
346!endif
347!if "$(_NMAKE_VER)" == "8.00.50727.762"
348MSVCVER = 8.0
349!endif
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000350!if "$(_NMAKE_VER)" == "9.00.20706.01"
351MSVCVER = 9.0
352!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000353!endif
354
355# Abort bulding VIM if version of VC is unrecognised.
356!ifndef MSVCVER
357!message *** ERROR
358!message Cannot determine Visual C version being used. If you are using the
359!message Windows SDK then you must have the environment variable MSVCVER set to
360!message your version of the VC compiler. If you are not using the Express
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000361!message version of Visual C, you can either set MSVCVER or update this makefile
362!message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)".
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000363!error Make aborted.
364!endif
365
Bram Moolenaar071d4272004-06-13 20:20:40 +0000366# Convert processor ID to MVC-compatible number
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000367!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000368!if "$(CPUNR)" == "i386"
369CPUARG = /G3
370!elseif "$(CPUNR)" == "i486"
371CPUARG = /G4
372!elseif "$(CPUNR)" == "i586"
373CPUARG = /G5
374!elseif "$(CPUNR)" == "i686"
375CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000376!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000377CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000378!else
379CPUARG =
380!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000381!else
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000382# VC8/9 only allows specifying SSE architecture
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000383!if "$(CPUNR)" == "pentium4"
384CPUARG = /arch:SSE2
385!endif
386!endif
387
388LIBC =
389DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000390
391!ifdef NODEBUG
392VIM = vim
393!if "$(OPTIMIZE)" == "SPACE"
394OPTFLAG = /O1
395!elseif "$(OPTIMIZE)" == "SPEED"
396OPTFLAG = /O2
397!else # MAXSPEED
398OPTFLAG = /Ox
399!endif
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000400!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000401# Use link time code generation if not worried about size
402!if "$(OPTIMIZE)" != "SPACE"
403OPTFLAG = $(OPTFLAG) /GL
404!endif
405!endif
Bram Moolenaar34114692005-01-02 11:28:13 +0000406CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000407RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000408! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000409CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000410LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000411! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000412LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000413CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000414! endif
415!else # DEBUG
416VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000417! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000418DEBUGINFO = /ZI
419! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000420CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000421RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
422# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000423! if "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000424LIBC =
425! else
426LIBC = /fixed:no
427! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000428! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000429CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000430LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000431! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000432LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000433CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000434! endif
435!endif # DEBUG
436
437INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
438 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
439 $(NBDEBUG_INCL)
440
441OBJ = \
442 $(OUTDIR)\buffer.obj \
443 $(OUTDIR)\charset.obj \
444 $(OUTDIR)\diff.obj \
445 $(OUTDIR)\digraph.obj \
446 $(OUTDIR)\edit.obj \
447 $(OUTDIR)\eval.obj \
448 $(OUTDIR)\ex_cmds.obj \
449 $(OUTDIR)\ex_cmds2.obj \
450 $(OUTDIR)\ex_docmd.obj \
451 $(OUTDIR)\ex_eval.obj \
452 $(OUTDIR)\ex_getln.obj \
453 $(OUTDIR)\fileio.obj \
454 $(OUTDIR)\fold.obj \
455 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000456 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000457 $(OUTDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000458 $(OUTDIR)\main.obj \
459 $(OUTDIR)\mark.obj \
460 $(OUTDIR)\mbyte.obj \
461 $(OUTDIR)\memfile.obj \
462 $(OUTDIR)\memline.obj \
463 $(OUTDIR)\menu.obj \
464 $(OUTDIR)\message.obj \
465 $(OUTDIR)\misc1.obj \
466 $(OUTDIR)\misc2.obj \
467 $(OUTDIR)\move.obj \
468 $(OUTDIR)\normal.obj \
469 $(OUTDIR)\ops.obj \
470 $(OUTDIR)\option.obj \
471 $(OUTDIR)\os_mswin.obj \
472 $(OUTDIR)\os_win32.obj \
473 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000474 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000475 $(OUTDIR)\quickfix.obj \
476 $(OUTDIR)\regexp.obj \
477 $(OUTDIR)\screen.obj \
478 $(OUTDIR)\search.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000479 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000480 $(OUTDIR)\syntax.obj \
481 $(OUTDIR)\tag.obj \
482 $(OUTDIR)\term.obj \
483 $(OUTDIR)\ui.obj \
484 $(OUTDIR)\undo.obj \
485 $(OUTDIR)\window.obj \
486 $(OUTDIR)\vim.res
487
488!if "$(OLE)" == "yes"
489CFLAGS = $(CFLAGS) -DFEAT_OLE
490RCFLAGS = $(RCFLAGS) -DFEAT_OLE
491OLE_OBJ = $(OUTDIR)\if_ole.obj
492OLE_IDL = if_ole.idl
493OLE_LIB = oleaut32.lib
494!endif
495
496!if "$(IME)" == "yes"
497CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
498!ifndef DYNAMIC_IME
499DYNAMIC_IME = yes
500!endif
501!if "$(DYNAMIC_IME)" == "yes"
502CFLAGS = $(CFLAGS) -DDYNAMIC_IME
503!else
504IME_LIB = imm32.lib
505!endif
506!endif
507
508!if "$(GIME)" == "yes"
509CFLAGS = $(CFLAGS) -DGLOBAL_IME
510OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
511MBYTE = yes
512!endif
513
514!if "$(MBYTE)" == "yes"
515CFLAGS = $(CFLAGS) -DFEAT_MBYTE
516!endif
517
518!if "$(GUI)" == "yes"
519SUBSYSTEM = windows
520CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
521RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
522VIM = g$(VIM)
523GUI_INCL = \
524 gui.h \
525 regexp.h \
526 ascii.h \
527 ex_cmds.h \
528 farsi.h \
529 feature.h \
530 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000531 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000532 keymap.h \
533 macros.h \
534 option.h \
535 os_dos.h \
536 os_win32.h
537GUI_OBJ = \
538 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000539 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000540 $(OUTDIR)\gui_w32.obj \
541 $(OUTDIR)\os_w32exe.obj
542GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000543 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000544 winspool.lib comctl32.lib advapi32.lib shell32.lib \
545 /machine:$(CPU) /nodefaultlib
546!else
547SUBSYSTEM = console
548!endif
549
550# iconv.dll library (dynamically loaded)
551!ifndef ICONV
552ICONV = yes
553!endif
554!if "$(ICONV)" == "yes"
555CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
556!endif
557
558# libintl.dll library
559!ifndef GETTEXT
560GETTEXT = yes
561!endif
562!if "$(GETTEXT)" == "yes"
563CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
564!endif
565
566# TCL interface
567!ifdef TCL
568!ifndef TCL_VER
569TCL_VER = 83
570TCL_VER_LONG = 8.3
571!endif
572!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
573!if "$(DYNAMIC_TCL)" == "yes"
574!message Tcl DLL will be loaded dynamically
575TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000576CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
577 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000578TCL_OBJ = $(OUTDIR)\if_tcl.obj
579TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
580TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
581!else
582CFLAGS = $(CFLAGS) -DFEAT_TCL
583TCL_OBJ = $(OUTDIR)\if_tcl.obj
584TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
585TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
586!endif
587!endif
588
589# PYTHON interface
590!ifdef PYTHON
591!ifndef PYTHON_VER
592PYTHON_VER = 22
593!endif
594!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
595!if "$(DYNAMIC_PYTHON)" == "yes"
596!message Python DLL will be loaded dynamically
597!endif
598CFLAGS = $(CFLAGS) -DFEAT_PYTHON
599PYTHON_OBJ = $(OUTDIR)\if_python.obj
600PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
601!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000602CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
603 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000604PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
605!else
606PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
607!endif
608!endif
609
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000610# MzScheme interface
611!ifdef MZSCHEME
612!message MzScheme requested - root dir is "$(MZSCHEME)"
613!ifndef MZSCHEME_VER
614MZSCHEME_VER = 205_000
615!endif
616CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000617!if "$(DYNAMIC_MZSCHEME)" == "yes"
618!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000619CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
620 -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" \
621 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000622!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000623MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
624 $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000625!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000626MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
627!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000628
Bram Moolenaar071d4272004-06-13 20:20:40 +0000629# Perl interface
630!ifdef PERL
631!ifndef PERL_VER
632PERL_VER = 56
633!endif
634!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
635!if "$(DYNAMIC_PERL)" == "yes"
636!if $(PERL_VER) >= 56
637!message Perl DLL will be loaded dynamically
638!else
639!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
640!message Reverting to static loading...
641!undef DYNAMIC_PERL
642!endif
643!endif
644
645# Is Perl installed in architecture-specific directories?
646!if exist($(PERL)\Bin\MSWin32-x86)
647PERL_ARCH = \MSWin32-x86
648!endif
649
650PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
651
652# Version-dependent stuff
653!if $(PERL_VER) == 55
654PERL_LIB = $(PERL_INCDIR)\perl.lib
655!else
656PERL_DLL = perl$(PERL_VER).dll
657PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
658!endif
659
660CFLAGS = $(CFLAGS) -DFEAT_PERL
661
662# Do we want to load Perl dynamically?
663!if "$(DYNAMIC_PERL)" == "yes"
664CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
665!undef PERL_LIB
666!endif
667
668PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
669PERL_INC = /I $(PERL_INCDIR)
670PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
671XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
672XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
673
674!endif
675
676#
677# Support Ruby interface
678#
679!ifdef RUBY
680# Set default value
681!ifndef RUBY_VER
682RUBY_VER = 18
683!endif
684!ifndef RUBY_VER_LONG
685RUBY_VER_LONG = 1.8
686!endif
687
688!if $(RUBY_VER) >= 18
689!ifndef RUBY_PLATFORM
690RUBY_PLATFORM = i386-mswin32
691!endif
692!ifndef RUBY_INSTALL_NAME
693RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
694!endif
695!else
696!ifndef RUBY_PLATFORM
697RUBY_PLATFORM = i586-mswin32
698!endif
699!ifndef RUBY_INSTALL_NAME
700RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
701!endif
702!endif # $(RUBY_VER) >= 18
703
704!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
705CFLAGS = $(CFLAGS) -DFEAT_RUBY
706RUBY_OBJ = $(OUTDIR)\if_ruby.obj
707RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
708RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
709# Do we want to load Ruby dynamically?
710!if "$(DYNAMIC_RUBY)" == "yes"
711!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000712CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
713 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000714!undef RUBY_LIB
715!endif
716!endif # RUBY
717
718#
719# Support PostScript printing
720#
721!if "$(POSTSCRIPT)" == "yes"
722CFLAGS = $(CFLAGS) -DMSWINPS
723!endif # POSTSCRIPT
724
725#
726# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
727#
728!if "$(FEATURES)"==""
729FEATURES = BIG
730!endif
731CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
732
733#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000734# Always generate the .pdb file, so that we get debug symbols that can be used
735# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000736# Generate edit-and-continue debug info when no optimization - allows to
737# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000738#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000739CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
740LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000741
742#
743# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000744#
745!message
746
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000747conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000748
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000749PATHDEF_SRC = $(OUTDIR)\pathdef.c
750
Bram Moolenaar071d4272004-06-13 20:20:40 +0000751!IF "$(MAP)" == "yes"
752# "/map" is for debugging
753conflags = $(conflags) /map
754!ELSEIF "$(MAP)" == "lines"
755# "/mapinfo:lines" is for debugging, only works for VC6 and later
756conflags = $(conflags) /map /mapinfo:lines
757!ENDIF
758
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000759LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000760LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000761 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
762 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000763
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000764# Report link time code generation progress if used.
765!ifdef NODEBUG
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000766!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000767!if "$(OPTIMIZE)" != "SPACE"
768LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
769!endif
770!endif
771!endif
772
Bram Moolenaarb6356332005-07-18 21:40:44 +0000773all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
774 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000775
Bram Moolenaarb6356332005-07-18 21:40:44 +0000776$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
777 $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
778 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) version.c version.h
779 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000780 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000781 $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) \
782 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
783 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000784
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000785$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000786
787$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000788 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000789
790install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +0000791 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
792 ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000793 - if exist install.exe del install.exe
794 ren dosinst.exe install.exe
795
796uninstal.exe: uninstal.c
797 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
798
799vimrun.exe: vimrun.c
800 $(CC) /nologo -DNDEBUG vimrun.c
801
802xxd/xxd.exe: xxd/xxd.c
803 cd xxd
804 $(MAKE) /NOLOGO -f Make_mvc.mak
805 cd ..
806
807GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
808 cd GvimExt
809 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
810 cd ..
811
812
813tags: notags
814 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
815
816notags:
817 - if exist tags del tags
818
819clean:
Bram Moolenaar02743632005-07-25 20:42:36 +0000820 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000821 - if exist *.obj del *.obj
822 - if exist $(VIM).exe del $(VIM).exe
823 - if exist $(VIM).ilk del $(VIM).ilk
824 - if exist $(VIM).pdb del $(VIM).pdb
825 - if exist $(VIM).map del $(VIM).map
826 - if exist $(VIM).ncb del $(VIM).ncb
827 - if exist vimrun.exe del vimrun.exe
828 - if exist install.exe del install.exe
829 - if exist uninstal.exe del uninstal.exe
830 - if exist if_perl.c del if_perl.c
831 - if exist dimm.h del dimm.h
832 - if exist dimm_i.c del dimm_i.c
833 - if exist dimm.tlb del dimm.tlb
834 - if exist dosinst.exe del dosinst.exe
835 cd xxd
836 $(MAKE) /NOLOGO -f Make_mvc.mak clean
837 cd ..
838 cd GvimExt
839 $(MAKE) /NOLOGO -f Makefile clean
840 cd ..
841 cd GvimExt
842 $(MAKE) /NOLOGO -f Makefile clean
843 cd ..
844 - if exist testdir\*.out del testdir\*.out
845
846test:
847 cd testdir
848 $(MAKE) /NOLOGO -f Make_dos.mak win32
849 cd ..
850
Bram Moolenaar34114692005-01-02 11:28:13 +0000851testclean:
852 cd testdir
853 $(MAKE) /NOLOGO -f Make_dos.mak clean
854 cd ..
855
Bram Moolenaar071d4272004-06-13 20:20:40 +0000856###########################################################################
857
858# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
859# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000860!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000861.c{$(OUTDIR)/}.obj:
862!ELSE
863.c{$(OUTDIR)/}.obj::
864!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +0000865 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000866
867# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
868# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000869!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000870.cpp{$(OUTDIR)/}.obj:
871!ELSE
872.cpp{$(OUTDIR)/}.obj::
873!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +0000874 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000875
876$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
877
878$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
879
880$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
881
882$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
883
884$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
885
886$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
887
888$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
889
890$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
891
892$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
893
894$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
895
896$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
897
898$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
899
900$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
901
902$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
903
Bram Moolenaar58d98232005-07-23 22:25:46 +0000904$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
905
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000906$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000907
Bram Moolenaar071d4272004-06-13 20:20:40 +0000908$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
909
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000910$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
911
Bram Moolenaar071d4272004-06-13 20:20:40 +0000912$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
913
914$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
915
916if_perl.c : if_perl.xs typemap
Bram Moolenaarb6356332005-07-18 21:40:44 +0000917 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
918 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000919
920$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000921 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000922
923$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000924 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000925
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000926$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000927 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000928 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000929
Bram Moolenaar071d4272004-06-13 20:20:40 +0000930$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000931 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000932
933$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
934
935$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000936 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000937
938$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000939 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000940
941$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000942 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000943
944$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
945
946$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
947
948$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
949
950$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
951
952$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
953
954$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
955
956$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
957
958$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
959
960$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
961
962$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
963
964$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
965
966$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
967
968$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
969
970$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
971
972$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
973
974$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
975
976$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
977
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000978$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
979 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000980
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000981$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +0000982
Bram Moolenaar071d4272004-06-13 20:20:40 +0000983$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
984
985$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
986
987$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
988
989$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
990
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000991$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
992
Bram Moolenaar071d4272004-06-13 20:20:40 +0000993$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
994
995$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
996
997$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
998
999$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1000
1001$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1002
1003$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1004
1005$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001006 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001007
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001008$(OUTDIR)/vim.res: $(OUTDIR) vim.rc version.h tools.bmp tearoff.bmp \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001009 vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001010 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1011
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001012iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001013 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1014 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001015
1016dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001017 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001018
1019$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1020
1021$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1022
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001023# $CFLAGS may contain backslashes and double quotes, escape them both.
1024E0_CFLAGS = $(CFLAGS:\=\\)
1025E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001026# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001027
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001028$(PATHDEF_SRC): auto
1029 @echo creating $(PATHDEF_SRC)
1030 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1031 @echo #include "vim.h" >> $(PATHDEF_SRC)
1032 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1033 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1034 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
1035 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> $(PATHDEF_SRC)
1036 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1037 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001038
1039auto:
1040 if not exist auto/nul mkdir auto
1041
1042# End Custom Build
1043proto.h: \
1044 proto/buffer.pro \
1045 proto/charset.pro \
1046 proto/diff.pro \
1047 proto/digraph.pro \
1048 proto/edit.pro \
1049 proto/eval.pro \
1050 proto/ex_cmds.pro \
1051 proto/ex_cmds2.pro \
1052 proto/ex_docmd.pro \
1053 proto/ex_eval.pro \
1054 proto/ex_getln.pro \
1055 proto/fileio.pro \
1056 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001057 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001058 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001059 proto/main.pro \
1060 proto/mark.pro \
1061 proto/memfile.pro \
1062 proto/memline.pro \
1063 proto/menu.pro \
1064 proto/message.pro \
1065 proto/misc1.pro \
1066 proto/misc2.pro \
1067 proto/move.pro \
1068 proto/mbyte.pro \
1069 proto/normal.pro \
1070 proto/ops.pro \
1071 proto/option.pro \
1072 proto/os_mswin.pro \
1073 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001074 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001075 proto/quickfix.pro \
1076 proto/regexp.pro \
1077 proto/screen.pro \
1078 proto/search.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001079 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001080 proto/syntax.pro \
1081 proto/tag.pro \
1082 proto/term.pro \
1083 proto/ui.pro \
1084 proto/undo.pro \
1085 proto/window.pro \
1086 $(NETBEANS_PRO)
1087
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001088.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001089
1090# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1091# foo.cod"
1092.c.cod:
1093 $(CC) $(CFLAGS) /FAcs $<
1094
1095# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1096.c.i:
1097 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001098
1099
Bram Moolenaar071d4272004-06-13 20:20:40 +00001100# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: