blob: c2567d7c37065a762bba3b0f99e904c8dc2a13e6 [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 Moolenaar071d4272004-06-13 20:20:40 +0000196# Build a retail version by default
197
198!if "$(DEBUG)" != "yes"
199NODEBUG = 1
200!else
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000201!undef NODEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000202MAKEFLAGS_GVIMEXT = DEBUG=yes
203!endif
204
205
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000206# Get all sorts of useful, standard macros from the Platform SDK.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000207
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000208!include <Win32.mak>
Bram Moolenaar071d4272004-06-13 20:20:40 +0000209
Bram Moolenaarc236c162008-07-13 17:41:49 +0000210# Turn on Win64 compatibility warnings for 32-bit compiler in VC8. (/Wp64 is
211# deprecated in VC9.)
212!if ("$(MSVCVER)" == "8.0")
213DEFINES=$(DEFINES) /Wp64
214!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000215
216#>>>>> path of the compiler and linker; name of include and lib directories
217# PATH = c:\msvc20\bin;$(PATH)
218# INCLUDE = c:\msvc20\include
219# LIB = c:\msvc20\lib
220
221!ifndef CTAGS
222CTAGS = ctags
223!endif
224
225!if "$(SNIFF)" == "yes"
226# SNIFF - Include support for SNiFF+.
227SNIFF_INCL = if_sniff.h
228SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
Bram Moolenaarb6356332005-07-18 21:40:44 +0000229SNIFF_LIB = shell32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000230SNIFF_DEFS = -DFEAT_SNIFF
231# The SNiFF integration needs multithreaded libraries!
232MULTITHREADED = yes
233!endif
234
235!ifndef CSCOPE
236CSCOPE = yes
237!endif
238
239!if "$(CSCOPE)" == "yes"
240# CSCOPE - Include support for Cscope
241CSCOPE_INCL = if_cscope.h
242CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
243CSCOPE_DEFS = -DFEAT_CSCOPE
244!endif
245
246!ifndef NETBEANS
247NETBEANS = $(GUI)
248!endif
249
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000250# Only allow NETBEANS and XPM for a GUI build.
251!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000252!if "$(NETBEANS)" == "yes"
253# NETBEANS - Include support for Netbeans integration
254NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000255NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000256NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000257
258!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000259NBDEBUG_DEFS = -DNBDEBUG
260NBDEBUG_INCL = nbdebug.h
261NBDEBUG_SRC = nbdebug.c
262!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000263NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000264!endif
265
266!ifdef XPM
267# XPM - Include support for XPM signs
268# you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
269XPM_OBJ = $(OBJDIR)/xpm_w32.obj
270XPM_DEFS = -DFEAT_XPM_W32
271XPM_LIB = $(XPM)\lib\libXpm.lib
272XPM_INC = -I $(XPM)\include
273!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000274!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000275
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000276# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000277!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000278# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000279# !elseif defined(MULTITHREADED)
280# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000281!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000282# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000283# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000284!endif
285
286# need advapi32.lib for GetUserName()
287# need shell32.lib for ExtractIcon()
288# gdi32.lib and comdlg32.lib for printing support
289# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000290CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
291 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000292!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000293CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
294!endif
295
296### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
297# When set to 0x0500 ":browse" stops working.
298!ifndef WINVER
299WINVER = 0x0400
300!endif
301
302# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
303# default, use these lines.
304#VIMRCLOC = somewhere
305#VIMRUNTIMEDIR = somewhere
306
307CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
308 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
309 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000310 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
311 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000312
313#>>>>> end of choices
314###########################################################################
315
316!ifdef OS
317OS_TYPE = winnt
318DEL_TREE = rmdir /s /q
319!else
320OS_TYPE = win95
321DEL_TREE = deltree /y
322!endif
323
324INTDIR=$(OBJDIR)
325OUTDIR=$(OBJDIR)
326
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000327# Derive version of VC being used from nmake if not specified
328!if "$(MSVCVER)" == ""
329!if "$(_NMAKE_VER)" == ""
330MSVCVER = 4.0
331!endif
332!if "$(_NMAKE_VER)" == "162"
333MSVCVER = 5.0
334!endif
335!if "$(_NMAKE_VER)" == "6.00.8168.0"
336MSVCVER = 6.0
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000337CPU = ix86
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000338!endif
339!if "$(_NMAKE_VER)" == "7.00.9466"
340MSVCVER = 7.0
341!endif
342!if "$(_NMAKE_VER)" == "7.10.3077"
343MSVCVER = 7.1
344!endif
345!if "$(_NMAKE_VER)" == "8.00.50727.42"
346MSVCVER = 8.0
347!endif
348!if "$(_NMAKE_VER)" == "8.00.50727.762"
349MSVCVER = 8.0
350!endif
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000351!if "$(_NMAKE_VER)" == "9.00.20706.01"
352MSVCVER = 9.0
353!endif
Bram Moolenaara7241f52008-06-24 20:39:31 +0000354!if "$(_NMAKE_VER)" == "9.00.21022.08"
355MSVCVER = 9.0
356!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000357!endif
358
359# Abort bulding VIM if version of VC is unrecognised.
360!ifndef MSVCVER
361!message *** ERROR
362!message Cannot determine Visual C version being used. If you are using the
363!message Windows SDK then you must have the environment variable MSVCVER set to
364!message your version of the VC compiler. If you are not using the Express
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000365!message version of Visual C, you can either set MSVCVER or update this makefile
366!message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)".
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000367!error Make aborted.
368!endif
369
Bram Moolenaar071d4272004-06-13 20:20:40 +0000370# Convert processor ID to MVC-compatible number
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000371!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000372!if "$(CPUNR)" == "i386"
373CPUARG = /G3
374!elseif "$(CPUNR)" == "i486"
375CPUARG = /G4
376!elseif "$(CPUNR)" == "i586"
377CPUARG = /G5
378!elseif "$(CPUNR)" == "i686"
379CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000380!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000381CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000382!else
383CPUARG =
384!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000385!else
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000386# VC8/9 only allows specifying SSE architecture
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000387!if "$(CPUNR)" == "pentium4"
388CPUARG = /arch:SSE2
389!endif
390!endif
391
392LIBC =
393DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000394
395!ifdef NODEBUG
396VIM = vim
397!if "$(OPTIMIZE)" == "SPACE"
398OPTFLAG = /O1
399!elseif "$(OPTIMIZE)" == "SPEED"
400OPTFLAG = /O2
401!else # MAXSPEED
402OPTFLAG = /Ox
403!endif
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000404!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000405# Use link time code generation if not worried about size
406!if "$(OPTIMIZE)" != "SPACE"
407OPTFLAG = $(OPTFLAG) /GL
408!endif
409!endif
Bram Moolenaar34114692005-01-02 11:28:13 +0000410CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000411RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000412! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000413CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000414LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000415! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000416LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000417CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000418! endif
419!else # DEBUG
420VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000421! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000422DEBUGINFO = /ZI
423! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000424CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000425RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
426# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000427! if "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000428LIBC =
429! else
430LIBC = /fixed:no
431! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000432! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000433CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000434LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000435! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000436LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000437CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000438! endif
439!endif # DEBUG
440
441INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
442 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
443 $(NBDEBUG_INCL)
444
445OBJ = \
446 $(OUTDIR)\buffer.obj \
447 $(OUTDIR)\charset.obj \
448 $(OUTDIR)\diff.obj \
449 $(OUTDIR)\digraph.obj \
450 $(OUTDIR)\edit.obj \
451 $(OUTDIR)\eval.obj \
452 $(OUTDIR)\ex_cmds.obj \
453 $(OUTDIR)\ex_cmds2.obj \
454 $(OUTDIR)\ex_docmd.obj \
455 $(OUTDIR)\ex_eval.obj \
456 $(OUTDIR)\ex_getln.obj \
457 $(OUTDIR)\fileio.obj \
458 $(OUTDIR)\fold.obj \
459 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000460 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000461 $(OUTDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000462 $(OUTDIR)\main.obj \
463 $(OUTDIR)\mark.obj \
464 $(OUTDIR)\mbyte.obj \
465 $(OUTDIR)\memfile.obj \
466 $(OUTDIR)\memline.obj \
467 $(OUTDIR)\menu.obj \
468 $(OUTDIR)\message.obj \
469 $(OUTDIR)\misc1.obj \
470 $(OUTDIR)\misc2.obj \
471 $(OUTDIR)\move.obj \
472 $(OUTDIR)\normal.obj \
473 $(OUTDIR)\ops.obj \
474 $(OUTDIR)\option.obj \
475 $(OUTDIR)\os_mswin.obj \
476 $(OUTDIR)\os_win32.obj \
477 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000478 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000479 $(OUTDIR)\quickfix.obj \
480 $(OUTDIR)\regexp.obj \
481 $(OUTDIR)\screen.obj \
482 $(OUTDIR)\search.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000483 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000484 $(OUTDIR)\syntax.obj \
485 $(OUTDIR)\tag.obj \
486 $(OUTDIR)\term.obj \
487 $(OUTDIR)\ui.obj \
488 $(OUTDIR)\undo.obj \
489 $(OUTDIR)\window.obj \
490 $(OUTDIR)\vim.res
491
492!if "$(OLE)" == "yes"
493CFLAGS = $(CFLAGS) -DFEAT_OLE
494RCFLAGS = $(RCFLAGS) -DFEAT_OLE
495OLE_OBJ = $(OUTDIR)\if_ole.obj
496OLE_IDL = if_ole.idl
497OLE_LIB = oleaut32.lib
498!endif
499
500!if "$(IME)" == "yes"
501CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
502!ifndef DYNAMIC_IME
503DYNAMIC_IME = yes
504!endif
505!if "$(DYNAMIC_IME)" == "yes"
506CFLAGS = $(CFLAGS) -DDYNAMIC_IME
507!else
508IME_LIB = imm32.lib
509!endif
510!endif
511
512!if "$(GIME)" == "yes"
513CFLAGS = $(CFLAGS) -DGLOBAL_IME
514OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
515MBYTE = yes
516!endif
517
518!if "$(MBYTE)" == "yes"
519CFLAGS = $(CFLAGS) -DFEAT_MBYTE
520!endif
521
522!if "$(GUI)" == "yes"
523SUBSYSTEM = windows
524CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
525RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
526VIM = g$(VIM)
527GUI_INCL = \
528 gui.h \
529 regexp.h \
530 ascii.h \
531 ex_cmds.h \
532 farsi.h \
533 feature.h \
534 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000535 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536 keymap.h \
537 macros.h \
538 option.h \
539 os_dos.h \
540 os_win32.h
541GUI_OBJ = \
542 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000543 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000544 $(OUTDIR)\gui_w32.obj \
545 $(OUTDIR)\os_w32exe.obj
546GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000547 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000548 winspool.lib comctl32.lib advapi32.lib shell32.lib \
549 /machine:$(CPU) /nodefaultlib
550!else
551SUBSYSTEM = console
552!endif
553
554# iconv.dll library (dynamically loaded)
555!ifndef ICONV
556ICONV = yes
557!endif
558!if "$(ICONV)" == "yes"
559CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
560!endif
561
562# libintl.dll library
563!ifndef GETTEXT
564GETTEXT = yes
565!endif
566!if "$(GETTEXT)" == "yes"
567CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
568!endif
569
570# TCL interface
571!ifdef TCL
572!ifndef TCL_VER
573TCL_VER = 83
574TCL_VER_LONG = 8.3
575!endif
576!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
577!if "$(DYNAMIC_TCL)" == "yes"
578!message Tcl DLL will be loaded dynamically
579TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000580CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
581 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000582TCL_OBJ = $(OUTDIR)\if_tcl.obj
583TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
584TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
585!else
586CFLAGS = $(CFLAGS) -DFEAT_TCL
587TCL_OBJ = $(OUTDIR)\if_tcl.obj
588TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
589TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
590!endif
591!endif
592
593# PYTHON interface
594!ifdef PYTHON
595!ifndef PYTHON_VER
596PYTHON_VER = 22
597!endif
598!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
599!if "$(DYNAMIC_PYTHON)" == "yes"
600!message Python DLL will be loaded dynamically
601!endif
602CFLAGS = $(CFLAGS) -DFEAT_PYTHON
603PYTHON_OBJ = $(OUTDIR)\if_python.obj
604PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
605!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000606CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
607 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000608PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
609!else
610PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
611!endif
612!endif
613
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000614# MzScheme interface
615!ifdef MZSCHEME
616!message MzScheme requested - root dir is "$(MZSCHEME)"
617!ifndef MZSCHEME_VER
618MZSCHEME_VER = 205_000
619!endif
620CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000621!if "$(DYNAMIC_MZSCHEME)" == "yes"
622!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000623CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
624 -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" \
625 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000626!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000627MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
628 $(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000629!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000630MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
631!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000632
Bram Moolenaar071d4272004-06-13 20:20:40 +0000633# Perl interface
634!ifdef PERL
635!ifndef PERL_VER
636PERL_VER = 56
637!endif
638!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
639!if "$(DYNAMIC_PERL)" == "yes"
640!if $(PERL_VER) >= 56
641!message Perl DLL will be loaded dynamically
642!else
643!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
644!message Reverting to static loading...
645!undef DYNAMIC_PERL
646!endif
647!endif
648
649# Is Perl installed in architecture-specific directories?
650!if exist($(PERL)\Bin\MSWin32-x86)
651PERL_ARCH = \MSWin32-x86
652!endif
653
654PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
655
656# Version-dependent stuff
657!if $(PERL_VER) == 55
658PERL_LIB = $(PERL_INCDIR)\perl.lib
659!else
660PERL_DLL = perl$(PERL_VER).dll
661PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
662!endif
663
664CFLAGS = $(CFLAGS) -DFEAT_PERL
665
666# Do we want to load Perl dynamically?
667!if "$(DYNAMIC_PERL)" == "yes"
668CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
669!undef PERL_LIB
670!endif
671
672PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
673PERL_INC = /I $(PERL_INCDIR)
674PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
675XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
676XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
677
678!endif
679
680#
681# Support Ruby interface
682#
683!ifdef RUBY
684# Set default value
685!ifndef RUBY_VER
686RUBY_VER = 18
687!endif
688!ifndef RUBY_VER_LONG
689RUBY_VER_LONG = 1.8
690!endif
691
692!if $(RUBY_VER) >= 18
693!ifndef RUBY_PLATFORM
694RUBY_PLATFORM = i386-mswin32
695!endif
696!ifndef RUBY_INSTALL_NAME
697RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
698!endif
699!else
700!ifndef RUBY_PLATFORM
701RUBY_PLATFORM = i586-mswin32
702!endif
703!ifndef RUBY_INSTALL_NAME
704RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
705!endif
706!endif # $(RUBY_VER) >= 18
707
708!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
709CFLAGS = $(CFLAGS) -DFEAT_RUBY
710RUBY_OBJ = $(OUTDIR)\if_ruby.obj
711RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
712RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
713# Do we want to load Ruby dynamically?
714!if "$(DYNAMIC_RUBY)" == "yes"
715!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000716CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
717 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000718!undef RUBY_LIB
719!endif
720!endif # RUBY
721
722#
723# Support PostScript printing
724#
725!if "$(POSTSCRIPT)" == "yes"
726CFLAGS = $(CFLAGS) -DMSWINPS
727!endif # POSTSCRIPT
728
729#
730# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
731#
732!if "$(FEATURES)"==""
733FEATURES = BIG
734!endif
735CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
736
737#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000738# Always generate the .pdb file, so that we get debug symbols that can be used
739# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000740# Generate edit-and-continue debug info when no optimization - allows to
741# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000742#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000743CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
744LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000745
746#
747# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000748#
749!message
750
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000751conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000752
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000753PATHDEF_SRC = $(OUTDIR)\pathdef.c
754
Bram Moolenaar071d4272004-06-13 20:20:40 +0000755!IF "$(MAP)" == "yes"
756# "/map" is for debugging
757conflags = $(conflags) /map
758!ELSEIF "$(MAP)" == "lines"
759# "/mapinfo:lines" is for debugging, only works for VC6 and later
760conflags = $(conflags) /map /mapinfo:lines
761!ENDIF
762
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000763LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000764LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000765 $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
766 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000767
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000768# Report link time code generation progress if used.
769!ifdef NODEBUG
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000770!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000771!if "$(OPTIMIZE)" != "SPACE"
772LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
773!endif
774!endif
775!endif
776
Bram Moolenaarb6356332005-07-18 21:40:44 +0000777all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
778 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000779
Bram Moolenaarb6356332005-07-18 21:40:44 +0000780$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
781 $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
782 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) version.c version.h
783 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000784 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000785 $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) \
786 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
787 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000788
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000789$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000790
791$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000792 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000793
794install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +0000795 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
796 ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000797 - if exist install.exe del install.exe
798 ren dosinst.exe install.exe
799
800uninstal.exe: uninstal.c
801 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
802
803vimrun.exe: vimrun.c
804 $(CC) /nologo -DNDEBUG vimrun.c
805
806xxd/xxd.exe: xxd/xxd.c
807 cd xxd
808 $(MAKE) /NOLOGO -f Make_mvc.mak
809 cd ..
810
811GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
812 cd GvimExt
813 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
814 cd ..
815
816
817tags: notags
818 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
819
820notags:
821 - if exist tags del tags
822
823clean:
Bram Moolenaar02743632005-07-25 20:42:36 +0000824 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000825 - if exist *.obj del *.obj
826 - if exist $(VIM).exe del $(VIM).exe
827 - if exist $(VIM).ilk del $(VIM).ilk
828 - if exist $(VIM).pdb del $(VIM).pdb
829 - if exist $(VIM).map del $(VIM).map
830 - if exist $(VIM).ncb del $(VIM).ncb
831 - if exist vimrun.exe del vimrun.exe
832 - if exist install.exe del install.exe
833 - if exist uninstal.exe del uninstal.exe
834 - if exist if_perl.c del if_perl.c
835 - if exist dimm.h del dimm.h
836 - if exist dimm_i.c del dimm_i.c
837 - if exist dimm.tlb del dimm.tlb
838 - if exist dosinst.exe del dosinst.exe
839 cd xxd
840 $(MAKE) /NOLOGO -f Make_mvc.mak clean
841 cd ..
842 cd GvimExt
843 $(MAKE) /NOLOGO -f Makefile clean
844 cd ..
845 cd GvimExt
846 $(MAKE) /NOLOGO -f Makefile clean
847 cd ..
848 - if exist testdir\*.out del testdir\*.out
849
850test:
851 cd testdir
852 $(MAKE) /NOLOGO -f Make_dos.mak win32
853 cd ..
854
Bram Moolenaar34114692005-01-02 11:28:13 +0000855testclean:
856 cd testdir
857 $(MAKE) /NOLOGO -f Make_dos.mak clean
858 cd ..
859
Bram Moolenaar071d4272004-06-13 20:20:40 +0000860###########################################################################
861
862# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
863# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000864!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000865.c{$(OUTDIR)/}.obj:
866!ELSE
867.c{$(OUTDIR)/}.obj::
868!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +0000869 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000870
871# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
872# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000873!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000874.cpp{$(OUTDIR)/}.obj:
875!ELSE
876.cpp{$(OUTDIR)/}.obj::
877!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +0000878 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +0000879
880$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
881
882$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
883
884$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
885
886$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
887
888$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
889
890$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
891
892$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
893
894$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
895
896$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
897
898$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
899
900$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
901
902$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
903
904$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
905
906$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
907
Bram Moolenaar58d98232005-07-23 22:25:46 +0000908$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
909
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000910$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000911
Bram Moolenaar071d4272004-06-13 20:20:40 +0000912$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
913
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000914$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
915
Bram Moolenaar071d4272004-06-13 20:20:40 +0000916$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
917
918$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
919
920if_perl.c : if_perl.xs typemap
Bram Moolenaarb6356332005-07-18 21:40:44 +0000921 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
922 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000923
924$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000925 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000926
927$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000928 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000929
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000930$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000931 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000932 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000933
Bram Moolenaar071d4272004-06-13 20:20:40 +0000934$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000935 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000936
937$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
938
939$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000940 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000941
942$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000943 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000944
945$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +0000946 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000947
948$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
949
950$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
951
952$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
953
954$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
955
956$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
957
958$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
959
960$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
961
962$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
963
964$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
965
966$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
967
968$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
969
970$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
971
972$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
973
974$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
975
976$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
977
978$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
979
980$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
981
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000982$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
983 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000984
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000985$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +0000986
Bram Moolenaar071d4272004-06-13 20:20:40 +0000987$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
988
989$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
990
991$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
992
993$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
994
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000995$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
996
Bram Moolenaar071d4272004-06-13 20:20:40 +0000997$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
998
999$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1000
1001$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1002
1003$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1004
1005$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1006
1007$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1008
1009$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001010 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001011
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001012$(OUTDIR)/vim.res: $(OUTDIR) vim.rc version.h tools.bmp tearoff.bmp \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001013 vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001014 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1015
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001016iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001017 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1018 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001019
1020dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001021 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001022
1023$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1024
1025$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1026
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001027# $CFLAGS may contain backslashes and double quotes, escape them both.
1028E0_CFLAGS = $(CFLAGS:\=\\)
1029E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001030# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001031
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001032$(PATHDEF_SRC): auto
1033 @echo creating $(PATHDEF_SRC)
1034 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1035 @echo #include "vim.h" >> $(PATHDEF_SRC)
1036 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1037 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1038 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
1039 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> $(PATHDEF_SRC)
1040 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1041 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001042
1043auto:
1044 if not exist auto/nul mkdir auto
1045
1046# End Custom Build
1047proto.h: \
1048 proto/buffer.pro \
1049 proto/charset.pro \
1050 proto/diff.pro \
1051 proto/digraph.pro \
1052 proto/edit.pro \
1053 proto/eval.pro \
1054 proto/ex_cmds.pro \
1055 proto/ex_cmds2.pro \
1056 proto/ex_docmd.pro \
1057 proto/ex_eval.pro \
1058 proto/ex_getln.pro \
1059 proto/fileio.pro \
1060 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001061 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001062 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001063 proto/main.pro \
1064 proto/mark.pro \
1065 proto/memfile.pro \
1066 proto/memline.pro \
1067 proto/menu.pro \
1068 proto/message.pro \
1069 proto/misc1.pro \
1070 proto/misc2.pro \
1071 proto/move.pro \
1072 proto/mbyte.pro \
1073 proto/normal.pro \
1074 proto/ops.pro \
1075 proto/option.pro \
1076 proto/os_mswin.pro \
1077 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001078 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001079 proto/quickfix.pro \
1080 proto/regexp.pro \
1081 proto/screen.pro \
1082 proto/search.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001083 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001084 proto/syntax.pro \
1085 proto/tag.pro \
1086 proto/term.pro \
1087 proto/ui.pro \
1088 proto/undo.pro \
1089 proto/window.pro \
1090 $(NETBEANS_PRO)
1091
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001092.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001093
1094# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1095# foo.cod"
1096.c.cod:
1097 $(CC) $(CFLAGS) /FAcs $<
1098
1099# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1100.c.i:
1101 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001102
1103
Bram Moolenaar071d4272004-06-13 20:20:40 +00001104# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: