blob: c4529b72bdf31e456eff60f4a9c4b7013b5c4e55 [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 Moolenaar8cd213c2010-06-01 21:57:09 +0200258# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200259WP64CHECK = /Wp64
Bram Moolenaar071d4272004-06-13 20:20:40 +0000260
261#>>>>> path of the compiler and linker; name of include and lib directories
262# PATH = c:\msvc20\bin;$(PATH)
263# INCLUDE = c:\msvc20\include
264# LIB = c:\msvc20\lib
265
Bram Moolenaar76929af2016-06-02 20:26:41 +0200266!if "$(FEATURES)"==""
267FEATURES = HUGE
268!endif
269
Bram Moolenaar071d4272004-06-13 20:20:40 +0000270!ifndef CTAGS
271CTAGS = ctags
272!endif
273
Bram Moolenaar071d4272004-06-13 20:20:40 +0000274!ifndef CSCOPE
275CSCOPE = yes
276!endif
277
278!if "$(CSCOPE)" == "yes"
279# CSCOPE - Include support for Cscope
280CSCOPE_INCL = if_cscope.h
281CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
282CSCOPE_DEFS = -DFEAT_CSCOPE
283!endif
284
285!ifndef NETBEANS
286NETBEANS = $(GUI)
287!endif
288
Bram Moolenaare0874f82016-01-24 20:36:41 +0100289!ifndef CHANNEL
Bram Moolenaar76929af2016-06-02 20:26:41 +0200290!if "$(FEATURES)"=="HUGE"
291CHANNEL = yes
292!else
Bram Moolenaare0874f82016-01-24 20:36:41 +0100293CHANNEL = $(GUI)
294!endif
Bram Moolenaar76929af2016-06-02 20:26:41 +0200295!endif
Bram Moolenaare0874f82016-01-24 20:36:41 +0100296
297# Only allow NETBEANS and XPM for a GUI build and CHANNEL.
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000298!if "$(GUI)" == "yes"
Bram Moolenaare0874f82016-01-24 20:36:41 +0100299!if "$(NETBEANS)" == "yes" && "$(CHANNEL)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000300# NETBEANS - Include support for Netbeans integration
301NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000302NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000303NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000304
305!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000306NBDEBUG_DEFS = -DNBDEBUG
307NBDEBUG_INCL = nbdebug.h
308NBDEBUG_SRC = nbdebug.c
309!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000310NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000311!endif
312
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200313# DirectWrite(DirectX)
314!if "$(DIRECTX)" == "yes"
315DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
316DIRECTX_INCL = gui_dwrite.h
317DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj
318!endif
319
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200320!ifndef XPM
321# XPM is not set, use the included xpm files, depending on the architecture.
Bram Moolenaare2db4362012-09-05 17:57:39 +0200322!if "$(CPU)" == "AMD64"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200323XPM = xpm\x64
Bram Moolenaare2db4362012-09-05 17:57:39 +0200324!elseif "$(CPU)" == "i386"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200325XPM = xpm\x86
Bram Moolenaare2db4362012-09-05 17:57:39 +0200326!else
327XPM = no
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200328!endif
329!endif
330!if "$(XPM)" != "no"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000331# XPM - Include support for XPM signs
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200332# See the xpm directory for more information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000333XPM_OBJ = $(OBJDIR)/xpm_w32.obj
334XPM_DEFS = -DFEAT_XPM_W32
335XPM_LIB = $(XPM)\lib\libXpm.lib
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200336XPM_INC = -I $(XPM)\include -I $(XPM)\..\include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000337!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000338!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000339
Bram Moolenaare0874f82016-01-24 20:36:41 +0100340!if "$(CHANNEL)" == "yes"
341CHANNEL_PRO = proto/channel.pro
342CHANNEL_OBJ = $(OBJDIR)/channel.obj
Bram Moolenaar509ce2a2016-03-11 22:52:15 +0100343CHANNEL_DEFS = -DFEAT_JOB_CHANNEL
Bram Moolenaare0874f82016-01-24 20:36:41 +0100344
345NETBEANS_LIB = WSock32.lib
346!endif
347
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000348# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000349!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000350# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000351# !elseif defined(MULTITHREADED)
352# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000353!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000354# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000355# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000356!endif
357
358# need advapi32.lib for GetUserName()
359# need shell32.lib for ExtractIcon()
360# gdi32.lib and comdlg32.lib for printing support
361# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000362CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200363 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000364!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000365CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
366!endif
367
368### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000369!ifndef WINVER
Bram Moolenaar223b7232016-02-19 19:43:49 +0100370WINVER = 0x0501
Bram Moolenaar071d4272004-06-13 20:20:40 +0000371!endif
372
373# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
374# default, use these lines.
375#VIMRCLOC = somewhere
376#VIMRUNTIMEDIR = somewhere
377
378CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
Bram Moolenaar85b11762016-02-27 18:13:23 +0100379 $(CSCOPE_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000380 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000381 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
382 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000383
384#>>>>> end of choices
385###########################################################################
386
387!ifdef OS
388OS_TYPE = winnt
389DEL_TREE = rmdir /s /q
390!else
391OS_TYPE = win95
392DEL_TREE = deltree /y
393!endif
394
395INTDIR=$(OBJDIR)
396OUTDIR=$(OBJDIR)
397
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100398!if [echo MSVCVER=_MSC_VER> msvcver.c && $(CC) /EP msvcver.c > msvcver.~ 2> nul]
399!message *** ERROR
400!message Cannot run Visual C to determine its version. Make sure cl.exe is in your PATH.
401!message This can usually be done by running "vcvarsall.bat", located in the bin directory where Visual Studio was installed.
402!error Make aborted.
403!else
404!include msvcver.~
405!if [del msvcver.c msvcver.~]
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200406!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000407!endif
408
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100409!if $(MSVCVER) < 1900
410MSVC_MAJOR = ($(MSVCVER) / 100 - 6)
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100411MSVCRT_VER = ($(MSVCVER) / 10 - 60)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100412!else
413MSVC_MAJOR = ($(MSVCVER) / 100 - 5)
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100414MSVCRT_VER = ($(MSVCVER) / 10 - 50)
415!endif
416
417# Calculate MSVCRT_VER
418!if [(set /a MSVCRT_VER="$(MSVCRT_VER)" > nul) && set MSVCRT_VER > msvcrtver.~] == 0
419!include msvcrtver.~
420!if [del msvcrtver.~]
421!endif
422!endif
423
424# Base name of the msvcrXX.dll
425!if $(MSVCRT_VER) <= 60
426MSVCRT_NAME = msvcrt
427!else
428MSVCRT_NAME = msvcr$(MSVCRT_VER)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100429!endif
430
431!if $(MSVC_MAJOR) == 6
432CPU = ix86
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000433!endif
434
Bram Moolenaar071d4272004-06-13 20:20:40 +0000435# Convert processor ID to MVC-compatible number
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100436!if $(MSVC_MAJOR) < 8
Bram Moolenaar071d4272004-06-13 20:20:40 +0000437!if "$(CPUNR)" == "i386"
438CPUARG = /G3
439!elseif "$(CPUNR)" == "i486"
440CPUARG = /G4
441!elseif "$(CPUNR)" == "i586"
442CPUARG = /G5
443!elseif "$(CPUNR)" == "i686"
444CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000445!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000446CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000447!else
448CPUARG =
449!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000450!else
Bram Moolenaar3ed16dc2011-06-12 20:31:31 +0200451# VC8/9/10 only allows specifying SSE architecture but only for 32bit
Bram Moolenaar6b903512015-12-11 19:38:44 +0100452!if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "pentium4"
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000453CPUARG = /arch:SSE2
454!endif
455!endif
456
457LIBC =
458DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000459
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200460# Don't use /nodefaultlib on MSVC 14
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100461!if $(MSVC_MAJOR) >= 14
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200462NODEFAULTLIB =
463!else
464NODEFAULTLIB = /nodefaultlib
465!endif
466
Bram Moolenaar071d4272004-06-13 20:20:40 +0000467!ifdef NODEBUG
468VIM = vim
469!if "$(OPTIMIZE)" == "SPACE"
470OPTFLAG = /O1
471!elseif "$(OPTIMIZE)" == "SPEED"
472OPTFLAG = /O2
473!else # MAXSPEED
474OPTFLAG = /Ox
475!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200476
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100477!if $(MSVC_MAJOR) >= 8
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000478# Use link time code generation if not worried about size
479!if "$(OPTIMIZE)" != "SPACE"
480OPTFLAG = $(OPTFLAG) /GL
481!endif
482!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200483
484# (/Wp64 is deprecated in VC9 and generates an obnoxious warning.)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100485!if ($(MSVC_MAJOR) == 7) || ($(MSVC_MAJOR) == 8)
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200486CFLAGS=$(CFLAGS) $(WP64CHECK)
487!endif
488
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100489# Static code analysis generally available starting with VS2012 (VC11) or
490# Windows SDK 7.1 (VC10)
491!if ("$(ANALYZE)" == "yes") && ($(MSVC_MAJOR) >= 10)
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200492CFLAGS=$(CFLAGS) /analyze
493!endif
494
Bram Moolenaar34114692005-01-02 11:28:13 +0000495CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000496RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000497! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000498CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000499LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000500! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000501LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000502CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000503! endif
504!else # DEBUG
505VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000506! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000507DEBUGINFO = /ZI
508! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000509CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000510RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
511# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100512! if $(MSVC_MAJOR) == 4
Bram Moolenaar071d4272004-06-13 20:20:40 +0000513LIBC =
514! else
515LIBC = /fixed:no
516! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000517! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000518CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000519LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000520! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000521LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000522CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000523! endif
524!endif # DEBUG
525
526INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
Bram Moolenaar85b11762016-02-27 18:13:23 +0100527 proto.h option.h structs.h term.h $(CSCOPE_INCL) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000528 $(NBDEBUG_INCL)
529
530OBJ = \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200531 $(OUTDIR)\blowfish.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000532 $(OUTDIR)\buffer.obj \
533 $(OUTDIR)\charset.obj \
Bram Moolenaar07cf3822014-08-10 16:31:50 +0200534 $(OUTDIR)\crypt.obj \
535 $(OUTDIR)\crypt_zip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536 $(OUTDIR)\diff.obj \
537 $(OUTDIR)\digraph.obj \
538 $(OUTDIR)\edit.obj \
539 $(OUTDIR)\eval.obj \
540 $(OUTDIR)\ex_cmds.obj \
541 $(OUTDIR)\ex_cmds2.obj \
542 $(OUTDIR)\ex_docmd.obj \
543 $(OUTDIR)\ex_eval.obj \
544 $(OUTDIR)\ex_getln.obj \
545 $(OUTDIR)\fileio.obj \
546 $(OUTDIR)\fold.obj \
547 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000548 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000549 $(OUTDIR)\hashtab.obj \
Bram Moolenaar520e1e42016-01-23 19:46:28 +0100550 $(OUTDIR)\json.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000551 $(OUTDIR)\main.obj \
552 $(OUTDIR)\mark.obj \
553 $(OUTDIR)\mbyte.obj \
554 $(OUTDIR)\memfile.obj \
555 $(OUTDIR)\memline.obj \
556 $(OUTDIR)\menu.obj \
557 $(OUTDIR)\message.obj \
558 $(OUTDIR)\misc1.obj \
559 $(OUTDIR)\misc2.obj \
560 $(OUTDIR)\move.obj \
561 $(OUTDIR)\normal.obj \
562 $(OUTDIR)\ops.obj \
563 $(OUTDIR)\option.obj \
564 $(OUTDIR)\os_mswin.obj \
Bram Moolenaar693e40c2013-02-26 14:56:42 +0100565 $(OUTDIR)\winclip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000566 $(OUTDIR)\os_win32.obj \
567 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000568 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000569 $(OUTDIR)\quickfix.obj \
570 $(OUTDIR)\regexp.obj \
571 $(OUTDIR)\screen.obj \
572 $(OUTDIR)\search.obj \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200573 $(OUTDIR)\sha256.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000574 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000575 $(OUTDIR)\syntax.obj \
576 $(OUTDIR)\tag.obj \
577 $(OUTDIR)\term.obj \
578 $(OUTDIR)\ui.obj \
579 $(OUTDIR)\undo.obj \
580 $(OUTDIR)\window.obj \
581 $(OUTDIR)\vim.res
582
583!if "$(OLE)" == "yes"
584CFLAGS = $(CFLAGS) -DFEAT_OLE
585RCFLAGS = $(RCFLAGS) -DFEAT_OLE
586OLE_OBJ = $(OUTDIR)\if_ole.obj
587OLE_IDL = if_ole.idl
588OLE_LIB = oleaut32.lib
589!endif
590
591!if "$(IME)" == "yes"
592CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
593!ifndef DYNAMIC_IME
594DYNAMIC_IME = yes
595!endif
596!if "$(DYNAMIC_IME)" == "yes"
597CFLAGS = $(CFLAGS) -DDYNAMIC_IME
598!else
599IME_LIB = imm32.lib
600!endif
601!endif
602
603!if "$(GIME)" == "yes"
604CFLAGS = $(CFLAGS) -DGLOBAL_IME
605OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
606MBYTE = yes
607!endif
608
609!if "$(MBYTE)" == "yes"
610CFLAGS = $(CFLAGS) -DFEAT_MBYTE
611!endif
612
613!if "$(GUI)" == "yes"
614SUBSYSTEM = windows
615CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
616RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
617VIM = g$(VIM)
618GUI_INCL = \
619 gui.h \
620 regexp.h \
621 ascii.h \
622 ex_cmds.h \
623 farsi.h \
624 feature.h \
625 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000626 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000627 keymap.h \
628 macros.h \
629 option.h \
630 os_dos.h \
631 os_win32.h
632GUI_OBJ = \
633 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000634 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000635 $(OUTDIR)\gui_w32.obj \
636 $(OUTDIR)\os_w32exe.obj
637GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000638 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000639 winspool.lib comctl32.lib advapi32.lib shell32.lib \
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200640 /machine:$(CPU)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000641!else
642SUBSYSTEM = console
643!endif
644
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200645!if "$(SUBSYSTEM_VER)" != ""
646SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
647!endif
648
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200649!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
650CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
651GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
652GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
653!endif
654
Bram Moolenaar071d4272004-06-13 20:20:40 +0000655# iconv.dll library (dynamically loaded)
656!ifndef ICONV
657ICONV = yes
658!endif
659!if "$(ICONV)" == "yes"
660CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
661!endif
662
663# libintl.dll library
664!ifndef GETTEXT
665GETTEXT = yes
666!endif
667!if "$(GETTEXT)" == "yes"
668CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
669!endif
670
671# TCL interface
672!ifdef TCL
673!ifndef TCL_VER
674TCL_VER = 83
675TCL_VER_LONG = 8.3
676!endif
677!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
678!if "$(DYNAMIC_TCL)" == "yes"
679!message Tcl DLL will be loaded dynamically
680TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000681CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
682 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000683TCL_OBJ = $(OUTDIR)\if_tcl.obj
684TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
Bram Moolenaar84a4c332012-02-22 16:01:56 +0100685TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000686!else
687CFLAGS = $(CFLAGS) -DFEAT_TCL
688TCL_OBJ = $(OUTDIR)\if_tcl.obj
689TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
690TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
691!endif
692!endif
693
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200694# Lua interface
695!ifdef LUA
696!ifndef LUA_VER
697LUA_VER = 51
698!endif
699!message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)"
700!if "$(DYNAMIC_LUA)" == "yes"
701!message Lua DLL will be loaded dynamically
702!endif
703CFLAGS = $(CFLAGS) -DFEAT_LUA
704LUA_OBJ = $(OUTDIR)\if_lua.obj
705LUA_INC = /I "$(LUA)\include" /I "$(LUA)"
706!if "$(DYNAMIC_LUA)" == "yes"
707CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \
708 -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
709LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib
710!else
711LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib"
712!endif
713!endif
714
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200715!ifdef PYTHON
716!ifdef PYTHON3
717DYNAMIC_PYTHON=yes
718DYNAMIC_PYTHON3=yes
719!endif
720!endif
721
Bram Moolenaar071d4272004-06-13 20:20:40 +0000722# PYTHON interface
723!ifdef PYTHON
724!ifndef PYTHON_VER
725PYTHON_VER = 22
726!endif
727!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
728!if "$(DYNAMIC_PYTHON)" == "yes"
729!message Python DLL will be loaded dynamically
730!endif
731CFLAGS = $(CFLAGS) -DFEAT_PYTHON
732PYTHON_OBJ = $(OUTDIR)\if_python.obj
733PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
734!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000735CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
736 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000737PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
738!else
739PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
740!endif
741!endif
742
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200743# PYTHON3 interface
744!ifdef PYTHON3
745!ifndef PYTHON3_VER
746PYTHON3_VER = 31
747!endif
748!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
749!if "$(DYNAMIC_PYTHON3)" == "yes"
750!message Python3 DLL will be loaded dynamically
751!endif
752CFLAGS = $(CFLAGS) -DFEAT_PYTHON3
753PYTHON3_OBJ = $(OUTDIR)\if_python3.obj
754PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC"
755!if "$(DYNAMIC_PYTHON3)" == "yes"
756CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \
757 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
758PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib
759!else
760PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
761!endif
762!endif
763
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000764# MzScheme interface
765!ifdef MZSCHEME
766!message MzScheme requested - root dir is "$(MZSCHEME)"
767!ifndef MZSCHEME_VER
768MZSCHEME_VER = 205_000
769!endif
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100770!ifndef MZSCHEME_COLLECTS
771MZSCHEME_COLLECTS=$(MZSCHEME)\collects
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000772!endif
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100773CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I "$(MZSCHEME)\include"
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100774!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib")
775MZSCHEME_MAIN_LIB=mzsch
776!else
777MZSCHEME_MAIN_LIB=racket
778!endif
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100779!if (EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll") \
780 && !EXIST("$(MZSCHEME)\lib\libmzgc$(MZSCHEME_VER).dll")) \
781 || (EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
782 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib"))
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000783!message Building with Precise GC
784MZSCHEME_PRECISE_GC = yes
785CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
786!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000787!if "$(DYNAMIC_MZSCHEME)" == "yes"
788!message MzScheme DLLs will be loaded dynamically
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100789CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME
790!if "$(MZSCHEME_PRECISE_GC)" == "yes"
791# Precise GC does not use separate dll
792CFLAGS = $(CFLAGS) \
793 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
794 -DDYNAMIC_MZGC_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\"
795!else
796CFLAGS = $(CFLAGS) \
797 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
798 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
799!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000800!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000801!if "$(MZSCHEME_DEBUG)" == "yes"
802CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
803!endif
804!if "$(MZSCHEME_PRECISE_GC)" == "yes"
805# Precise GC does not use separate dll
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100806!if EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def")
807# create .lib from .def
808MZSCHEME_LIB = lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
809MZSCHEME_EXTRA_DEP = lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000810!else
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100811MZSCHEME_LIB = "$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib"
812!endif
813!else
814MZSCHEME_LIB = "$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib" \
815 "$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib"
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000816!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000817!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000818MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
Bram Moolenaarbbc98db2012-02-12 01:55:55 +0100819# increase stack size
820MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000821!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000822
Bram Moolenaar071d4272004-06-13 20:20:40 +0000823# Perl interface
824!ifdef PERL
825!ifndef PERL_VER
826PERL_VER = 56
827!endif
828!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
829!if "$(DYNAMIC_PERL)" == "yes"
830!if $(PERL_VER) >= 56
831!message Perl DLL will be loaded dynamically
832!else
833!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
834!message Reverting to static loading...
835!undef DYNAMIC_PERL
836!endif
837!endif
838
839# Is Perl installed in architecture-specific directories?
840!if exist($(PERL)\Bin\MSWin32-x86)
841PERL_ARCH = \MSWin32-x86
842!endif
843
844PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
845
846# Version-dependent stuff
847!if $(PERL_VER) == 55
848PERL_LIB = $(PERL_INCDIR)\perl.lib
849!else
850PERL_DLL = perl$(PERL_VER).dll
Bram Moolenaar207fd752013-12-14 11:50:35 +0100851!if exist($(PERL_INCDIR)\perl$(PERL_VER).lib)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000852PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
Bram Moolenaar207fd752013-12-14 11:50:35 +0100853!else
854# For ActivePerl 5.18 and later
855PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a
856!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000857!endif
858
Bram Moolenaar367fbf12015-06-25 16:13:46 +0200859CFLAGS = $(CFLAGS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000860
861# Do we want to load Perl dynamically?
862!if "$(DYNAMIC_PERL)" == "yes"
863CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
864!undef PERL_LIB
865!endif
866
867PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
868PERL_INC = /I $(PERL_INCDIR)
Bram Moolenaar2bf24172015-12-31 20:54:51 +0100869!if $(MSVC_MAJOR) <= 11
870# ActivePerl 5.20+ requires stdbool.h but VC2012 or earlier doesn't have it.
871# Use a stub stdbool.h.
872PERL_INC = $(PERL_INC) /I if_perl_msvc
873!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000874PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
875XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
Bram Moolenaar52f83172011-09-14 19:01:42 +0200876!if exist($(XSUBPP))
Bram Moolenaar612af432011-09-14 10:49:46 +0200877XSUBPP = $(PERL_EXE) $(XSUBPP)
878!else
879XSUBPP = xsubpp
880!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000881XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
882
883!endif
884
885#
886# Support Ruby interface
887#
888!ifdef RUBY
889# Set default value
890!ifndef RUBY_VER
891RUBY_VER = 18
892!endif
893!ifndef RUBY_VER_LONG
894RUBY_VER_LONG = 1.8
895!endif
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200896!ifndef RUBY_API_VER
897RUBY_API_VER = $(RUBY_VER_LONG:.=)
898!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000899
900!if $(RUBY_VER) >= 18
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100901
Bram Moolenaar071d4272004-06-13 20:20:40 +0000902!ifndef RUBY_PLATFORM
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100903!if "$(CPU)" == "i386"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000904RUBY_PLATFORM = i386-mswin32
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100905!else # CPU
906RUBY_PLATFORM = x64-mswin64
907!endif # CPU
908!if $(MSVCRT_VER) >= 70
909RUBY_PLATFORM = $(RUBY_PLATFORM)_$(MSVCRT_VER)
910!endif # MSVCRT_VER
911!endif # RUBY_PLATFORM
912
Bram Moolenaar071d4272004-06-13 20:20:40 +0000913!ifndef RUBY_INSTALL_NAME
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100914!ifndef RUBY_MSVCRT_NAME
915# Base name of msvcrXX.dll which is used by ruby's dll.
916RUBY_MSVCRT_NAME = $(MSVCRT_NAME)
917!endif # RUBY_MSVCRT_NAME
918!if "$(CPU)" == "i386"
919RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
920!else # CPU
921RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
922!endif # CPU
923!endif # RUBY_INSTALL_NAME
924
925!else # $(RUBY_VER) >= 18
926
Bram Moolenaar071d4272004-06-13 20:20:40 +0000927!ifndef RUBY_PLATFORM
928RUBY_PLATFORM = i586-mswin32
929!endif
930!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200931RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000932!endif
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100933
Bram Moolenaar071d4272004-06-13 20:20:40 +0000934!endif # $(RUBY_VER) >= 18
935
936!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
937CFLAGS = $(CFLAGS) -DFEAT_RUBY
938RUBY_OBJ = $(OUTDIR)\if_ruby.obj
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200939!if $(RUBY_VER) >= 19
940RUBY_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 +0200941!else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000942RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
Bram Moolenaar69154f22010-07-18 21:42:34 +0200943!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000944RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
945# Do we want to load Ruby dynamically?
946!if "$(DYNAMIC_RUBY)" == "yes"
947!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000948CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
949 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000950!undef RUBY_LIB
951!endif
952!endif # RUBY
953
954#
955# Support PostScript printing
956#
957!if "$(POSTSCRIPT)" == "yes"
958CFLAGS = $(CFLAGS) -DMSWINPS
959!endif # POSTSCRIPT
960
961#
962# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
963#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000964CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
965
966#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000967# Always generate the .pdb file, so that we get debug symbols that can be used
968# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000969# Generate edit-and-continue debug info when no optimization - allows to
970# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000971#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000972CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
973LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000974
975#
976# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000977#
978!message
979
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000980conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000981
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000982PATHDEF_SRC = $(OUTDIR)\pathdef.c
983
Bram Moolenaar071d4272004-06-13 20:20:40 +0000984!IF "$(MAP)" == "yes"
985# "/map" is for debugging
986conflags = $(conflags) /map
987!ELSEIF "$(MAP)" == "lines"
988# "/mapinfo:lines" is for debugging, only works for VC6 and later
989conflags = $(conflags) /map /mapinfo:lines
990!ENDIF
991
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000992LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar85b11762016-02-27 18:13:23 +0100993LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200994 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000995 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000996
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000997# Report link time code generation progress if used.
998!ifdef NODEBUG
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100999!if $(MSVC_MAJOR) >= 8
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001000!if "$(OPTIMIZE)" != "SPACE"
1001LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
1002!endif
1003!endif
1004!endif
1005
Bram Moolenaar24db7292016-01-03 16:56:10 +01001006all: $(VIM).exe \
1007 vimrun.exe \
1008 install.exe \
1009 uninstal.exe \
1010 xxd/xxd.exe \
1011 tee/tee.exe \
1012 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +00001013
Bram Moolenaarb6356332005-07-18 21:40:44 +00001014$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001015 $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
Bram Moolenaar85b11762016-02-27 18:13:23 +01001016 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) $(XPM_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001017 version.c version.h
Bram Moolenaarb6356332005-07-18 21:40:44 +00001018 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +00001019 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001020 $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
Bram Moolenaar85b11762016-02-27 18:13:23 +01001021 $(TCL_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(CHANNEL_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001022 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaarb7776182014-05-22 16:29:06 +02001023 if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001024
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001025$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +00001026
1027$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00001028 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001029
1030install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001031 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +02001032 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +00001033 - if exist install.exe del install.exe
1034 ren dosinst.exe install.exe
1035
1036uninstal.exe: uninstal.c
1037 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
1038
1039vimrun.exe: vimrun.c
1040 $(CC) /nologo -DNDEBUG vimrun.c
1041
1042xxd/xxd.exe: xxd/xxd.c
1043 cd xxd
1044 $(MAKE) /NOLOGO -f Make_mvc.mak
1045 cd ..
1046
Bram Moolenaar24db7292016-01-03 16:56:10 +01001047tee/tee.exe: tee/tee.c
1048 cd tee
1049 $(MAKE) /NOLOGO -f Make_mvc.mak
1050 cd ..
1051
Bram Moolenaar071d4272004-06-13 20:20:40 +00001052GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
1053 cd GvimExt
1054 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
1055 cd ..
1056
1057
1058tags: notags
1059 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
1060
1061notags:
1062 - if exist tags del tags
1063
1064clean:
Bram Moolenaar02743632005-07-25 20:42:36 +00001065 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001066 - if exist *.obj del *.obj
1067 - if exist $(VIM).exe del $(VIM).exe
1068 - if exist $(VIM).ilk del $(VIM).ilk
1069 - if exist $(VIM).pdb del $(VIM).pdb
1070 - if exist $(VIM).map del $(VIM).map
1071 - if exist $(VIM).ncb del $(VIM).ncb
1072 - if exist vimrun.exe del vimrun.exe
1073 - if exist install.exe del install.exe
1074 - if exist uninstal.exe del uninstal.exe
1075 - if exist if_perl.c del if_perl.c
1076 - if exist dimm.h del dimm.h
1077 - if exist dimm_i.c del dimm_i.c
1078 - if exist dimm.tlb del dimm.tlb
1079 - if exist dosinst.exe del dosinst.exe
1080 cd xxd
1081 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1082 cd ..
Bram Moolenaard08a8d42016-01-10 15:20:29 +01001083 cd tee
1084 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1085 cd ..
Bram Moolenaar071d4272004-06-13 20:20:40 +00001086 cd GvimExt
1087 $(MAKE) /NOLOGO -f Makefile clean
1088 cd ..
1089 cd GvimExt
1090 $(MAKE) /NOLOGO -f Makefile clean
1091 cd ..
1092 - if exist testdir\*.out del testdir\*.out
1093
1094test:
1095 cd testdir
1096 $(MAKE) /NOLOGO -f Make_dos.mak win32
1097 cd ..
1098
Bram Moolenaar7eae47a2016-01-01 17:49:44 +01001099testgvim:
1100 cd testdir
1101 $(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\gvim win32
1102 cd ..
1103
Bram Moolenaar34114692005-01-02 11:28:13 +00001104testclean:
1105 cd testdir
1106 $(MAKE) /NOLOGO -f Make_dos.mak clean
1107 cd ..
1108
Bram Moolenaar071d4272004-06-13 20:20:40 +00001109###########################################################################
1110
1111# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
1112# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +01001113!IF "$(_NMAKE_VER)" == ""
Bram Moolenaar071d4272004-06-13 20:20:40 +00001114.c{$(OUTDIR)/}.obj:
1115!ELSE
1116.c{$(OUTDIR)/}.obj::
1117!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001118 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001119
1120# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
1121# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +01001122!IF "$(_NMAKE_VER)" == ""
Bram Moolenaar071d4272004-06-13 20:20:40 +00001123.cpp{$(OUTDIR)/}.obj:
1124!ELSE
1125.cpp{$(OUTDIR)/}.obj::
1126!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001127 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001128
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001129$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
1130
Bram Moolenaaredac1852010-05-18 20:34:20 +02001131$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001132
Bram Moolenaar071d4272004-06-13 20:20:40 +00001133$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
1134
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001135$(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL)
1136
1137$(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c $(INCL)
1138
Bram Moolenaar071d4272004-06-13 20:20:40 +00001139$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
1140
1141$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
1142
1143$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
1144
1145$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
1146
1147$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
1148
1149$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
1150
1151$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
1152
1153$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
1154
1155$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
1156
1157$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
1158
1159$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
1160
1161$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
1162
Bram Moolenaar58d98232005-07-23 22:25:46 +00001163$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
1164
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001165$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +00001166
Bram Moolenaar071d4272004-06-13 20:20:40 +00001167$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
1168
Bram Moolenaar52b4b552005-03-07 23:00:57 +00001169$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
1170
Bram Moolenaarcf7164a2016-02-20 13:55:06 +01001171$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c $(INCL) $(GUI_INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001172
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +02001173$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
1174
Bram Moolenaar071d4272004-06-13 20:20:40 +00001175$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
1176
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001177$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
1178 $(CC) $(CFLAGS) $(LUA_INC) if_lua.c
1179
Bram Moolenaar071d4272004-06-13 20:20:40 +00001180if_perl.c : if_perl.xs typemap
Bram Moolenaar612af432011-09-14 10:49:46 +02001181 $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001182 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001183
1184$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001185 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001186
1187$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001188 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001189
Bram Moolenaar75676462013-01-30 14:55:42 +01001190$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +00001191 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaar4e640bd2016-01-16 16:20:38 +01001192 -DMZSCHEME_COLLECTS="\"$(MZSCHEME_COLLECTS:\=\\)\""
1193
1194lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib:
1195 lib /DEF:"$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def"
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001196
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001197$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001198 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001199
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001200$(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL)
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001201 $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c
1202
Bram Moolenaar071d4272004-06-13 20:20:40 +00001203$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
1204
1205$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001206 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001207
Bram Moolenaar071d4272004-06-13 20:20:40 +00001208$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001209 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001210
Bram Moolenaar520e1e42016-01-23 19:46:28 +01001211$(OUTDIR)/json.obj: $(OUTDIR) json.c $(INCL)
1212
Bram Moolenaar071d4272004-06-13 20:20:40 +00001213$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
1214
1215$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
1216
1217$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
1218
1219$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1220
1221$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1222
1223$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1224
1225$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1226
1227$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1228
1229$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1230
1231$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1232
1233$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1234
Bram Moolenaare0874f82016-01-24 20:36:41 +01001235$(OUTDIR)/channel.obj: $(OUTDIR) channel.c $(INCL)
1236
Bram Moolenaar071d4272004-06-13 20:20:40 +00001237$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1238
1239$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1240
1241$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1242
1243$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1244
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001245$(OUTDIR)/winclip.obj: $(OUTDIR) winclip.c $(INCL)
1246
Bram Moolenaar071d4272004-06-13 20:20:40 +00001247$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1248
1249$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1250
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001251$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1252 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001253
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001254$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001255
Bram Moolenaar071d4272004-06-13 20:20:40 +00001256$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1257
Bram Moolenaarfbc0d2e2013-05-19 19:40:29 +02001258$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c regexp_nfa.c $(INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001259
1260$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1261
1262$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1263
Bram Moolenaaredac1852010-05-18 20:34:20 +02001264$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1265
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001266$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1267
Bram Moolenaar071d4272004-06-13 20:20:40 +00001268$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1269
1270$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1271
1272$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1273
1274$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1275
1276$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1277
1278$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1279
1280$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001281 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001282
Bram Moolenaarcc448b32010-07-14 16:52:17 +02001283$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
1284 tearoff.bmp vim.ico vim_error.ico \
1285 vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaarbc073092016-02-02 18:50:45 +01001286 $(RC) /nologo /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
Bram Moolenaar071d4272004-06-13 20:20:40 +00001287
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001288iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001289 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1290 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001291
1292dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001293 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001294
1295$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1296
1297$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1298
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001299# $CFLAGS may contain backslashes and double quotes, escape them both.
1300E0_CFLAGS = $(CFLAGS:\=\\)
1301E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001302# ") stop the string
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001303# $LINKARGS2 may contain backslashes and double quotes, escape them both.
1304E0_LINKARGS2 = $(LINKARGS2:\=\\)
1305E_LINKARGS2 = $(E0_LINKARGS2:"=\")
1306# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001307
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001308$(PATHDEF_SRC): auto
1309 @echo creating $(PATHDEF_SRC)
1310 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1311 @echo #include "vim.h" >> $(PATHDEF_SRC)
1312 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1313 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1314 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001315 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC)
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001316 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1317 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001318
1319auto:
1320 if not exist auto/nul mkdir auto
1321
1322# End Custom Build
1323proto.h: \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001324 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001325 proto/buffer.pro \
1326 proto/charset.pro \
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001327 proto/crypt.pro \
1328 proto/crypt_zip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001329 proto/diff.pro \
1330 proto/digraph.pro \
1331 proto/edit.pro \
1332 proto/eval.pro \
1333 proto/ex_cmds.pro \
1334 proto/ex_cmds2.pro \
1335 proto/ex_docmd.pro \
1336 proto/ex_eval.pro \
1337 proto/ex_getln.pro \
1338 proto/fileio.pro \
1339 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001340 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001341 proto/hashtab.pro \
Bram Moolenaar520e1e42016-01-23 19:46:28 +01001342 proto/json.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001343 proto/main.pro \
1344 proto/mark.pro \
1345 proto/memfile.pro \
1346 proto/memline.pro \
1347 proto/menu.pro \
1348 proto/message.pro \
1349 proto/misc1.pro \
1350 proto/misc2.pro \
1351 proto/move.pro \
1352 proto/mbyte.pro \
1353 proto/normal.pro \
1354 proto/ops.pro \
1355 proto/option.pro \
1356 proto/os_mswin.pro \
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001357 proto/winclip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001358 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001359 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001360 proto/quickfix.pro \
1361 proto/regexp.pro \
1362 proto/screen.pro \
1363 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001364 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001365 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001366 proto/syntax.pro \
1367 proto/tag.pro \
1368 proto/term.pro \
1369 proto/ui.pro \
1370 proto/undo.pro \
1371 proto/window.pro \
Bram Moolenaare0874f82016-01-24 20:36:41 +01001372 $(NETBEANS_PRO) \
1373 $(CHANNEL_PRO)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001374
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001375.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001376
1377# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1378# foo.cod"
1379.c.cod:
1380 $(CC) $(CFLAGS) /FAcs $<
1381
1382# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1383.c.i:
1384 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001385
1386
Bram Moolenaar071d4272004-06-13 20:20:40 +00001387# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: