blob: 4dcbd90af2a368b8aa66c067d48fcf5d2963f2ff [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 Moolenaarbd5e15f2010-07-17 21:19:38 +020055# Python3 interface:
56# PYTHON3=[Path to Python3 directory]
57# DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
58# PYTHON3_VER=[Python3 version, eg 30, 31] (default is 31)
59#
Bram Moolenaar071d4272004-06-13 20:20:40 +000060# Ruby interface:
61# RUBY=[Path to Ruby directory]
62# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
63# RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
64# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
65# You must set RUBY_VER_LONG when change RUBY_VER.
Bram Moolenaarda3cb832012-08-02 21:21:47 +020066# You must set RUBY_API_VER to RUBY_VER_LONG.
67# Don't set ruby API version to RUBY_VER like 191.
Bram Moolenaar7887d882005-07-01 22:33:52 +000068#
Bram Moolenaar071d4272004-06-13 20:20:40 +000069# Tcl interface:
70# TCL=[Path to Tcl directory]
71# DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
72# TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
73# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
74# You must set TCL_VER_LONG when you set TCL_VER.
Bram Moolenaar7887d882005-07-01 22:33:52 +000075#
76# SNiFF+ interface: SNIFF=yes
77#
78# Cscope support: CSCOPE=yes
79#
80# Iconv library support (always dynamically loaded):
81# ICONV=[yes or no] (default is yes)
82#
83# Intl library support (always dynamically loaded):
84# GETTEXT=[yes or no] (default is yes)
85# See http://sourceforge.net/projects/gettext/
86#
87# PostScript printing: POSTSCRIPT=yes (default is no)
88#
89# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
90#
91# XPM Image Support: XPM=[path to XPM directory]
92#
93# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
94#
95# Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
96# i386)
97#
98# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
99#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000100# Debug version: DEBUG=yes
101# Mapfile: MAP=[no, yes or lines] (default is yes)
102# no: Don't write a mapfile.
103# yes: Write a normal mapfile.
104# lines: Write a mapfile with line numbers (only for VC6 and later)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000105#
106# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
107# doesn't work)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000108#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000109# Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
110#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000111# You can combine any of these interfaces
112#
113# Example: To build the non-debug, GUI version with Perl interface:
114# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
115#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116# DEBUG with Make_mvc.mak and Make_dvc.mak:
117# This makefile gives a fineness of control which is not supported in
118# Visual C++ configuration files. Therefore, debugging requires a bit of
119# extra work.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000120# Make_dvc.mak is a Visual C++ project to access that support. It may be
121# badly out of date for the Visual C++ you are using...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000122# To use Make_dvc.mak:
123# 1) Build Vim with Make_mvc.mak.
124# Use a "DEBUG=yes" argument to build Vim with debug support.
125# E.g. the following builds gvimd.exe:
126# nmake -f Make_mvc.mak debug=yes gui=yes
127# 2) Use MS Devstudio and set it up to allow that file to be debugged:
128# i) Pass Make_dvc.mak to the IDE.
129# Use the "open workspace" menu entry to load Make_dvc.mak.
130# Alternatively, from the command line:
131# msdev /nologo Make_dvc.mak
132# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
133# this and offer to convert it to their own format. Accept that.
134# It creates a file called Make_dvc.dsw which can then be used
135# for further operations. E.g.
136# msdev /nologo Make_dvc.dsw
137# ii) Set the built executable for debugging:
138# a) Alt+F7/Debug takes you to the Debug dialog.
139# b) Fill "Executable for debug session". e.g. gvimd.exe
140# c) Fill "Program arguments". e.g. -R dosinst.c
141# d) Complete the dialog
142# 3) You can now debug the executable you built with Make_mvc.mak
143#
144# Note: Make_dvc.mak builds vimrun.exe, because it must build something
145# to be a valid makefile..
146
147### See feature.h for a list of optionals.
148# If you want to build some optional features without modifying the source,
149# you can set DEFINES on the command line, e.g.,
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000150# nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000151
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000152# Build on both Windows NT/XP and Windows 9x
Bram Moolenaar071d4272004-06-13 20:20:40 +0000153
154TARGETOS = BOTH
155
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000156# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
157# interfaces.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000158# If you change something else, do "make clean" first!
159!if "$(GUI)" == "yes"
160OBJDIR = .\ObjG
161!else
162OBJDIR = .\ObjC
163!endif
164!if "$(OLE)" == "yes"
165OBJDIR = $(OBJDIR)O
166!endif
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200167!ifdef LUA
168OBJDIR = $(OBJDIR)U
169!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000170!ifdef PERL
171OBJDIR = $(OBJDIR)L
172!endif
173!ifdef PYTHON
174OBJDIR = $(OBJDIR)Y
175!endif
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200176!ifdef PYTHON3
177OBJDIR = $(OBJDIR)H
178!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000179!ifdef TCL
180OBJDIR = $(OBJDIR)T
181!endif
182!ifdef RUBY
183OBJDIR = $(OBJDIR)R
184!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000185!ifdef MZSCHEME
186OBJDIR = $(OBJDIR)Z
187!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000188!if "$(DEBUG)" == "yes"
189OBJDIR = $(OBJDIR)d
190!endif
191
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000192# Win32.mak requires that CPU be set appropriately.
193# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000194
195!ifdef PROCESSOR_ARCHITECTURE
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000196# We're on Windows NT or using VC 6+
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000197! ifdef CPU
198ASSEMBLY_ARCHITECTURE=$(CPU)
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000199# Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7.
200! if ("$(ASSEMBLY_ARCHITECTURE)" == "i386") || ("$(ASSEMBLY_ARCHITECTURE)" == "I386")
201ASSEMBLY_ARCHITECTURE = x86
202! endif
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000203! else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000204CPU = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000205ASSEMBLY_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000206! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000207CPU = i386
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000208! endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000209! endif
210!else # !PROCESSOR_ARCHITECTURE
211# We're on Windows 95
212CPU = i386
213!endif # !PROCESSOR_ARCHITECTURE
214
Bram Moolenaar071d4272004-06-13 20:20:40 +0000215# Build a retail version by default
216
217!if "$(DEBUG)" != "yes"
218NODEBUG = 1
219!else
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000220!undef NODEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000221MAKEFLAGS_GVIMEXT = DEBUG=yes
222!endif
223
224
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000225# Get all sorts of useful, standard macros from the Platform SDK.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000226
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000227!include <Win32.mak>
Bram Moolenaar071d4272004-06-13 20:20:40 +0000228
Bram Moolenaar8cd213c2010-06-01 21:57:09 +0200229# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200230WP64CHECK = /Wp64
Bram Moolenaar071d4272004-06-13 20:20:40 +0000231
232#>>>>> path of the compiler and linker; name of include and lib directories
233# PATH = c:\msvc20\bin;$(PATH)
234# INCLUDE = c:\msvc20\include
235# LIB = c:\msvc20\lib
236
237!ifndef CTAGS
238CTAGS = ctags
239!endif
240
241!if "$(SNIFF)" == "yes"
242# SNIFF - Include support for SNiFF+.
243SNIFF_INCL = if_sniff.h
244SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
Bram Moolenaarb6356332005-07-18 21:40:44 +0000245SNIFF_LIB = shell32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000246SNIFF_DEFS = -DFEAT_SNIFF
247# The SNiFF integration needs multithreaded libraries!
248MULTITHREADED = yes
249!endif
250
251!ifndef CSCOPE
252CSCOPE = yes
253!endif
254
255!if "$(CSCOPE)" == "yes"
256# CSCOPE - Include support for Cscope
257CSCOPE_INCL = if_cscope.h
258CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
259CSCOPE_DEFS = -DFEAT_CSCOPE
260!endif
261
262!ifndef NETBEANS
263NETBEANS = $(GUI)
264!endif
265
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000266# Only allow NETBEANS and XPM for a GUI build.
267!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000268!if "$(NETBEANS)" == "yes"
269# NETBEANS - Include support for Netbeans integration
270NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000271NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000272NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000273
274!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000275NBDEBUG_DEFS = -DNBDEBUG
276NBDEBUG_INCL = nbdebug.h
277NBDEBUG_SRC = nbdebug.c
278!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000279NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000280!endif
281
282!ifdef XPM
283# XPM - Include support for XPM signs
Bram Moolenaare66822e2012-08-02 21:48:24 +0200284# You need to download or build xpm.lib somehow.
285# You can get the most recent version of libXpm-*.zip from
286# http://cgit.freedesktop.org/xorg/lib/libXpm
287# from which you must build xpm.lib yourself
288# OR get and unpack: ftp://ftp.vim.org/pub/vim/pcextra/xpm.zip
Bram Moolenaar071d4272004-06-13 20:20:40 +0000289XPM_OBJ = $(OBJDIR)/xpm_w32.obj
290XPM_DEFS = -DFEAT_XPM_W32
291XPM_LIB = $(XPM)\lib\libXpm.lib
292XPM_INC = -I $(XPM)\include
293!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000294!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000295
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000296# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000297!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000298# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000299# !elseif defined(MULTITHREADED)
300# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000301!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000302# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000303# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000304!endif
305
306# need advapi32.lib for GetUserName()
307# need shell32.lib for ExtractIcon()
308# gdi32.lib and comdlg32.lib for printing support
309# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000310CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
311 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000312!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000313CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
314!endif
315
316### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
317# When set to 0x0500 ":browse" stops working.
318!ifndef WINVER
319WINVER = 0x0400
320!endif
321
322# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
323# default, use these lines.
324#VIMRCLOC = somewhere
325#VIMRUNTIMEDIR = somewhere
326
327CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
328 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
329 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000330 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
331 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000332
333#>>>>> end of choices
334###########################################################################
335
336!ifdef OS
337OS_TYPE = winnt
338DEL_TREE = rmdir /s /q
339!else
340OS_TYPE = win95
341DEL_TREE = deltree /y
342!endif
343
344INTDIR=$(OBJDIR)
345OUTDIR=$(OBJDIR)
346
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000347# Derive version of VC being used from nmake if not specified
348!if "$(MSVCVER)" == ""
349!if "$(_NMAKE_VER)" == ""
350MSVCVER = 4.0
351!endif
352!if "$(_NMAKE_VER)" == "162"
353MSVCVER = 5.0
354!endif
355!if "$(_NMAKE_VER)" == "6.00.8168.0"
356MSVCVER = 6.0
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000357CPU = ix86
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000358!endif
359!if "$(_NMAKE_VER)" == "7.00.9466"
360MSVCVER = 7.0
361!endif
362!if "$(_NMAKE_VER)" == "7.10.3077"
363MSVCVER = 7.1
364!endif
365!if "$(_NMAKE_VER)" == "8.00.50727.42"
366MSVCVER = 8.0
367!endif
368!if "$(_NMAKE_VER)" == "8.00.50727.762"
369MSVCVER = 8.0
370!endif
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000371!if "$(_NMAKE_VER)" == "9.00.20706.01"
372MSVCVER = 9.0
373!endif
Bram Moolenaara7241f52008-06-24 20:39:31 +0000374!if "$(_NMAKE_VER)" == "9.00.21022.08"
375MSVCVER = 9.0
376!endif
Bram Moolenaar13658312009-02-04 17:35:52 +0000377!if "$(_NMAKE_VER)" == "9.00.30729.01"
378MSVCVER = 9.0
379!endif
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000380!if "$(_NMAKE_VER)" == "10.00.20506.01"
381MSVCVER = 10.0
382!endif
Bram Moolenaar2498b3a2010-03-02 17:59:44 +0100383!if "$(_NMAKE_VER)" == "10.00.30128.01"
384MSVCVER = 10.0
385!endif
Bram Moolenaar218116c2010-05-20 21:46:00 +0200386!if "$(_NMAKE_VER)" == "10.00.30319.01"
387MSVCVER = 10.0
388!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000389!endif
390
391# Abort bulding VIM if version of VC is unrecognised.
392!ifndef MSVCVER
393!message *** ERROR
394!message Cannot determine Visual C version being used. If you are using the
395!message Windows SDK then you must have the environment variable MSVCVER set to
396!message your version of the VC compiler. If you are not using the Express
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000397!message version of Visual C, you can either set MSVCVER or update this makefile
398!message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)".
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000399!error Make aborted.
400!endif
401
Bram Moolenaar071d4272004-06-13 20:20:40 +0000402# Convert processor ID to MVC-compatible number
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000403!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000404!if "$(CPUNR)" == "i386"
405CPUARG = /G3
406!elseif "$(CPUNR)" == "i486"
407CPUARG = /G4
408!elseif "$(CPUNR)" == "i586"
409CPUARG = /G5
410!elseif "$(CPUNR)" == "i686"
411CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000412!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000413CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000414!else
415CPUARG =
416!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000417!else
Bram Moolenaar3ed16dc2011-06-12 20:31:31 +0200418# VC8/9/10 only allows specifying SSE architecture but only for 32bit
419!if "$(ASSEMBLY_ARCHITECTURE)" == "x86" && "$(CPUNR)" == "pentium4"
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000420CPUARG = /arch:SSE2
421!endif
422!endif
423
424LIBC =
425DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000426
427!ifdef NODEBUG
428VIM = vim
429!if "$(OPTIMIZE)" == "SPACE"
430OPTFLAG = /O1
431!elseif "$(OPTIMIZE)" == "SPEED"
432OPTFLAG = /O2
433!else # MAXSPEED
434OPTFLAG = /Ox
435!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200436
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000437!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000438# Use link time code generation if not worried about size
439!if "$(OPTIMIZE)" != "SPACE"
440OPTFLAG = $(OPTFLAG) /GL
441!endif
442!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200443
444# (/Wp64 is deprecated in VC9 and generates an obnoxious warning.)
445!if ("$(MSVCVER)" == "7.0") || ("$(MSVCVER)" == "7.1") || ("$(MSVCVER)" == "8.0")
446CFLAGS=$(CFLAGS) $(WP64CHECK)
447!endif
448
Bram Moolenaar34114692005-01-02 11:28:13 +0000449CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000450RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000451! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000452CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000453LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000454! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000455LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000456CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000457! endif
458!else # DEBUG
459VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000460! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000461DEBUGINFO = /ZI
462! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000463CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000464RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
465# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000466! if "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000467LIBC =
468! else
469LIBC = /fixed:no
470! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000471! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000472CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000473LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000474! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000475LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000476CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000477! endif
478!endif # DEBUG
479
480INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
481 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
482 $(NBDEBUG_INCL)
483
484OBJ = \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200485 $(OUTDIR)\blowfish.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000486 $(OUTDIR)\buffer.obj \
487 $(OUTDIR)\charset.obj \
488 $(OUTDIR)\diff.obj \
489 $(OUTDIR)\digraph.obj \
490 $(OUTDIR)\edit.obj \
491 $(OUTDIR)\eval.obj \
492 $(OUTDIR)\ex_cmds.obj \
493 $(OUTDIR)\ex_cmds2.obj \
494 $(OUTDIR)\ex_docmd.obj \
495 $(OUTDIR)\ex_eval.obj \
496 $(OUTDIR)\ex_getln.obj \
497 $(OUTDIR)\fileio.obj \
498 $(OUTDIR)\fold.obj \
499 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000500 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000501 $(OUTDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000502 $(OUTDIR)\main.obj \
503 $(OUTDIR)\mark.obj \
504 $(OUTDIR)\mbyte.obj \
505 $(OUTDIR)\memfile.obj \
506 $(OUTDIR)\memline.obj \
507 $(OUTDIR)\menu.obj \
508 $(OUTDIR)\message.obj \
509 $(OUTDIR)\misc1.obj \
510 $(OUTDIR)\misc2.obj \
511 $(OUTDIR)\move.obj \
512 $(OUTDIR)\normal.obj \
513 $(OUTDIR)\ops.obj \
514 $(OUTDIR)\option.obj \
515 $(OUTDIR)\os_mswin.obj \
516 $(OUTDIR)\os_win32.obj \
517 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000518 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000519 $(OUTDIR)\quickfix.obj \
520 $(OUTDIR)\regexp.obj \
521 $(OUTDIR)\screen.obj \
522 $(OUTDIR)\search.obj \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200523 $(OUTDIR)\sha256.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000524 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000525 $(OUTDIR)\syntax.obj \
526 $(OUTDIR)\tag.obj \
527 $(OUTDIR)\term.obj \
528 $(OUTDIR)\ui.obj \
529 $(OUTDIR)\undo.obj \
530 $(OUTDIR)\window.obj \
531 $(OUTDIR)\vim.res
532
533!if "$(OLE)" == "yes"
534CFLAGS = $(CFLAGS) -DFEAT_OLE
535RCFLAGS = $(RCFLAGS) -DFEAT_OLE
536OLE_OBJ = $(OUTDIR)\if_ole.obj
537OLE_IDL = if_ole.idl
538OLE_LIB = oleaut32.lib
539!endif
540
541!if "$(IME)" == "yes"
542CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
543!ifndef DYNAMIC_IME
544DYNAMIC_IME = yes
545!endif
546!if "$(DYNAMIC_IME)" == "yes"
547CFLAGS = $(CFLAGS) -DDYNAMIC_IME
548!else
549IME_LIB = imm32.lib
550!endif
551!endif
552
553!if "$(GIME)" == "yes"
554CFLAGS = $(CFLAGS) -DGLOBAL_IME
555OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
556MBYTE = yes
557!endif
558
559!if "$(MBYTE)" == "yes"
560CFLAGS = $(CFLAGS) -DFEAT_MBYTE
561!endif
562
563!if "$(GUI)" == "yes"
564SUBSYSTEM = windows
565CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
566RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
567VIM = g$(VIM)
568GUI_INCL = \
569 gui.h \
570 regexp.h \
571 ascii.h \
572 ex_cmds.h \
573 farsi.h \
574 feature.h \
575 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000576 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000577 keymap.h \
578 macros.h \
579 option.h \
580 os_dos.h \
581 os_win32.h
582GUI_OBJ = \
583 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000584 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000585 $(OUTDIR)\gui_w32.obj \
586 $(OUTDIR)\os_w32exe.obj
587GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000588 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000589 winspool.lib comctl32.lib advapi32.lib shell32.lib \
590 /machine:$(CPU) /nodefaultlib
591!else
592SUBSYSTEM = console
593!endif
594
595# iconv.dll library (dynamically loaded)
596!ifndef ICONV
597ICONV = yes
598!endif
599!if "$(ICONV)" == "yes"
600CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
601!endif
602
603# libintl.dll library
604!ifndef GETTEXT
605GETTEXT = yes
606!endif
607!if "$(GETTEXT)" == "yes"
608CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
609!endif
610
611# TCL interface
612!ifdef TCL
613!ifndef TCL_VER
614TCL_VER = 83
615TCL_VER_LONG = 8.3
616!endif
617!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
618!if "$(DYNAMIC_TCL)" == "yes"
619!message Tcl DLL will be loaded dynamically
620TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000621CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
622 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000623TCL_OBJ = $(OUTDIR)\if_tcl.obj
624TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
Bram Moolenaar84a4c332012-02-22 16:01:56 +0100625TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000626!else
627CFLAGS = $(CFLAGS) -DFEAT_TCL
628TCL_OBJ = $(OUTDIR)\if_tcl.obj
629TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
630TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
631!endif
632!endif
633
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200634# Lua interface
635!ifdef LUA
636!ifndef LUA_VER
637LUA_VER = 51
638!endif
639!message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)"
640!if "$(DYNAMIC_LUA)" == "yes"
641!message Lua DLL will be loaded dynamically
642!endif
643CFLAGS = $(CFLAGS) -DFEAT_LUA
644LUA_OBJ = $(OUTDIR)\if_lua.obj
645LUA_INC = /I "$(LUA)\include" /I "$(LUA)"
646!if "$(DYNAMIC_LUA)" == "yes"
647CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \
648 -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
649LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib
650!else
651LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib"
652!endif
653!endif
654
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200655!ifdef PYTHON
656!ifdef PYTHON3
657DYNAMIC_PYTHON=yes
658DYNAMIC_PYTHON3=yes
659!endif
660!endif
661
Bram Moolenaar071d4272004-06-13 20:20:40 +0000662# PYTHON interface
663!ifdef PYTHON
664!ifndef PYTHON_VER
665PYTHON_VER = 22
666!endif
667!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
668!if "$(DYNAMIC_PYTHON)" == "yes"
669!message Python DLL will be loaded dynamically
670!endif
671CFLAGS = $(CFLAGS) -DFEAT_PYTHON
672PYTHON_OBJ = $(OUTDIR)\if_python.obj
673PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
674!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000675CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
676 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000677PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
678!else
679PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
680!endif
681!endif
682
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200683# PYTHON3 interface
684!ifdef PYTHON3
685!ifndef PYTHON3_VER
686PYTHON3_VER = 31
687!endif
688!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
689!if "$(DYNAMIC_PYTHON3)" == "yes"
690!message Python3 DLL will be loaded dynamically
691!endif
692CFLAGS = $(CFLAGS) -DFEAT_PYTHON3
693PYTHON3_OBJ = $(OUTDIR)\if_python3.obj
694PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC"
695!if "$(DYNAMIC_PYTHON3)" == "yes"
696CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \
697 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
698PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib
699!else
700PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
701!endif
702!endif
703
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000704# MzScheme interface
705!ifdef MZSCHEME
706!message MzScheme requested - root dir is "$(MZSCHEME)"
707!ifndef MZSCHEME_VER
708MZSCHEME_VER = 205_000
709!endif
710CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100711!if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \
712 || EXIST("$(MZSCHEME)\collects\scheme\base.rkt")
713# for MzScheme >= 4 we need to include byte code for basic Scheme stuff
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000714MZSCHEME_EXTRA_DEP = mzscheme_base.c
715CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
716!endif
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100717!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib")
718MZSCHEME_MAIN_LIB=mzsch
719!else
720MZSCHEME_MAIN_LIB=racket
721!endif
722!if EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000723 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
724!message Building with Precise GC
725MZSCHEME_PRECISE_GC = yes
726CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
727!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000728!if "$(DYNAMIC_MZSCHEME)" == "yes"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000729!if "$(MZSCHEME_PRECISE_GC)" == "yes"
730!error MzScheme with Precise GC cannot be loaded dynamically
731!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000732!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000733CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100734 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000735 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000736!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000737!if "$(MZSCHEME_DEBUG)" == "yes"
738CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
739!endif
740!if "$(MZSCHEME_PRECISE_GC)" == "yes"
741# Precise GC does not use separate dll
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100742MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000743!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000744MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100745 $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000746!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000747!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000748MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
Bram Moolenaarbbc98db2012-02-12 01:55:55 +0100749# increase stack size
750MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000751!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000752
Bram Moolenaar071d4272004-06-13 20:20:40 +0000753# Perl interface
754!ifdef PERL
755!ifndef PERL_VER
756PERL_VER = 56
757!endif
758!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
759!if "$(DYNAMIC_PERL)" == "yes"
760!if $(PERL_VER) >= 56
761!message Perl DLL will be loaded dynamically
762!else
763!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
764!message Reverting to static loading...
765!undef DYNAMIC_PERL
766!endif
767!endif
768
769# Is Perl installed in architecture-specific directories?
770!if exist($(PERL)\Bin\MSWin32-x86)
771PERL_ARCH = \MSWin32-x86
772!endif
773
774PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
775
776# Version-dependent stuff
777!if $(PERL_VER) == 55
778PERL_LIB = $(PERL_INCDIR)\perl.lib
779!else
780PERL_DLL = perl$(PERL_VER).dll
781PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
782!endif
783
784CFLAGS = $(CFLAGS) -DFEAT_PERL
785
786# Do we want to load Perl dynamically?
787!if "$(DYNAMIC_PERL)" == "yes"
788CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
789!undef PERL_LIB
790!endif
791
792PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
793PERL_INC = /I $(PERL_INCDIR)
794PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
795XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
Bram Moolenaar52f83172011-09-14 19:01:42 +0200796!if exist($(XSUBPP))
Bram Moolenaar612af432011-09-14 10:49:46 +0200797XSUBPP = $(PERL_EXE) $(XSUBPP)
798!else
799XSUBPP = xsubpp
800!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000801XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
802
803!endif
804
805#
806# Support Ruby interface
807#
808!ifdef RUBY
809# Set default value
810!ifndef RUBY_VER
811RUBY_VER = 18
812!endif
813!ifndef RUBY_VER_LONG
814RUBY_VER_LONG = 1.8
815!endif
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200816!ifndef RUBY_API_VER
817RUBY_API_VER = $(RUBY_VER_LONG:.=)
818!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000819
820!if $(RUBY_VER) >= 18
821!ifndef RUBY_PLATFORM
822RUBY_PLATFORM = i386-mswin32
823!endif
824!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200825RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000826!endif
827!else
828!ifndef RUBY_PLATFORM
829RUBY_PLATFORM = i586-mswin32
830!endif
831!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200832RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000833!endif
834!endif # $(RUBY_VER) >= 18
835
836!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
837CFLAGS = $(CFLAGS) -DFEAT_RUBY
838RUBY_OBJ = $(OUTDIR)\if_ruby.obj
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200839!if $(RUBY_VER) >= 19
840RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)" /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
Bram Moolenaar69154f22010-07-18 21:42:34 +0200841!else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000842RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
Bram Moolenaar69154f22010-07-18 21:42:34 +0200843!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000844RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
845# Do we want to load Ruby dynamically?
846!if "$(DYNAMIC_RUBY)" == "yes"
847!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000848CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
849 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000850!undef RUBY_LIB
851!endif
852!endif # RUBY
853
854#
855# Support PostScript printing
856#
857!if "$(POSTSCRIPT)" == "yes"
858CFLAGS = $(CFLAGS) -DMSWINPS
859!endif # POSTSCRIPT
860
861#
862# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
863#
864!if "$(FEATURES)"==""
865FEATURES = BIG
866!endif
867CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
868
869#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000870# Always generate the .pdb file, so that we get debug symbols that can be used
871# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000872# Generate edit-and-continue debug info when no optimization - allows to
873# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000874#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000875CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
876LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000877
878#
879# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000880#
881!message
882
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000883conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000884
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000885PATHDEF_SRC = $(OUTDIR)\pathdef.c
886
Bram Moolenaar071d4272004-06-13 20:20:40 +0000887!IF "$(MAP)" == "yes"
888# "/map" is for debugging
889conflags = $(conflags) /map
890!ELSEIF "$(MAP)" == "lines"
891# "/mapinfo:lines" is for debugging, only works for VC6 and later
892conflags = $(conflags) /map /mapinfo:lines
893!ENDIF
894
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000895LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000896LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200897 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000898 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000899
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000900# Report link time code generation progress if used.
901!ifdef NODEBUG
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000902!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000903!if "$(OPTIMIZE)" != "SPACE"
904LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
905!endif
906!endif
907!endif
908
Bram Moolenaarb6356332005-07-18 21:40:44 +0000909all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
910 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000911
Bram Moolenaarb6356332005-07-18 21:40:44 +0000912$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200913 $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200914 $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
915 version.c version.h
Bram Moolenaarb6356332005-07-18 21:40:44 +0000916 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000917 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200918 $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000919 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
920 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000921
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000922$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000923
924$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000925 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000926
927install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +0000928 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +0200929 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000930 - if exist install.exe del install.exe
931 ren dosinst.exe install.exe
932
933uninstal.exe: uninstal.c
934 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
935
936vimrun.exe: vimrun.c
937 $(CC) /nologo -DNDEBUG vimrun.c
938
939xxd/xxd.exe: xxd/xxd.c
940 cd xxd
941 $(MAKE) /NOLOGO -f Make_mvc.mak
942 cd ..
943
944GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
945 cd GvimExt
946 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
947 cd ..
948
949
950tags: notags
951 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
952
953notags:
954 - if exist tags del tags
955
956clean:
Bram Moolenaar02743632005-07-25 20:42:36 +0000957 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000958 - if exist *.obj del *.obj
959 - if exist $(VIM).exe del $(VIM).exe
960 - if exist $(VIM).ilk del $(VIM).ilk
961 - if exist $(VIM).pdb del $(VIM).pdb
962 - if exist $(VIM).map del $(VIM).map
963 - if exist $(VIM).ncb del $(VIM).ncb
964 - if exist vimrun.exe del vimrun.exe
965 - if exist install.exe del install.exe
966 - if exist uninstal.exe del uninstal.exe
967 - if exist if_perl.c del if_perl.c
968 - if exist dimm.h del dimm.h
969 - if exist dimm_i.c del dimm_i.c
970 - if exist dimm.tlb del dimm.tlb
971 - if exist dosinst.exe del dosinst.exe
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000972 - if exist mzscheme_base.c del mzscheme_base.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000973 cd xxd
974 $(MAKE) /NOLOGO -f Make_mvc.mak clean
975 cd ..
976 cd GvimExt
977 $(MAKE) /NOLOGO -f Makefile clean
978 cd ..
979 cd GvimExt
980 $(MAKE) /NOLOGO -f Makefile clean
981 cd ..
982 - if exist testdir\*.out del testdir\*.out
983
984test:
985 cd testdir
986 $(MAKE) /NOLOGO -f Make_dos.mak win32
987 cd ..
988
Bram Moolenaar34114692005-01-02 11:28:13 +0000989testclean:
990 cd testdir
991 $(MAKE) /NOLOGO -f Make_dos.mak clean
992 cd ..
993
Bram Moolenaar071d4272004-06-13 20:20:40 +0000994###########################################################################
995
996# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
997# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000998!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000999.c{$(OUTDIR)/}.obj:
1000!ELSE
1001.c{$(OUTDIR)/}.obj::
1002!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001003 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001004
1005# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
1006# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001007!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001008.cpp{$(OUTDIR)/}.obj:
1009!ELSE
1010.cpp{$(OUTDIR)/}.obj::
1011!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001012 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001013
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001014$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
1015
Bram Moolenaaredac1852010-05-18 20:34:20 +02001016$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001017
Bram Moolenaar071d4272004-06-13 20:20:40 +00001018$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
1019
1020$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
1021
1022$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
1023
1024$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
1025
1026$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
1027
1028$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
1029
1030$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
1031
1032$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
1033
1034$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
1035
1036$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
1037
1038$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
1039
1040$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
1041
1042$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
1043
Bram Moolenaar58d98232005-07-23 22:25:46 +00001044$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
1045
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001046$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +00001047
Bram Moolenaar071d4272004-06-13 20:20:40 +00001048$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
1049
Bram Moolenaar52b4b552005-03-07 23:00:57 +00001050$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
1051
Bram Moolenaar071d4272004-06-13 20:20:40 +00001052$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
1053
1054$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
1055
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001056$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
1057 $(CC) $(CFLAGS) $(LUA_INC) if_lua.c
1058
Bram Moolenaar071d4272004-06-13 20:20:40 +00001059if_perl.c : if_perl.xs typemap
Bram Moolenaar612af432011-09-14 10:49:46 +02001060 $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001061 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001062
1063$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001064 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001065
1066$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001067 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001068
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001069$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +00001070 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001071 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001072mzscheme_base.c:
1073 $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001074
Bram Moolenaar071d4272004-06-13 20:20:40 +00001075$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001076 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001077
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001078$(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c $(INCL)
1079 $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c
1080
Bram Moolenaar071d4272004-06-13 20:20:40 +00001081$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
1082
1083$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001084 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001085
1086$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001087 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001088
1089$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001090 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001091
1092$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
1093
1094$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
1095
1096$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
1097
1098$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1099
1100$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1101
1102$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1103
1104$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1105
1106$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1107
1108$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1109
1110$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1111
1112$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1113
1114$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1115
1116$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1117
1118$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1119
1120$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1121
1122$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1123
1124$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1125
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001126$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1127 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001128
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001129$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001130
Bram Moolenaar071d4272004-06-13 20:20:40 +00001131$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1132
1133$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
1134
1135$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1136
1137$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1138
Bram Moolenaaredac1852010-05-18 20:34:20 +02001139$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1140
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001141$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1142
Bram Moolenaar071d4272004-06-13 20:20:40 +00001143$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1144
1145$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1146
1147$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1148
1149$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1150
1151$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1152
1153$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1154
1155$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001156 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001157
Bram Moolenaarcc448b32010-07-14 16:52:17 +02001158$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
1159 tearoff.bmp vim.ico vim_error.ico \
1160 vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001161 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1162
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001163iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001164 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1165 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001166
1167dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001168 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001169
1170$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1171
1172$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1173
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001174# $CFLAGS may contain backslashes and double quotes, escape them both.
1175E0_CFLAGS = $(CFLAGS:\=\\)
1176E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001177# ") stop the string
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001178# $LINKARGS2 may contain backslashes and double quotes, escape them both.
1179E0_LINKARGS2 = $(LINKARGS2:\=\\)
1180E_LINKARGS2 = $(E0_LINKARGS2:"=\")
1181# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001182
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001183$(PATHDEF_SRC): auto
1184 @echo creating $(PATHDEF_SRC)
1185 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1186 @echo #include "vim.h" >> $(PATHDEF_SRC)
1187 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1188 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1189 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001190 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC)
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001191 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1192 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001193
1194auto:
1195 if not exist auto/nul mkdir auto
1196
1197# End Custom Build
1198proto.h: \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001199 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001200 proto/buffer.pro \
1201 proto/charset.pro \
1202 proto/diff.pro \
1203 proto/digraph.pro \
1204 proto/edit.pro \
1205 proto/eval.pro \
1206 proto/ex_cmds.pro \
1207 proto/ex_cmds2.pro \
1208 proto/ex_docmd.pro \
1209 proto/ex_eval.pro \
1210 proto/ex_getln.pro \
1211 proto/fileio.pro \
1212 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001213 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001214 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001215 proto/main.pro \
1216 proto/mark.pro \
1217 proto/memfile.pro \
1218 proto/memline.pro \
1219 proto/menu.pro \
1220 proto/message.pro \
1221 proto/misc1.pro \
1222 proto/misc2.pro \
1223 proto/move.pro \
1224 proto/mbyte.pro \
1225 proto/normal.pro \
1226 proto/ops.pro \
1227 proto/option.pro \
1228 proto/os_mswin.pro \
1229 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001230 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001231 proto/quickfix.pro \
1232 proto/regexp.pro \
1233 proto/screen.pro \
1234 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001235 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001236 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001237 proto/syntax.pro \
1238 proto/tag.pro \
1239 proto/term.pro \
1240 proto/ui.pro \
1241 proto/undo.pro \
1242 proto/window.pro \
1243 $(NETBEANS_PRO)
1244
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001245.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001246
1247# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1248# foo.cod"
1249.c.cod:
1250 $(CC) $(CFLAGS) /FAcs $<
1251
1252# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1253.c.i:
1254 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001255
1256
Bram Moolenaar071d4272004-06-13 20:20:40 +00001257# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: