blob: fd6b999275f9d3952f4d3d493d04d9ecb8352f29 [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 Moolenaar6f586de2012-09-18 22:00:08 +02004# VC9 (VS2008), VC10 (VS2010) and VC11 (VS2012)
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#
Bram Moolenaar6f586de2012-09-18 22:00:08 +020018# For MSVC 11 you need to specify where the Win32.mak file is, e.g.:
19# SDK_INCLUDE_DIR="C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"
20#
Bram Moolenaar7887d882005-07-01 22:33:52 +000021# !!!! After changing features do "nmake clean" first !!!!
22#
Bram Moolenaare5f2be62016-01-21 20:24:34 +010023# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is HUGE)
Bram Moolenaar7887d882005-07-01 22:33:52 +000024#
Bram Moolenaar071d4272004-06-13 20:20:40 +000025# GUI interface: GUI=yes (default is no)
Bram Moolenaar7887d882005-07-01 22:33:52 +000026#
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +020027# GUI with DirectWrite(DirectX): DIRECTX=yes
28# (default is no, requires GUI=yes)
29#
Bram Moolenaar071d4272004-06-13 20:20:40 +000030# OLE interface: OLE=yes (usually with GUI=yes)
Bram Moolenaar7887d882005-07-01 22:33:52 +000031#
Bram Moolenaara83c3e02006-03-17 23:10:44 +000032# Multibyte support: MBYTE=yes (default is no)
Bram Moolenaar7887d882005-07-01 22:33:52 +000033#
Bram Moolenaar071d4272004-06-13 20:20:40 +000034# IME support: IME=yes (requires GUI=yes)
35# DYNAMIC_IME=[yes or no] (to load the imm32.dll dynamically, default
36# is yes)
37# Global IME support: GIME=yes (requires GUI=yes)
Bram Moolenaar7887d882005-07-01 22:33:52 +000038#
Bram Moolenaar0ba04292010-07-14 23:23:17 +020039# Lua interface:
40# LUA=[Path to Lua directory]
41# DYNAMIC_LUA=yes (to load the Lua DLL dynamically)
42# LUA_VER=[Lua version] (default is 51)
43#
Bram Moolenaar65c1b012005-01-31 19:02:28 +000044# MzScheme interface:
45# MZSCHEME=[Path to MzScheme directory]
46# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically)
47# MZSCHEME_VER=[version, 205_000, ...]
Bram Moolenaar9e70cf12009-05-26 20:59:55 +000048# MZSCHEME_DEBUG=no
Bram Moolenaar7887d882005-07-01 22:33:52 +000049#
Bram Moolenaar071d4272004-06-13 20:20:40 +000050# Perl interface:
51# PERL=[Path to Perl directory]
52# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010053# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x),
54# 510 (5.10.x), etc]
Bram Moolenaar7887d882005-07-01 22:33:52 +000055# (default is 56)
56#
Bram Moolenaar071d4272004-06-13 20:20:40 +000057# Python interface:
58# PYTHON=[Path to Python directory]
59# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010060# PYTHON_VER=[Python version, eg 22, 23, ..., 27] (default is 22)
Bram Moolenaar7887d882005-07-01 22:33:52 +000061#
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +020062# Python3 interface:
63# PYTHON3=[Path to Python3 directory]
64# DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
65# PYTHON3_VER=[Python3 version, eg 30, 31] (default is 31)
66#
Bram Moolenaar071d4272004-06-13 20:20:40 +000067# Ruby interface:
68# RUBY=[Path to Ruby directory]
69# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010070# RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18)
71# RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8)
Bram Moolenaar071d4272004-06-13 20:20:40 +000072# You must set RUBY_VER_LONG when change RUBY_VER.
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010073# RUBY_API_VER is derived from RUBY_VER_LONG.
74# Note: If you use Ruby 1.9.3, set as follows:
75# RUBY_VER=19
76# RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
Bram Moolenaar7887d882005-07-01 22:33:52 +000077#
Bram Moolenaar071d4272004-06-13 20:20:40 +000078# Tcl interface:
79# TCL=[Path to Tcl directory]
80# DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
81# TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
82# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
83# You must set TCL_VER_LONG when you set TCL_VER.
Bram Moolenaar7887d882005-07-01 22:33:52 +000084#
Bram Moolenaar7887d882005-07-01 22:33:52 +000085# Cscope support: CSCOPE=yes
86#
87# Iconv library support (always dynamically loaded):
88# ICONV=[yes or no] (default is yes)
89#
90# Intl library support (always dynamically loaded):
91# GETTEXT=[yes or no] (default is yes)
92# See http://sourceforge.net/projects/gettext/
93#
Bram Moolenaar884f6e42013-05-19 21:03:54 +020094# PostScript printing: POSTSCRIPT=yes (default is no)
Bram Moolenaar7887d882005-07-01 22:33:52 +000095#
Bram Moolenaar884f6e42013-05-19 21:03:54 +020096# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
Bram Moolenaare0874f82016-01-24 20:36:41 +010097# Requires CHANNEL.
98#
99# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
100# doesn't work)
101#
102# Inter process communication: CHANNEL=[yes or no] (default is yes if GUI
103# is yes)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000104#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200105# XPM Image Support: XPM=[path to XPM directory]
106# Default is "xpm", using the files included in the distribution.
107# Use "no" to disable this feature.
Bram Moolenaar7887d882005-07-01 22:33:52 +0000108#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200109# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000110#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200111# Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
112# i386)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000113#
Bram Moolenaar223b7232016-02-19 19:43:49 +0100114# Version Support: WINVER=[0x0501, 0x0600] (default is 0x0501)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000115#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116# Debug version: DEBUG=yes
117# Mapfile: MAP=[no, yes or lines] (default is yes)
118# no: Don't write a mapfile.
119# yes: Write a normal mapfile.
120# lines: Write a mapfile with line numbers (only for VC6 and later)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000121#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200122# Static Code Analysis: ANALYZE=yes (works with VS2012 only)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000123#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000124# You can combine any of these interfaces
125#
126# Example: To build the non-debug, GUI version with Perl interface:
127# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
128#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000129# DEBUG with Make_mvc.mak and Make_dvc.mak:
130# This makefile gives a fineness of control which is not supported in
131# Visual C++ configuration files. Therefore, debugging requires a bit of
132# extra work.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000133# Make_dvc.mak is a Visual C++ project to access that support. It may be
134# badly out of date for the Visual C++ you are using...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000135# To use Make_dvc.mak:
136# 1) Build Vim with Make_mvc.mak.
137# Use a "DEBUG=yes" argument to build Vim with debug support.
138# E.g. the following builds gvimd.exe:
139# nmake -f Make_mvc.mak debug=yes gui=yes
140# 2) Use MS Devstudio and set it up to allow that file to be debugged:
141# i) Pass Make_dvc.mak to the IDE.
142# Use the "open workspace" menu entry to load Make_dvc.mak.
143# Alternatively, from the command line:
144# msdev /nologo Make_dvc.mak
145# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
146# this and offer to convert it to their own format. Accept that.
147# It creates a file called Make_dvc.dsw which can then be used
148# for further operations. E.g.
149# msdev /nologo Make_dvc.dsw
150# ii) Set the built executable for debugging:
151# a) Alt+F7/Debug takes you to the Debug dialog.
152# b) Fill "Executable for debug session". e.g. gvimd.exe
153# c) Fill "Program arguments". e.g. -R dosinst.c
154# d) Complete the dialog
155# 3) You can now debug the executable you built with Make_mvc.mak
156#
157# Note: Make_dvc.mak builds vimrun.exe, because it must build something
158# to be a valid makefile..
159
160### See feature.h for a list of optionals.
161# If you want to build some optional features without modifying the source,
162# you can set DEFINES on the command line, e.g.,
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000163# nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000164
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000165# Build on both Windows NT/XP and Windows 9x
Bram Moolenaar071d4272004-06-13 20:20:40 +0000166
167TARGETOS = BOTH
168
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000169# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
170# interfaces.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000171# If you change something else, do "make clean" first!
172!if "$(GUI)" == "yes"
173OBJDIR = .\ObjG
174!else
175OBJDIR = .\ObjC
176!endif
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200177!if "$(DIRECTX)" == "yes"
178OBJDIR = $(OBJDIR)X
179!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000180!if "$(OLE)" == "yes"
181OBJDIR = $(OBJDIR)O
182!endif
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200183!ifdef LUA
184OBJDIR = $(OBJDIR)U
185!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000186!ifdef PERL
187OBJDIR = $(OBJDIR)L
188!endif
189!ifdef PYTHON
190OBJDIR = $(OBJDIR)Y
191!endif
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200192!ifdef PYTHON3
193OBJDIR = $(OBJDIR)H
194!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000195!ifdef TCL
196OBJDIR = $(OBJDIR)T
197!endif
198!ifdef RUBY
199OBJDIR = $(OBJDIR)R
200!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000201!ifdef MZSCHEME
202OBJDIR = $(OBJDIR)Z
203!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000204!if "$(DEBUG)" == "yes"
205OBJDIR = $(OBJDIR)d
206!endif
207
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000208# Win32.mak requires that CPU be set appropriately.
209# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000210
211!ifdef PROCESSOR_ARCHITECTURE
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000212# We're on Windows NT or using VC 6+
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000213! ifdef CPU
214ASSEMBLY_ARCHITECTURE=$(CPU)
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000215# Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7.
Bram Moolenaar6b903512015-12-11 19:38:44 +0100216! if "$(CPU)" == "I386"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000217CPU = i386
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000218! endif
Bram Moolenaar6b903512015-12-11 19:38:44 +0100219! else # !CPU
220CPU = i386
Bram Moolenaar3d6d5cc2016-01-15 18:03:32 +0100221! if !defined(PLATFORM) && defined(TARGET_CPU)
222PLATFORM = $(TARGET_CPU)
223! endif
Bram Moolenaar6b903512015-12-11 19:38:44 +0100224! ifdef PLATFORM
225! if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64")
226CPU = AMD64
227! elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86")
228! error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted.
229! endif
230! endif # !PLATFORM
Bram Moolenaar071d4272004-06-13 20:20:40 +0000231! endif
232!else # !PROCESSOR_ARCHITECTURE
233# We're on Windows 95
234CPU = i386
235!endif # !PROCESSOR_ARCHITECTURE
Bram Moolenaar6b903512015-12-11 19:38:44 +0100236ASSEMBLY_ARCHITECTURE=$(CPU)
Bram Moolenaare2db4362012-09-05 17:57:39 +0200237OBJDIR = $(OBJDIR)$(CPU)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000238
Bram Moolenaar071d4272004-06-13 20:20:40 +0000239# Build a retail version by default
240
241!if "$(DEBUG)" != "yes"
242NODEBUG = 1
243!else
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000244!undef NODEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000245MAKEFLAGS_GVIMEXT = DEBUG=yes
246!endif
247
248
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000249# Get all sorts of useful, standard macros from the Platform SDK.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000250
Bram Moolenaar6f586de2012-09-18 22:00:08 +0200251!ifdef SDK_INCLUDE_DIR
252!include $(SDK_INCLUDE_DIR)\Win32.mak
253!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000254!include <Win32.mak>
Bram Moolenaar6f586de2012-09-18 22:00:08 +0200255!endif
256
Bram Moolenaar071d4272004-06-13 20:20:40 +0000257
Bram Moolenaarb5b95752016-06-18 21:59:36 +0200258# Check VC version.
259!if [echo MSVCVER=_MSC_VER> msvcver.c && $(CC) /EP msvcver.c > msvcver.~ 2> nul]
260!message *** ERROR
261!message Cannot run Visual C to determine its version. Make sure cl.exe is in your PATH.
262!message This can usually be done by running "vcvarsall.bat", located in the bin directory where Visual Studio was installed.
263!error Make aborted.
264!else
265!include msvcver.~
266!if [del msvcver.c msvcver.~]
267!endif
268!endif
269
270!if $(MSVCVER) < 1900
271MSVC_MAJOR = ($(MSVCVER) / 100 - 6)
272MSVCRT_VER = ($(MSVCVER) / 10 - 60)
273!else
274MSVC_MAJOR = ($(MSVCVER) / 100 - 5)
275MSVCRT_VER = ($(MSVCVER) / 10 - 50)
276!endif
277
278# Calculate MSVCRT_VER
279!if [(set /a MSVCRT_VER="$(MSVCRT_VER)" > nul) && set MSVCRT_VER > msvcrtver.~] == 0
280!include msvcrtver.~
281!if [del msvcrtver.~]
282!endif
283!endif
284
285# Base name of the msvcrXX.dll
286!if $(MSVCRT_VER) <= 60
287MSVCRT_NAME = msvcrt
288!else
289MSVCRT_NAME = msvcr$(MSVCRT_VER)
290!endif
291
292!if $(MSVC_MAJOR) == 6
293CPU = ix86
294!endif
295
296
Bram Moolenaar8cd213c2010-06-01 21:57:09 +0200297# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200298WP64CHECK = /Wp64
Bram Moolenaar071d4272004-06-13 20:20:40 +0000299
300#>>>>> path of the compiler and linker; name of include and lib directories
301# PATH = c:\msvc20\bin;$(PATH)
302# INCLUDE = c:\msvc20\include
303# LIB = c:\msvc20\lib
304
Bram Moolenaar76929af2016-06-02 20:26:41 +0200305!if "$(FEATURES)"==""
306FEATURES = HUGE
307!endif
308
Bram Moolenaar071d4272004-06-13 20:20:40 +0000309!ifndef CTAGS
310CTAGS = ctags
311!endif
312
Bram Moolenaar071d4272004-06-13 20:20:40 +0000313!ifndef CSCOPE
314CSCOPE = yes
315!endif
316
317!if "$(CSCOPE)" == "yes"
318# CSCOPE - Include support for Cscope
319CSCOPE_INCL = if_cscope.h
320CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
321CSCOPE_DEFS = -DFEAT_CSCOPE
322!endif
323
324!ifndef NETBEANS
325NETBEANS = $(GUI)
326!endif
327
Bram Moolenaare0874f82016-01-24 20:36:41 +0100328!ifndef CHANNEL
Bram Moolenaar76929af2016-06-02 20:26:41 +0200329!if "$(FEATURES)"=="HUGE"
330CHANNEL = yes
331!else
Bram Moolenaare0874f82016-01-24 20:36:41 +0100332CHANNEL = $(GUI)
333!endif
Bram Moolenaar76929af2016-06-02 20:26:41 +0200334!endif
Bram Moolenaare0874f82016-01-24 20:36:41 +0100335
Bram Moolenaarb5b95752016-06-18 21:59:36 +0200336# GUI sepcific features.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000337!if "$(GUI)" == "yes"
Bram Moolenaarb5b95752016-06-18 21:59:36 +0200338# Only allow NETBEANS for a GUI build and CHANNEL.
Bram Moolenaare0874f82016-01-24 20:36:41 +0100339!if "$(NETBEANS)" == "yes" && "$(CHANNEL)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000340# NETBEANS - Include support for Netbeans integration
341NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000342NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000343NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000344
345!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000346NBDEBUG_DEFS = -DNBDEBUG
347NBDEBUG_INCL = nbdebug.h
348NBDEBUG_SRC = nbdebug.c
349!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000350NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000351!endif
352
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200353# DirectWrite(DirectX)
354!if "$(DIRECTX)" == "yes"
355DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
356DIRECTX_INCL = gui_dwrite.h
357DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj
358!endif
359
Bram Moolenaarb5b95752016-06-18 21:59:36 +0200360# Only allow XPM for a GUI build.
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200361!ifndef XPM
Bram Moolenaarb5b95752016-06-18 21:59:36 +0200362!ifndef USE_MSVCRT
363# Both XPM and USE_MSVCRT are not set, use the included xpm files, depending
364# on the architecture.
Bram Moolenaare2db4362012-09-05 17:57:39 +0200365!if "$(CPU)" == "AMD64"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200366XPM = xpm\x64
Bram Moolenaare2db4362012-09-05 17:57:39 +0200367!elseif "$(CPU)" == "i386"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200368XPM = xpm\x86
Bram Moolenaare2db4362012-09-05 17:57:39 +0200369!else
370XPM = no
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200371!endif
Bram Moolenaarb5b95752016-06-18 21:59:36 +0200372!else # USE_MSVCRT
373XPM = no
374!endif # USE_MSVCRT
375!endif # XPM
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200376!if "$(XPM)" != "no"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000377# XPM - Include support for XPM signs
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200378# See the xpm directory for more information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000379XPM_OBJ = $(OBJDIR)/xpm_w32.obj
380XPM_DEFS = -DFEAT_XPM_W32
Bram Moolenaarb5b95752016-06-18 21:59:36 +0200381!if $(MSVC_MAJOR) >= 14
382# VC14 cannot use a library built by VC12 or eariler, because VC14 uses
383# Universal CRT.
384XPM_LIB = $(XPM)\lib-vc14\libXpm.lib
385!else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000386XPM_LIB = $(XPM)\lib\libXpm.lib
Bram Moolenaarb5b95752016-06-18 21:59:36 +0200387!endif
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200388XPM_INC = -I $(XPM)\include -I $(XPM)\..\include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000389!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000390!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000391
Bram Moolenaare0874f82016-01-24 20:36:41 +0100392!if "$(CHANNEL)" == "yes"
393CHANNEL_PRO = proto/channel.pro
394CHANNEL_OBJ = $(OBJDIR)/channel.obj
Bram Moolenaar509ce2a2016-03-11 22:52:15 +0100395CHANNEL_DEFS = -DFEAT_JOB_CHANNEL
Bram Moolenaare0874f82016-01-24 20:36:41 +0100396
397NETBEANS_LIB = WSock32.lib
398!endif
399
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000400# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000401!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000402# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000403# !elseif defined(MULTITHREADED)
404# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000405!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000406# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000407# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000408!endif
409
410# need advapi32.lib for GetUserName()
411# need shell32.lib for ExtractIcon()
412# gdi32.lib and comdlg32.lib for printing support
413# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000414CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200415 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000416!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000417CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
418!endif
419
420### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000421!ifndef WINVER
Bram Moolenaar223b7232016-02-19 19:43:49 +0100422WINVER = 0x0501
Bram Moolenaar071d4272004-06-13 20:20:40 +0000423!endif
424
425# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
426# default, use these lines.
427#VIMRCLOC = somewhere
428#VIMRUNTIMEDIR = somewhere
429
430CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
Bram Moolenaar85b11762016-02-27 18:13:23 +0100431 $(CSCOPE_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000432 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000433 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
434 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000435
436#>>>>> end of choices
437###########################################################################
438
439!ifdef OS
440OS_TYPE = winnt
441DEL_TREE = rmdir /s /q
442!else
443OS_TYPE = win95
444DEL_TREE = deltree /y
445!endif
446
447INTDIR=$(OBJDIR)
448OUTDIR=$(OBJDIR)
449
450# Convert processor ID to MVC-compatible number
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100451!if $(MSVC_MAJOR) < 8
Bram Moolenaar071d4272004-06-13 20:20:40 +0000452!if "$(CPUNR)" == "i386"
453CPUARG = /G3
454!elseif "$(CPUNR)" == "i486"
455CPUARG = /G4
456!elseif "$(CPUNR)" == "i586"
457CPUARG = /G5
458!elseif "$(CPUNR)" == "i686"
459CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000460!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000461CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000462!else
463CPUARG =
464!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000465!else
Bram Moolenaar3ed16dc2011-06-12 20:31:31 +0200466# VC8/9/10 only allows specifying SSE architecture but only for 32bit
Bram Moolenaar6b903512015-12-11 19:38:44 +0100467!if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "pentium4"
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000468CPUARG = /arch:SSE2
469!endif
470!endif
471
472LIBC =
473DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000474
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200475# Don't use /nodefaultlib on MSVC 14
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100476!if $(MSVC_MAJOR) >= 14
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200477NODEFAULTLIB =
478!else
479NODEFAULTLIB = /nodefaultlib
480!endif
481
Bram Moolenaar071d4272004-06-13 20:20:40 +0000482!ifdef NODEBUG
483VIM = vim
484!if "$(OPTIMIZE)" == "SPACE"
485OPTFLAG = /O1
486!elseif "$(OPTIMIZE)" == "SPEED"
487OPTFLAG = /O2
488!else # MAXSPEED
489OPTFLAG = /Ox
490!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200491
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100492!if $(MSVC_MAJOR) >= 8
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000493# Use link time code generation if not worried about size
494!if "$(OPTIMIZE)" != "SPACE"
495OPTFLAG = $(OPTFLAG) /GL
496!endif
497!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200498
499# (/Wp64 is deprecated in VC9 and generates an obnoxious warning.)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100500!if ($(MSVC_MAJOR) == 7) || ($(MSVC_MAJOR) == 8)
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200501CFLAGS=$(CFLAGS) $(WP64CHECK)
502!endif
503
Bram Moolenaar22fcfad2016-07-01 18:17:26 +0200504# VC10 or later has stdint.h.
505!if $(MSVC_MAJOR) >= 10
506CFLAGS = $(CFLAGS) -DHAVE_STDINT_H
507!endif
508
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100509# Static code analysis generally available starting with VS2012 (VC11) or
510# Windows SDK 7.1 (VC10)
511!if ("$(ANALYZE)" == "yes") && ($(MSVC_MAJOR) >= 10)
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200512CFLAGS=$(CFLAGS) /analyze
513!endif
514
Bram Moolenaar34114692005-01-02 11:28:13 +0000515CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000516RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000517! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000518CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000519LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000520! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000521LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000522CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000523! endif
524!else # DEBUG
525VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000526! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000527DEBUGINFO = /ZI
528! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000529CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000530RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
531# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100532! if $(MSVC_MAJOR) == 4
Bram Moolenaar071d4272004-06-13 20:20:40 +0000533LIBC =
534! else
535LIBC = /fixed:no
536! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000537! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000538CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000539LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000540! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000541LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000542CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000543! endif
544!endif # DEBUG
545
546INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
Bram Moolenaar85b11762016-02-27 18:13:23 +0100547 proto.h option.h structs.h term.h $(CSCOPE_INCL) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000548 $(NBDEBUG_INCL)
549
550OBJ = \
Bram Moolenaar75464dc2016-07-02 20:27:50 +0200551 $(OUTDIR)\arabic.obj \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200552 $(OUTDIR)\blowfish.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000553 $(OUTDIR)\buffer.obj \
554 $(OUTDIR)\charset.obj \
Bram Moolenaar07cf3822014-08-10 16:31:50 +0200555 $(OUTDIR)\crypt.obj \
556 $(OUTDIR)\crypt_zip.obj \
Bram Moolenaar6583c442016-07-17 18:41:47 +0200557 $(OUTDIR)\dict.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000558 $(OUTDIR)\diff.obj \
559 $(OUTDIR)\digraph.obj \
560 $(OUTDIR)\edit.obj \
561 $(OUTDIR)\eval.obj \
562 $(OUTDIR)\ex_cmds.obj \
563 $(OUTDIR)\ex_cmds2.obj \
564 $(OUTDIR)\ex_docmd.obj \
565 $(OUTDIR)\ex_eval.obj \
566 $(OUTDIR)\ex_getln.obj \
Bram Moolenaar75464dc2016-07-02 20:27:50 +0200567 $(OUTDIR)\farsi.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000568 $(OUTDIR)\fileio.obj \
569 $(OUTDIR)\fold.obj \
570 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000571 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000572 $(OUTDIR)\hashtab.obj \
Bram Moolenaar520e1e42016-01-23 19:46:28 +0100573 $(OUTDIR)\json.obj \
Bram Moolenaar6583c442016-07-17 18:41:47 +0200574 $(OUTDIR)\list.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000575 $(OUTDIR)\main.obj \
576 $(OUTDIR)\mark.obj \
577 $(OUTDIR)\mbyte.obj \
578 $(OUTDIR)\memfile.obj \
579 $(OUTDIR)\memline.obj \
580 $(OUTDIR)\menu.obj \
581 $(OUTDIR)\message.obj \
582 $(OUTDIR)\misc1.obj \
583 $(OUTDIR)\misc2.obj \
584 $(OUTDIR)\move.obj \
585 $(OUTDIR)\normal.obj \
586 $(OUTDIR)\ops.obj \
587 $(OUTDIR)\option.obj \
588 $(OUTDIR)\os_mswin.obj \
Bram Moolenaar693e40c2013-02-26 14:56:42 +0100589 $(OUTDIR)\winclip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000590 $(OUTDIR)\os_win32.obj \
591 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000592 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000593 $(OUTDIR)\quickfix.obj \
594 $(OUTDIR)\regexp.obj \
595 $(OUTDIR)\screen.obj \
596 $(OUTDIR)\search.obj \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200597 $(OUTDIR)\sha256.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000598 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000599 $(OUTDIR)\syntax.obj \
600 $(OUTDIR)\tag.obj \
601 $(OUTDIR)\term.obj \
602 $(OUTDIR)\ui.obj \
603 $(OUTDIR)\undo.obj \
Bram Moolenaar6583c442016-07-17 18:41:47 +0200604 $(OUTDIR)\userfunc.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000605 $(OUTDIR)\window.obj \
606 $(OUTDIR)\vim.res
607
608!if "$(OLE)" == "yes"
609CFLAGS = $(CFLAGS) -DFEAT_OLE
610RCFLAGS = $(RCFLAGS) -DFEAT_OLE
611OLE_OBJ = $(OUTDIR)\if_ole.obj
612OLE_IDL = if_ole.idl
613OLE_LIB = oleaut32.lib
614!endif
615
616!if "$(IME)" == "yes"
617CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
618!ifndef DYNAMIC_IME
619DYNAMIC_IME = yes
620!endif
621!if "$(DYNAMIC_IME)" == "yes"
622CFLAGS = $(CFLAGS) -DDYNAMIC_IME
623!else
624IME_LIB = imm32.lib
625!endif
626!endif
627
628!if "$(GIME)" == "yes"
629CFLAGS = $(CFLAGS) -DGLOBAL_IME
630OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
631MBYTE = yes
632!endif
633
634!if "$(MBYTE)" == "yes"
635CFLAGS = $(CFLAGS) -DFEAT_MBYTE
636!endif
637
638!if "$(GUI)" == "yes"
639SUBSYSTEM = windows
640CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
641RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
642VIM = g$(VIM)
643GUI_INCL = \
644 gui.h \
645 regexp.h \
646 ascii.h \
647 ex_cmds.h \
648 farsi.h \
649 feature.h \
650 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000651 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000652 keymap.h \
653 macros.h \
654 option.h \
655 os_dos.h \
656 os_win32.h
657GUI_OBJ = \
658 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000659 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000660 $(OUTDIR)\gui_w32.obj \
661 $(OUTDIR)\os_w32exe.obj
662GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000663 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000664 winspool.lib comctl32.lib advapi32.lib shell32.lib \
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200665 /machine:$(CPU)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000666!else
667SUBSYSTEM = console
Bram Moolenaar97ff9b92016-06-26 20:37:46 +0200668CUI_INCL = iscygpty.h
669CUI_OBJ = $(OUTDIR)\iscygpty.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000670!endif
671
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200672!if "$(SUBSYSTEM_VER)" != ""
673SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
674!endif
675
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200676!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
677CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
678GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
679GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
680!endif
681
Bram Moolenaar071d4272004-06-13 20:20:40 +0000682# iconv.dll library (dynamically loaded)
683!ifndef ICONV
684ICONV = yes
685!endif
686!if "$(ICONV)" == "yes"
687CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
688!endif
689
690# libintl.dll library
691!ifndef GETTEXT
692GETTEXT = yes
693!endif
694!if "$(GETTEXT)" == "yes"
695CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
696!endif
697
698# TCL interface
699!ifdef TCL
700!ifndef TCL_VER
701TCL_VER = 83
702TCL_VER_LONG = 8.3
703!endif
704!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
705!if "$(DYNAMIC_TCL)" == "yes"
706!message Tcl DLL will be loaded dynamically
707TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000708CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
709 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000710TCL_OBJ = $(OUTDIR)\if_tcl.obj
711TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
Bram Moolenaar84a4c332012-02-22 16:01:56 +0100712TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000713!else
714CFLAGS = $(CFLAGS) -DFEAT_TCL
715TCL_OBJ = $(OUTDIR)\if_tcl.obj
716TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
717TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
718!endif
719!endif
720
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200721# Lua interface
722!ifdef LUA
723!ifndef LUA_VER
724LUA_VER = 51
725!endif
726!message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)"
727!if "$(DYNAMIC_LUA)" == "yes"
728!message Lua DLL will be loaded dynamically
729!endif
730CFLAGS = $(CFLAGS) -DFEAT_LUA
731LUA_OBJ = $(OUTDIR)\if_lua.obj
732LUA_INC = /I "$(LUA)\include" /I "$(LUA)"
733!if "$(DYNAMIC_LUA)" == "yes"
734CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \
735 -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
736LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib
737!else
738LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib"
739!endif
740!endif
741
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200742!ifdef PYTHON
743!ifdef PYTHON3
744DYNAMIC_PYTHON=yes
745DYNAMIC_PYTHON3=yes
746!endif
747!endif
748
Bram Moolenaar071d4272004-06-13 20:20:40 +0000749# PYTHON interface
750!ifdef PYTHON
751!ifndef PYTHON_VER
752PYTHON_VER = 22
753!endif
754!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
755!if "$(DYNAMIC_PYTHON)" == "yes"
756!message Python DLL will be loaded dynamically
757!endif
758CFLAGS = $(CFLAGS) -DFEAT_PYTHON
759PYTHON_OBJ = $(OUTDIR)\if_python.obj
760PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
761!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000762CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
763 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000764PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
765!else
766PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
767!endif
768!endif
769
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200770# PYTHON3 interface
771!ifdef PYTHON3
772!ifndef PYTHON3_VER
773PYTHON3_VER = 31
774!endif
775!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
776!if "$(DYNAMIC_PYTHON3)" == "yes"
777!message Python3 DLL will be loaded dynamically
778!endif
779CFLAGS = $(CFLAGS) -DFEAT_PYTHON3
780PYTHON3_OBJ = $(OUTDIR)\if_python3.obj
781PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC"
782!if "$(DYNAMIC_PYTHON3)" == "yes"
783CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \
784 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
785PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib
786!else
787PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
788!endif
789!endif
790
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000791# MzScheme interface
792!ifdef MZSCHEME
793!message MzScheme requested - root dir is "$(MZSCHEME)"
794!ifndef MZSCHEME_VER
795MZSCHEME_VER = 205_000
796!endif
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100797!ifndef MZSCHEME_COLLECTS
798MZSCHEME_COLLECTS=$(MZSCHEME)\collects
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000799!endif
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100800CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I "$(MZSCHEME)\include"
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100801!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib")
802MZSCHEME_MAIN_LIB=mzsch
803!else
804MZSCHEME_MAIN_LIB=racket
805!endif
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100806!if (EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll") \
807 && !EXIST("$(MZSCHEME)\lib\libmzgc$(MZSCHEME_VER).dll")) \
808 || (EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
809 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib"))
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000810!message Building with Precise GC
811MZSCHEME_PRECISE_GC = yes
812CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
813!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000814!if "$(DYNAMIC_MZSCHEME)" == "yes"
815!message MzScheme DLLs will be loaded dynamically
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100816CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME
817!if "$(MZSCHEME_PRECISE_GC)" == "yes"
818# Precise GC does not use separate dll
819CFLAGS = $(CFLAGS) \
820 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
821 -DDYNAMIC_MZGC_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\"
822!else
823CFLAGS = $(CFLAGS) \
824 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
825 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
826!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000827!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000828!if "$(MZSCHEME_DEBUG)" == "yes"
829CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
830!endif
831!if "$(MZSCHEME_PRECISE_GC)" == "yes"
832# Precise GC does not use separate dll
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100833!if EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def")
834# create .lib from .def
835MZSCHEME_LIB = lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
836MZSCHEME_EXTRA_DEP = lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000837!else
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100838MZSCHEME_LIB = "$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib"
839!endif
840!else
841MZSCHEME_LIB = "$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib" \
842 "$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib"
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000843!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000844!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000845MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
Bram Moolenaarbbc98db2012-02-12 01:55:55 +0100846# increase stack size
847MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000848!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000849
Bram Moolenaar071d4272004-06-13 20:20:40 +0000850# Perl interface
851!ifdef PERL
852!ifndef PERL_VER
853PERL_VER = 56
854!endif
855!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
856!if "$(DYNAMIC_PERL)" == "yes"
857!if $(PERL_VER) >= 56
858!message Perl DLL will be loaded dynamically
859!else
860!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
861!message Reverting to static loading...
862!undef DYNAMIC_PERL
863!endif
864!endif
865
866# Is Perl installed in architecture-specific directories?
867!if exist($(PERL)\Bin\MSWin32-x86)
868PERL_ARCH = \MSWin32-x86
869!endif
870
871PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
872
873# Version-dependent stuff
874!if $(PERL_VER) == 55
875PERL_LIB = $(PERL_INCDIR)\perl.lib
876!else
877PERL_DLL = perl$(PERL_VER).dll
Bram Moolenaar207fd752013-12-14 11:50:35 +0100878!if exist($(PERL_INCDIR)\perl$(PERL_VER).lib)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000879PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
Bram Moolenaar207fd752013-12-14 11:50:35 +0100880!else
881# For ActivePerl 5.18 and later
882PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a
883!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000884!endif
885
Bram Moolenaar367fbf12015-06-25 16:13:46 +0200886CFLAGS = $(CFLAGS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000887
888# Do we want to load Perl dynamically?
889!if "$(DYNAMIC_PERL)" == "yes"
890CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
891!undef PERL_LIB
892!endif
893
894PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
895PERL_INC = /I $(PERL_INCDIR)
Bram Moolenaar2bf24172015-12-31 20:54:51 +0100896!if $(MSVC_MAJOR) <= 11
897# ActivePerl 5.20+ requires stdbool.h but VC2012 or earlier doesn't have it.
898# Use a stub stdbool.h.
899PERL_INC = $(PERL_INC) /I if_perl_msvc
900!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000901PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
902XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
Bram Moolenaar52f83172011-09-14 19:01:42 +0200903!if exist($(XSUBPP))
Bram Moolenaar612af432011-09-14 10:49:46 +0200904XSUBPP = $(PERL_EXE) $(XSUBPP)
905!else
906XSUBPP = xsubpp
907!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000908XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
909
910!endif
911
912#
913# Support Ruby interface
914#
915!ifdef RUBY
916# Set default value
917!ifndef RUBY_VER
918RUBY_VER = 18
919!endif
920!ifndef RUBY_VER_LONG
921RUBY_VER_LONG = 1.8
922!endif
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200923!ifndef RUBY_API_VER
924RUBY_API_VER = $(RUBY_VER_LONG:.=)
925!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000926
927!if $(RUBY_VER) >= 18
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100928
Bram Moolenaar071d4272004-06-13 20:20:40 +0000929!ifndef RUBY_PLATFORM
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100930!if "$(CPU)" == "i386"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000931RUBY_PLATFORM = i386-mswin32
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100932!else # CPU
933RUBY_PLATFORM = x64-mswin64
934!endif # CPU
935!if $(MSVCRT_VER) >= 70
936RUBY_PLATFORM = $(RUBY_PLATFORM)_$(MSVCRT_VER)
937!endif # MSVCRT_VER
938!endif # RUBY_PLATFORM
939
Bram Moolenaar071d4272004-06-13 20:20:40 +0000940!ifndef RUBY_INSTALL_NAME
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100941!ifndef RUBY_MSVCRT_NAME
942# Base name of msvcrXX.dll which is used by ruby's dll.
943RUBY_MSVCRT_NAME = $(MSVCRT_NAME)
944!endif # RUBY_MSVCRT_NAME
945!if "$(CPU)" == "i386"
946RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
947!else # CPU
948RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
949!endif # CPU
950!endif # RUBY_INSTALL_NAME
951
952!else # $(RUBY_VER) >= 18
953
Bram Moolenaar071d4272004-06-13 20:20:40 +0000954!ifndef RUBY_PLATFORM
955RUBY_PLATFORM = i586-mswin32
956!endif
957!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200958RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000959!endif
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100960
Bram Moolenaar071d4272004-06-13 20:20:40 +0000961!endif # $(RUBY_VER) >= 18
962
963!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
964CFLAGS = $(CFLAGS) -DFEAT_RUBY
965RUBY_OBJ = $(OUTDIR)\if_ruby.obj
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200966!if $(RUBY_VER) >= 19
967RUBY_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 +0200968!else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000969RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
Bram Moolenaar69154f22010-07-18 21:42:34 +0200970!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000971RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
972# Do we want to load Ruby dynamically?
973!if "$(DYNAMIC_RUBY)" == "yes"
974!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000975CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
976 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000977!undef RUBY_LIB
978!endif
979!endif # RUBY
980
981#
982# Support PostScript printing
983#
984!if "$(POSTSCRIPT)" == "yes"
985CFLAGS = $(CFLAGS) -DMSWINPS
986!endif # POSTSCRIPT
987
988#
989# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
990#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000991CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
992
993#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000994# Always generate the .pdb file, so that we get debug symbols that can be used
995# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000996# Generate edit-and-continue debug info when no optimization - allows to
997# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000998#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000999CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
1000LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +00001001
1002#
1003# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +00001004#
1005!message
1006
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001007conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001008
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001009PATHDEF_SRC = $(OUTDIR)\pathdef.c
1010
Bram Moolenaar071d4272004-06-13 20:20:40 +00001011!IF "$(MAP)" == "yes"
1012# "/map" is for debugging
1013conflags = $(conflags) /map
1014!ELSEIF "$(MAP)" == "lines"
1015# "/mapinfo:lines" is for debugging, only works for VC6 and later
1016conflags = $(conflags) /map /mapinfo:lines
1017!ENDIF
1018
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001019LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar85b11762016-02-27 18:13:23 +01001020LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001021 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001022 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001023
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001024# Report link time code generation progress if used.
1025!ifdef NODEBUG
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +01001026!if $(MSVC_MAJOR) >= 8
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001027!if "$(OPTIMIZE)" != "SPACE"
1028LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
1029!endif
1030!endif
1031!endif
1032
Bram Moolenaar24db7292016-01-03 16:56:10 +01001033all: $(VIM).exe \
1034 vimrun.exe \
1035 install.exe \
1036 uninstal.exe \
1037 xxd/xxd.exe \
1038 tee/tee.exe \
1039 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +00001040
Bram Moolenaar97ff9b92016-06-26 20:37:46 +02001041$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001042 $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
Bram Moolenaar85b11762016-02-27 18:13:23 +01001043 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001044 version.c version.h
Bram Moolenaarb6356332005-07-18 21:40:44 +00001045 $(CC) $(CFLAGS) version.c
Bram Moolenaar97ff9b92016-06-26 20:37:46 +02001046 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(CUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001047 $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
Bram Moolenaar85b11762016-02-27 18:13:23 +01001048 $(TCL_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001049 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaarb7776182014-05-22 16:29:06 +02001050 if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001051
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001052$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +00001053
1054$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00001055 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001056
1057install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001058 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +02001059 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +00001060 - if exist install.exe del install.exe
1061 ren dosinst.exe install.exe
1062
1063uninstal.exe: uninstal.c
1064 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
1065
1066vimrun.exe: vimrun.c
1067 $(CC) /nologo -DNDEBUG vimrun.c
1068
1069xxd/xxd.exe: xxd/xxd.c
1070 cd xxd
1071 $(MAKE) /NOLOGO -f Make_mvc.mak
1072 cd ..
1073
Bram Moolenaar24db7292016-01-03 16:56:10 +01001074tee/tee.exe: tee/tee.c
1075 cd tee
1076 $(MAKE) /NOLOGO -f Make_mvc.mak
1077 cd ..
1078
Bram Moolenaar071d4272004-06-13 20:20:40 +00001079GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
1080 cd GvimExt
1081 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
1082 cd ..
1083
1084
1085tags: notags
1086 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
1087
1088notags:
1089 - if exist tags del tags
1090
1091clean:
Bram Moolenaar02743632005-07-25 20:42:36 +00001092 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001093 - if exist *.obj del *.obj
1094 - if exist $(VIM).exe del $(VIM).exe
1095 - if exist $(VIM).ilk del $(VIM).ilk
1096 - if exist $(VIM).pdb del $(VIM).pdb
1097 - if exist $(VIM).map del $(VIM).map
1098 - if exist $(VIM).ncb del $(VIM).ncb
1099 - if exist vimrun.exe del vimrun.exe
1100 - if exist install.exe del install.exe
1101 - if exist uninstal.exe del uninstal.exe
1102 - if exist if_perl.c del if_perl.c
1103 - if exist dimm.h del dimm.h
1104 - if exist dimm_i.c del dimm_i.c
1105 - if exist dimm.tlb del dimm.tlb
1106 - if exist dosinst.exe del dosinst.exe
1107 cd xxd
1108 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1109 cd ..
Bram Moolenaard08a8d42016-01-10 15:20:29 +01001110 cd tee
1111 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1112 cd ..
Bram Moolenaar071d4272004-06-13 20:20:40 +00001113 cd GvimExt
1114 $(MAKE) /NOLOGO -f Makefile clean
1115 cd ..
1116 cd GvimExt
1117 $(MAKE) /NOLOGO -f Makefile clean
1118 cd ..
1119 - if exist testdir\*.out del testdir\*.out
1120
1121test:
1122 cd testdir
1123 $(MAKE) /NOLOGO -f Make_dos.mak win32
1124 cd ..
1125
Bram Moolenaar7eae47a2016-01-01 17:49:44 +01001126testgvim:
1127 cd testdir
1128 $(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\gvim win32
1129 cd ..
1130
Bram Moolenaar34114692005-01-02 11:28:13 +00001131testclean:
1132 cd testdir
1133 $(MAKE) /NOLOGO -f Make_dos.mak clean
1134 cd ..
1135
Bram Moolenaar071d4272004-06-13 20:20:40 +00001136###########################################################################
1137
1138# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
1139# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +01001140!IF "$(_NMAKE_VER)" == ""
Bram Moolenaar071d4272004-06-13 20:20:40 +00001141.c{$(OUTDIR)/}.obj:
1142!ELSE
1143.c{$(OUTDIR)/}.obj::
1144!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001145 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001146
1147# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
1148# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +01001149!IF "$(_NMAKE_VER)" == ""
Bram Moolenaar071d4272004-06-13 20:20:40 +00001150.cpp{$(OUTDIR)/}.obj:
1151!ELSE
1152.cpp{$(OUTDIR)/}.obj::
1153!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001154 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001155
Bram Moolenaar75464dc2016-07-02 20:27:50 +02001156$(OUTDIR)/arabic.obj: $(OUTDIR) arabic.c $(INCL)
1157
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001158$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
1159
Bram Moolenaaredac1852010-05-18 20:34:20 +02001160$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001161
Bram Moolenaar071d4272004-06-13 20:20:40 +00001162$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
1163
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001164$(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL)
1165
1166$(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c $(INCL)
1167
Bram Moolenaar6583c442016-07-17 18:41:47 +02001168$(OUTDIR)/dict.obj: $(OUTDIR) dictf.c $(INCL)
1169
Bram Moolenaar071d4272004-06-13 20:20:40 +00001170$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
1171
1172$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
1173
1174$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
1175
1176$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
1177
1178$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
1179
1180$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
1181
1182$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
1183
1184$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
1185
1186$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
1187
Bram Moolenaar75464dc2016-07-02 20:27:50 +02001188$(OUTDIR)/farsi.obj: $(OUTDIR) farsi.c $(INCL)
1189
Bram Moolenaar071d4272004-06-13 20:20:40 +00001190$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
1191
1192$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
1193
1194$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
1195
Bram Moolenaar58d98232005-07-23 22:25:46 +00001196$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
1197
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001198$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +00001199
Bram Moolenaar071d4272004-06-13 20:20:40 +00001200$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
1201
Bram Moolenaar52b4b552005-03-07 23:00:57 +00001202$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
1203
Bram Moolenaarcf7164a2016-02-20 13:55:06 +01001204$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c $(INCL) $(GUI_INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001205
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +02001206$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
1207
Bram Moolenaar071d4272004-06-13 20:20:40 +00001208$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
1209
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001210$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
1211 $(CC) $(CFLAGS) $(LUA_INC) if_lua.c
1212
Bram Moolenaar071d4272004-06-13 20:20:40 +00001213if_perl.c : if_perl.xs typemap
Bram Moolenaar612af432011-09-14 10:49:46 +02001214 $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001215 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001216
1217$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001218 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001219
1220$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001221 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001222
Bram Moolenaar75676462013-01-30 14:55:42 +01001223$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +00001224 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaar4e640bd2016-01-16 16:20:38 +01001225 -DMZSCHEME_COLLECTS="\"$(MZSCHEME_COLLECTS:\=\\)\""
1226
1227lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib:
1228 lib /DEF:"$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def"
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001229
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001230$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001231 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001232
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001233$(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL)
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001234 $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c
1235
Bram Moolenaar071d4272004-06-13 20:20:40 +00001236$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
1237
1238$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001239 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001240
Bram Moolenaar071d4272004-06-13 20:20:40 +00001241$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001242 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001243
Bram Moolenaar97ff9b92016-06-26 20:37:46 +02001244$(OUTDIR)/iscygpty.obj: $(OUTDIR) iscygpty.c $(CUI_INCL)
1245 $(CC) $(CFLAGS) iscygpty.c -D_WIN32_WINNT=0x0600 -DUSE_DYNFILEID -DENABLE_STUB_IMPL
1246
Bram Moolenaar520e1e42016-01-23 19:46:28 +01001247$(OUTDIR)/json.obj: $(OUTDIR) json.c $(INCL)
1248
Bram Moolenaar6583c442016-07-17 18:41:47 +02001249$(OUTDIR)/list.obj: $(OUTDIR) list.c $(INCL)
1250
Bram Moolenaar97ff9b92016-06-26 20:37:46 +02001251$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL) $(CUI_INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001252
1253$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
1254
1255$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
1256
1257$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1258
1259$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1260
1261$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1262
1263$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1264
1265$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1266
1267$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1268
1269$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1270
1271$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1272
Bram Moolenaare0874f82016-01-24 20:36:41 +01001273$(OUTDIR)/channel.obj: $(OUTDIR) channel.c $(INCL)
1274
Bram Moolenaar071d4272004-06-13 20:20:40 +00001275$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1276
1277$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1278
1279$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1280
1281$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1282
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001283$(OUTDIR)/winclip.obj: $(OUTDIR) winclip.c $(INCL)
1284
Bram Moolenaar071d4272004-06-13 20:20:40 +00001285$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1286
1287$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1288
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001289$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1290 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001291
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001292$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001293
Bram Moolenaar071d4272004-06-13 20:20:40 +00001294$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1295
Bram Moolenaarfbc0d2e2013-05-19 19:40:29 +02001296$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c regexp_nfa.c $(INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001297
1298$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1299
1300$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1301
Bram Moolenaaredac1852010-05-18 20:34:20 +02001302$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1303
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001304$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1305
Bram Moolenaar071d4272004-06-13 20:20:40 +00001306$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1307
1308$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1309
1310$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1311
1312$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1313
1314$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1315
Bram Moolenaar6583c442016-07-17 18:41:47 +02001316$(OUTDIR)/userfunc.obj: $(OUTDIR) userfunc.c $(INCL)
1317
Bram Moolenaar071d4272004-06-13 20:20:40 +00001318$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1319
1320$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001321 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001322
Bram Moolenaarcc448b32010-07-14 16:52:17 +02001323$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
1324 tearoff.bmp vim.ico vim_error.ico \
1325 vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaarbc073092016-02-02 18:50:45 +01001326 $(RC) /nologo /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
Bram Moolenaar071d4272004-06-13 20:20:40 +00001327
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001328iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001329 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1330 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001331
1332dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001333 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001334
1335$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1336
1337$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1338
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001339# $CFLAGS may contain backslashes and double quotes, escape them both.
1340E0_CFLAGS = $(CFLAGS:\=\\)
1341E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001342# ") stop the string
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001343# $LINKARGS2 may contain backslashes and double quotes, escape them both.
1344E0_LINKARGS2 = $(LINKARGS2:\=\\)
1345E_LINKARGS2 = $(E0_LINKARGS2:"=\")
1346# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001347
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001348$(PATHDEF_SRC): auto
1349 @echo creating $(PATHDEF_SRC)
1350 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1351 @echo #include "vim.h" >> $(PATHDEF_SRC)
1352 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1353 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1354 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001355 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC)
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001356 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1357 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001358
1359auto:
1360 if not exist auto/nul mkdir auto
1361
1362# End Custom Build
1363proto.h: \
Bram Moolenaar75464dc2016-07-02 20:27:50 +02001364 proto/arabic.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001365 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001366 proto/buffer.pro \
1367 proto/charset.pro \
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001368 proto/crypt.pro \
1369 proto/crypt_zip.pro \
Bram Moolenaar6583c442016-07-17 18:41:47 +02001370 proto/dict.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001371 proto/diff.pro \
1372 proto/digraph.pro \
1373 proto/edit.pro \
1374 proto/eval.pro \
1375 proto/ex_cmds.pro \
1376 proto/ex_cmds2.pro \
1377 proto/ex_docmd.pro \
1378 proto/ex_eval.pro \
1379 proto/ex_getln.pro \
Bram Moolenaar75464dc2016-07-02 20:27:50 +02001380 proto/farsi.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001381 proto/fileio.pro \
1382 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001383 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001384 proto/hashtab.pro \
Bram Moolenaar520e1e42016-01-23 19:46:28 +01001385 proto/json.pro \
Bram Moolenaar6583c442016-07-17 18:41:47 +02001386 proto/list.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001387 proto/main.pro \
1388 proto/mark.pro \
1389 proto/memfile.pro \
1390 proto/memline.pro \
1391 proto/menu.pro \
1392 proto/message.pro \
1393 proto/misc1.pro \
1394 proto/misc2.pro \
1395 proto/move.pro \
1396 proto/mbyte.pro \
1397 proto/normal.pro \
1398 proto/ops.pro \
1399 proto/option.pro \
1400 proto/os_mswin.pro \
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001401 proto/winclip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001402 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001403 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001404 proto/quickfix.pro \
1405 proto/regexp.pro \
1406 proto/screen.pro \
1407 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001408 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001409 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001410 proto/syntax.pro \
1411 proto/tag.pro \
1412 proto/term.pro \
1413 proto/ui.pro \
1414 proto/undo.pro \
Bram Moolenaar6583c442016-07-17 18:41:47 +02001415 proto/userfunc.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001416 proto/window.pro \
Bram Moolenaare0874f82016-01-24 20:36:41 +01001417 $(NETBEANS_PRO) \
1418 $(CHANNEL_PRO)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001419
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001420.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001421
1422# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1423# foo.cod"
1424.c.cod:
1425 $(CC) $(CFLAGS) /FAcs $<
1426
1427# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1428.c.i:
1429 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001430
1431
Bram Moolenaar071d4272004-06-13 20:20:40 +00001432# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: