blob: 6f0b84391c4352d18f048e07089461b74f20efcb [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 Moolenaar884f6e42013-05-19 21:03:54 +020023# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is BIG)
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#
85# SNiFF+ interface: SNIFF=yes
86#
87# Cscope support: CSCOPE=yes
88#
89# Iconv library support (always dynamically loaded):
90# ICONV=[yes or no] (default is yes)
91#
92# Intl library support (always dynamically loaded):
93# GETTEXT=[yes or no] (default is yes)
94# See http://sourceforge.net/projects/gettext/
95#
Bram Moolenaar884f6e42013-05-19 21:03:54 +020096# PostScript printing: POSTSCRIPT=yes (default is no)
Bram Moolenaar7887d882005-07-01 22:33:52 +000097#
Bram Moolenaar884f6e42013-05-19 21:03:54 +020098# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
Bram Moolenaar7887d882005-07-01 22:33:52 +000099#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200100# XPM Image Support: XPM=[path to XPM directory]
101# Default is "xpm", using the files included in the distribution.
102# Use "no" to disable this feature.
Bram Moolenaar7887d882005-07-01 22:33:52 +0000103#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200104# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000105#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200106# Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
107# i386)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000108#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200109# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000110#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000111# Debug version: DEBUG=yes
112# Mapfile: MAP=[no, yes or lines] (default is yes)
113# no: Don't write a mapfile.
114# yes: Write a normal mapfile.
115# lines: Write a mapfile with line numbers (only for VC6 and later)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000116#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200117# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
118# doesn't work)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000119#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200120# Static Code Analysis: ANALYZE=yes (works with VS2012 only)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000121#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000122# You can combine any of these interfaces
123#
124# Example: To build the non-debug, GUI version with Perl interface:
125# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
126#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000127# DEBUG with Make_mvc.mak and Make_dvc.mak:
128# This makefile gives a fineness of control which is not supported in
129# Visual C++ configuration files. Therefore, debugging requires a bit of
130# extra work.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000131# Make_dvc.mak is a Visual C++ project to access that support. It may be
132# badly out of date for the Visual C++ you are using...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000133# To use Make_dvc.mak:
134# 1) Build Vim with Make_mvc.mak.
135# Use a "DEBUG=yes" argument to build Vim with debug support.
136# E.g. the following builds gvimd.exe:
137# nmake -f Make_mvc.mak debug=yes gui=yes
138# 2) Use MS Devstudio and set it up to allow that file to be debugged:
139# i) Pass Make_dvc.mak to the IDE.
140# Use the "open workspace" menu entry to load Make_dvc.mak.
141# Alternatively, from the command line:
142# msdev /nologo Make_dvc.mak
143# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
144# this and offer to convert it to their own format. Accept that.
145# It creates a file called Make_dvc.dsw which can then be used
146# for further operations. E.g.
147# msdev /nologo Make_dvc.dsw
148# ii) Set the built executable for debugging:
149# a) Alt+F7/Debug takes you to the Debug dialog.
150# b) Fill "Executable for debug session". e.g. gvimd.exe
151# c) Fill "Program arguments". e.g. -R dosinst.c
152# d) Complete the dialog
153# 3) You can now debug the executable you built with Make_mvc.mak
154#
155# Note: Make_dvc.mak builds vimrun.exe, because it must build something
156# to be a valid makefile..
157
158### See feature.h for a list of optionals.
159# If you want to build some optional features without modifying the source,
160# you can set DEFINES on the command line, e.g.,
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000161# nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000162
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000163# Build on both Windows NT/XP and Windows 9x
Bram Moolenaar071d4272004-06-13 20:20:40 +0000164
165TARGETOS = BOTH
166
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000167# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
168# interfaces.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000169# If you change something else, do "make clean" first!
170!if "$(GUI)" == "yes"
171OBJDIR = .\ObjG
172!else
173OBJDIR = .\ObjC
174!endif
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200175!if "$(DIRECTX)" == "yes"
176OBJDIR = $(OBJDIR)X
177!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000178!if "$(OLE)" == "yes"
179OBJDIR = $(OBJDIR)O
180!endif
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200181!ifdef LUA
182OBJDIR = $(OBJDIR)U
183!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000184!ifdef PERL
185OBJDIR = $(OBJDIR)L
186!endif
187!ifdef PYTHON
188OBJDIR = $(OBJDIR)Y
189!endif
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200190!ifdef PYTHON3
191OBJDIR = $(OBJDIR)H
192!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000193!ifdef TCL
194OBJDIR = $(OBJDIR)T
195!endif
196!ifdef RUBY
197OBJDIR = $(OBJDIR)R
198!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000199!ifdef MZSCHEME
200OBJDIR = $(OBJDIR)Z
201!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000202!if "$(DEBUG)" == "yes"
203OBJDIR = $(OBJDIR)d
204!endif
205
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000206# Win32.mak requires that CPU be set appropriately.
207# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000208
209!ifdef PROCESSOR_ARCHITECTURE
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000210# We're on Windows NT or using VC 6+
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000211! ifdef CPU
212ASSEMBLY_ARCHITECTURE=$(CPU)
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000213# Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7.
Bram Moolenaar6b903512015-12-11 19:38:44 +0100214! if "$(CPU)" == "I386"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000215CPU = i386
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000216! endif
Bram Moolenaar6b903512015-12-11 19:38:44 +0100217! else # !CPU
218CPU = i386
Bram Moolenaar3d6d5cc2016-01-15 18:03:32 +0100219! if !defined(PLATFORM) && defined(TARGET_CPU)
220PLATFORM = $(TARGET_CPU)
221! endif
Bram Moolenaar6b903512015-12-11 19:38:44 +0100222! ifdef PLATFORM
223! if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64")
224CPU = AMD64
225! elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86")
226! error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted.
227! endif
228! endif # !PLATFORM
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229! endif
230!else # !PROCESSOR_ARCHITECTURE
231# We're on Windows 95
232CPU = i386
233!endif # !PROCESSOR_ARCHITECTURE
Bram Moolenaar6b903512015-12-11 19:38:44 +0100234ASSEMBLY_ARCHITECTURE=$(CPU)
Bram Moolenaare2db4362012-09-05 17:57:39 +0200235OBJDIR = $(OBJDIR)$(CPU)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000236
Bram Moolenaar071d4272004-06-13 20:20:40 +0000237# Build a retail version by default
238
239!if "$(DEBUG)" != "yes"
240NODEBUG = 1
241!else
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000242!undef NODEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000243MAKEFLAGS_GVIMEXT = DEBUG=yes
244!endif
245
246
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000247# Get all sorts of useful, standard macros from the Platform SDK.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000248
Bram Moolenaar6f586de2012-09-18 22:00:08 +0200249!ifdef SDK_INCLUDE_DIR
250!include $(SDK_INCLUDE_DIR)\Win32.mak
251!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000252!include <Win32.mak>
Bram Moolenaar6f586de2012-09-18 22:00:08 +0200253!endif
254
Bram Moolenaar071d4272004-06-13 20:20:40 +0000255
Bram Moolenaar8cd213c2010-06-01 21:57:09 +0200256# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200257WP64CHECK = /Wp64
Bram Moolenaar071d4272004-06-13 20:20:40 +0000258
259#>>>>> path of the compiler and linker; name of include and lib directories
260# PATH = c:\msvc20\bin;$(PATH)
261# INCLUDE = c:\msvc20\include
262# LIB = c:\msvc20\lib
263
264!ifndef CTAGS
265CTAGS = ctags
266!endif
267
268!if "$(SNIFF)" == "yes"
269# SNIFF - Include support for SNiFF+.
270SNIFF_INCL = if_sniff.h
271SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
Bram Moolenaarb6356332005-07-18 21:40:44 +0000272SNIFF_LIB = shell32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000273SNIFF_DEFS = -DFEAT_SNIFF
274# The SNiFF integration needs multithreaded libraries!
275MULTITHREADED = yes
276!endif
277
278!ifndef CSCOPE
279CSCOPE = yes
280!endif
281
282!if "$(CSCOPE)" == "yes"
283# CSCOPE - Include support for Cscope
284CSCOPE_INCL = if_cscope.h
285CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
286CSCOPE_DEFS = -DFEAT_CSCOPE
287!endif
288
289!ifndef NETBEANS
290NETBEANS = $(GUI)
291!endif
292
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000293# Only allow NETBEANS and XPM for a GUI build.
294!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000295!if "$(NETBEANS)" == "yes"
296# NETBEANS - Include support for Netbeans integration
297NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000298NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000299NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000300
301!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000302NBDEBUG_DEFS = -DNBDEBUG
303NBDEBUG_INCL = nbdebug.h
304NBDEBUG_SRC = nbdebug.c
305!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000306NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000307!endif
308
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200309# DirectWrite(DirectX)
310!if "$(DIRECTX)" == "yes"
311DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
312DIRECTX_INCL = gui_dwrite.h
313DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj
314!endif
315
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200316!ifndef XPM
317# XPM is not set, use the included xpm files, depending on the architecture.
Bram Moolenaare2db4362012-09-05 17:57:39 +0200318!if "$(CPU)" == "AMD64"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200319XPM = xpm\x64
Bram Moolenaare2db4362012-09-05 17:57:39 +0200320!elseif "$(CPU)" == "i386"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200321XPM = xpm\x86
Bram Moolenaare2db4362012-09-05 17:57:39 +0200322!else
323XPM = no
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200324!endif
325!endif
326!if "$(XPM)" != "no"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000327# XPM - Include support for XPM signs
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200328# See the xpm directory for more information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000329XPM_OBJ = $(OBJDIR)/xpm_w32.obj
330XPM_DEFS = -DFEAT_XPM_W32
331XPM_LIB = $(XPM)\lib\libXpm.lib
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200332XPM_INC = -I $(XPM)\include -I $(XPM)\..\include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000333!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000334!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000335
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000336# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000337!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000338# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000339# !elseif defined(MULTITHREADED)
340# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000341!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000342# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000343# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000344!endif
345
346# need advapi32.lib for GetUserName()
347# need shell32.lib for ExtractIcon()
348# gdi32.lib and comdlg32.lib for printing support
349# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000350CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200351 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000352!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000353CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
354!endif
355
356### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
357# When set to 0x0500 ":browse" stops working.
358!ifndef WINVER
359WINVER = 0x0400
360!endif
361
362# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
363# default, use these lines.
364#VIMRCLOC = somewhere
365#VIMRUNTIMEDIR = somewhere
366
367CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
368 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
369 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000370 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
371 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000372
373#>>>>> end of choices
374###########################################################################
375
376!ifdef OS
377OS_TYPE = winnt
378DEL_TREE = rmdir /s /q
379!else
380OS_TYPE = win95
381DEL_TREE = deltree /y
382!endif
383
384INTDIR=$(OBJDIR)
385OUTDIR=$(OBJDIR)
386
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100387!if [echo MSVCVER=_MSC_VER> msvcver.c && $(CC) /EP msvcver.c > msvcver.~ 2> nul]
388!message *** ERROR
389!message Cannot run Visual C to determine its version. Make sure cl.exe is in your PATH.
390!message This can usually be done by running "vcvarsall.bat", located in the bin directory where Visual Studio was installed.
391!error Make aborted.
392!else
393!include msvcver.~
394!if [del msvcver.c msvcver.~]
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200395!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000396!endif
397
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100398!if $(MSVCVER) < 1900
399MSVC_MAJOR = ($(MSVCVER) / 100 - 6)
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100400MSVCRT_VER = ($(MSVCVER) / 10 - 60)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100401!else
402MSVC_MAJOR = ($(MSVCVER) / 100 - 5)
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100403MSVCRT_VER = ($(MSVCVER) / 10 - 50)
404!endif
405
406# Calculate MSVCRT_VER
407!if [(set /a MSVCRT_VER="$(MSVCRT_VER)" > nul) && set MSVCRT_VER > msvcrtver.~] == 0
408!include msvcrtver.~
409!if [del msvcrtver.~]
410!endif
411!endif
412
413# Base name of the msvcrXX.dll
414!if $(MSVCRT_VER) <= 60
415MSVCRT_NAME = msvcrt
416!else
417MSVCRT_NAME = msvcr$(MSVCRT_VER)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100418!endif
419
420!if $(MSVC_MAJOR) == 6
421CPU = ix86
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000422!endif
423
Bram Moolenaar071d4272004-06-13 20:20:40 +0000424# Convert processor ID to MVC-compatible number
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100425!if $(MSVC_MAJOR) < 8
Bram Moolenaar071d4272004-06-13 20:20:40 +0000426!if "$(CPUNR)" == "i386"
427CPUARG = /G3
428!elseif "$(CPUNR)" == "i486"
429CPUARG = /G4
430!elseif "$(CPUNR)" == "i586"
431CPUARG = /G5
432!elseif "$(CPUNR)" == "i686"
433CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000434!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000435CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000436!else
437CPUARG =
438!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000439!else
Bram Moolenaar3ed16dc2011-06-12 20:31:31 +0200440# VC8/9/10 only allows specifying SSE architecture but only for 32bit
Bram Moolenaar6b903512015-12-11 19:38:44 +0100441!if "$(ASSEMBLY_ARCHITECTURE)" == "i386" && "$(CPUNR)" == "pentium4"
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000442CPUARG = /arch:SSE2
443!endif
444!endif
445
446LIBC =
447DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000448
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200449# Don't use /nodefaultlib on MSVC 14
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100450!if $(MSVC_MAJOR) >= 14
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200451NODEFAULTLIB =
452!else
453NODEFAULTLIB = /nodefaultlib
454!endif
455
Bram Moolenaar071d4272004-06-13 20:20:40 +0000456!ifdef NODEBUG
457VIM = vim
458!if "$(OPTIMIZE)" == "SPACE"
459OPTFLAG = /O1
460!elseif "$(OPTIMIZE)" == "SPEED"
461OPTFLAG = /O2
462!else # MAXSPEED
463OPTFLAG = /Ox
464!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200465
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100466!if $(MSVC_MAJOR) >= 8
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000467# Use link time code generation if not worried about size
468!if "$(OPTIMIZE)" != "SPACE"
469OPTFLAG = $(OPTFLAG) /GL
470!endif
471!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200472
473# (/Wp64 is deprecated in VC9 and generates an obnoxious warning.)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100474!if ($(MSVC_MAJOR) == 7) || ($(MSVC_MAJOR) == 8)
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200475CFLAGS=$(CFLAGS) $(WP64CHECK)
476!endif
477
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100478# Static code analysis generally available starting with VS2012 (VC11) or
479# Windows SDK 7.1 (VC10)
480!if ("$(ANALYZE)" == "yes") && ($(MSVC_MAJOR) >= 10)
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200481CFLAGS=$(CFLAGS) /analyze
482!endif
483
Bram Moolenaar34114692005-01-02 11:28:13 +0000484CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000485RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000486! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000487CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000488LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000489! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000490LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000491CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000492! endif
493!else # DEBUG
494VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000495! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000496DEBUGINFO = /ZI
497! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000498CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000499RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
500# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100501! if $(MSVC_MAJOR) == 4
Bram Moolenaar071d4272004-06-13 20:20:40 +0000502LIBC =
503! else
504LIBC = /fixed:no
505! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000506! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000507CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000508LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000509! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000510LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000511CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000512! endif
513!endif # DEBUG
514
515INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
516 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
517 $(NBDEBUG_INCL)
518
519OBJ = \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200520 $(OUTDIR)\blowfish.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000521 $(OUTDIR)\buffer.obj \
522 $(OUTDIR)\charset.obj \
Bram Moolenaar07cf3822014-08-10 16:31:50 +0200523 $(OUTDIR)\crypt.obj \
524 $(OUTDIR)\crypt_zip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000525 $(OUTDIR)\diff.obj \
526 $(OUTDIR)\digraph.obj \
527 $(OUTDIR)\edit.obj \
528 $(OUTDIR)\eval.obj \
529 $(OUTDIR)\ex_cmds.obj \
530 $(OUTDIR)\ex_cmds2.obj \
531 $(OUTDIR)\ex_docmd.obj \
532 $(OUTDIR)\ex_eval.obj \
533 $(OUTDIR)\ex_getln.obj \
534 $(OUTDIR)\fileio.obj \
535 $(OUTDIR)\fold.obj \
536 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000537 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000538 $(OUTDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000539 $(OUTDIR)\main.obj \
540 $(OUTDIR)\mark.obj \
541 $(OUTDIR)\mbyte.obj \
542 $(OUTDIR)\memfile.obj \
543 $(OUTDIR)\memline.obj \
544 $(OUTDIR)\menu.obj \
545 $(OUTDIR)\message.obj \
546 $(OUTDIR)\misc1.obj \
547 $(OUTDIR)\misc2.obj \
548 $(OUTDIR)\move.obj \
549 $(OUTDIR)\normal.obj \
550 $(OUTDIR)\ops.obj \
551 $(OUTDIR)\option.obj \
552 $(OUTDIR)\os_mswin.obj \
Bram Moolenaar693e40c2013-02-26 14:56:42 +0100553 $(OUTDIR)\winclip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000554 $(OUTDIR)\os_win32.obj \
555 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000556 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000557 $(OUTDIR)\quickfix.obj \
558 $(OUTDIR)\regexp.obj \
559 $(OUTDIR)\screen.obj \
560 $(OUTDIR)\search.obj \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200561 $(OUTDIR)\sha256.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000562 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000563 $(OUTDIR)\syntax.obj \
564 $(OUTDIR)\tag.obj \
565 $(OUTDIR)\term.obj \
566 $(OUTDIR)\ui.obj \
567 $(OUTDIR)\undo.obj \
568 $(OUTDIR)\window.obj \
569 $(OUTDIR)\vim.res
570
571!if "$(OLE)" == "yes"
572CFLAGS = $(CFLAGS) -DFEAT_OLE
573RCFLAGS = $(RCFLAGS) -DFEAT_OLE
574OLE_OBJ = $(OUTDIR)\if_ole.obj
575OLE_IDL = if_ole.idl
576OLE_LIB = oleaut32.lib
577!endif
578
579!if "$(IME)" == "yes"
580CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
581!ifndef DYNAMIC_IME
582DYNAMIC_IME = yes
583!endif
584!if "$(DYNAMIC_IME)" == "yes"
585CFLAGS = $(CFLAGS) -DDYNAMIC_IME
586!else
587IME_LIB = imm32.lib
588!endif
589!endif
590
591!if "$(GIME)" == "yes"
592CFLAGS = $(CFLAGS) -DGLOBAL_IME
593OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
594MBYTE = yes
595!endif
596
597!if "$(MBYTE)" == "yes"
598CFLAGS = $(CFLAGS) -DFEAT_MBYTE
599!endif
600
601!if "$(GUI)" == "yes"
602SUBSYSTEM = windows
603CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
604RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
605VIM = g$(VIM)
606GUI_INCL = \
607 gui.h \
608 regexp.h \
609 ascii.h \
610 ex_cmds.h \
611 farsi.h \
612 feature.h \
613 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000614 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000615 keymap.h \
616 macros.h \
617 option.h \
618 os_dos.h \
619 os_win32.h
620GUI_OBJ = \
621 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000622 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000623 $(OUTDIR)\gui_w32.obj \
624 $(OUTDIR)\os_w32exe.obj
625GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000626 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000627 winspool.lib comctl32.lib advapi32.lib shell32.lib \
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200628 /machine:$(CPU)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000629!else
630SUBSYSTEM = console
631!endif
632
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200633!if "$(SUBSYSTEM_VER)" != ""
634SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
635!endif
636
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200637!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
638CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
639GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
640GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
641!endif
642
Bram Moolenaar071d4272004-06-13 20:20:40 +0000643# iconv.dll library (dynamically loaded)
644!ifndef ICONV
645ICONV = yes
646!endif
647!if "$(ICONV)" == "yes"
648CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
649!endif
650
651# libintl.dll library
652!ifndef GETTEXT
653GETTEXT = yes
654!endif
655!if "$(GETTEXT)" == "yes"
656CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
657!endif
658
659# TCL interface
660!ifdef TCL
661!ifndef TCL_VER
662TCL_VER = 83
663TCL_VER_LONG = 8.3
664!endif
665!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
666!if "$(DYNAMIC_TCL)" == "yes"
667!message Tcl DLL will be loaded dynamically
668TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000669CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
670 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000671TCL_OBJ = $(OUTDIR)\if_tcl.obj
672TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
Bram Moolenaar84a4c332012-02-22 16:01:56 +0100673TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000674!else
675CFLAGS = $(CFLAGS) -DFEAT_TCL
676TCL_OBJ = $(OUTDIR)\if_tcl.obj
677TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
678TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
679!endif
680!endif
681
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200682# Lua interface
683!ifdef LUA
684!ifndef LUA_VER
685LUA_VER = 51
686!endif
687!message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)"
688!if "$(DYNAMIC_LUA)" == "yes"
689!message Lua DLL will be loaded dynamically
690!endif
691CFLAGS = $(CFLAGS) -DFEAT_LUA
692LUA_OBJ = $(OUTDIR)\if_lua.obj
693LUA_INC = /I "$(LUA)\include" /I "$(LUA)"
694!if "$(DYNAMIC_LUA)" == "yes"
695CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \
696 -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
697LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib
698!else
699LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib"
700!endif
701!endif
702
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200703!ifdef PYTHON
704!ifdef PYTHON3
705DYNAMIC_PYTHON=yes
706DYNAMIC_PYTHON3=yes
707!endif
708!endif
709
Bram Moolenaar071d4272004-06-13 20:20:40 +0000710# PYTHON interface
711!ifdef PYTHON
712!ifndef PYTHON_VER
713PYTHON_VER = 22
714!endif
715!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
716!if "$(DYNAMIC_PYTHON)" == "yes"
717!message Python DLL will be loaded dynamically
718!endif
719CFLAGS = $(CFLAGS) -DFEAT_PYTHON
720PYTHON_OBJ = $(OUTDIR)\if_python.obj
721PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
722!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000723CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
724 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000725PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
726!else
727PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
728!endif
729!endif
730
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200731# PYTHON3 interface
732!ifdef PYTHON3
733!ifndef PYTHON3_VER
734PYTHON3_VER = 31
735!endif
736!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
737!if "$(DYNAMIC_PYTHON3)" == "yes"
738!message Python3 DLL will be loaded dynamically
739!endif
740CFLAGS = $(CFLAGS) -DFEAT_PYTHON3
741PYTHON3_OBJ = $(OUTDIR)\if_python3.obj
742PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC"
743!if "$(DYNAMIC_PYTHON3)" == "yes"
744CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \
745 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
746PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib
747!else
748PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
749!endif
750!endif
751
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000752# MzScheme interface
753!ifdef MZSCHEME
754!message MzScheme requested - root dir is "$(MZSCHEME)"
755!ifndef MZSCHEME_VER
756MZSCHEME_VER = 205_000
757!endif
758CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100759!if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \
Bram Moolenaar5c5c9802015-07-10 16:12:48 +0200760 || EXIST("$(MZSCHEME)\collects\scheme\base.rkt") \
761 || EXIST("$(MZSCHEME)\collects\racket\base.rkt")
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100762# for MzScheme >= 4 we need to include byte code for basic Scheme stuff
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000763MZSCHEME_EXTRA_DEP = mzscheme_base.c
764CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
765!endif
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100766!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib")
767MZSCHEME_MAIN_LIB=mzsch
768!else
769MZSCHEME_MAIN_LIB=racket
770!endif
771!if EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000772 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
773!message Building with Precise GC
774MZSCHEME_PRECISE_GC = yes
775CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
776!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000777!if "$(DYNAMIC_MZSCHEME)" == "yes"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000778!if "$(MZSCHEME_PRECISE_GC)" == "yes"
779!error MzScheme with Precise GC cannot be loaded dynamically
780!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000781!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000782CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100783 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000784 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000785!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000786!if "$(MZSCHEME_DEBUG)" == "yes"
787CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
788!endif
789!if "$(MZSCHEME_PRECISE_GC)" == "yes"
790# Precise GC does not use separate dll
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100791MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000792!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000793MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100794 $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000795!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000796!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000797MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
Bram Moolenaarbbc98db2012-02-12 01:55:55 +0100798# increase stack size
799MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000800!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000801
Bram Moolenaar071d4272004-06-13 20:20:40 +0000802# Perl interface
803!ifdef PERL
804!ifndef PERL_VER
805PERL_VER = 56
806!endif
807!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
808!if "$(DYNAMIC_PERL)" == "yes"
809!if $(PERL_VER) >= 56
810!message Perl DLL will be loaded dynamically
811!else
812!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
813!message Reverting to static loading...
814!undef DYNAMIC_PERL
815!endif
816!endif
817
818# Is Perl installed in architecture-specific directories?
819!if exist($(PERL)\Bin\MSWin32-x86)
820PERL_ARCH = \MSWin32-x86
821!endif
822
823PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
824
825# Version-dependent stuff
826!if $(PERL_VER) == 55
827PERL_LIB = $(PERL_INCDIR)\perl.lib
828!else
829PERL_DLL = perl$(PERL_VER).dll
Bram Moolenaar207fd752013-12-14 11:50:35 +0100830!if exist($(PERL_INCDIR)\perl$(PERL_VER).lib)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000831PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
Bram Moolenaar207fd752013-12-14 11:50:35 +0100832!else
833# For ActivePerl 5.18 and later
834PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a
835!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000836!endif
837
Bram Moolenaar367fbf12015-06-25 16:13:46 +0200838CFLAGS = $(CFLAGS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000839
840# Do we want to load Perl dynamically?
841!if "$(DYNAMIC_PERL)" == "yes"
842CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
843!undef PERL_LIB
844!endif
845
846PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
847PERL_INC = /I $(PERL_INCDIR)
Bram Moolenaar2bf24172015-12-31 20:54:51 +0100848!if $(MSVC_MAJOR) <= 11
849# ActivePerl 5.20+ requires stdbool.h but VC2012 or earlier doesn't have it.
850# Use a stub stdbool.h.
851PERL_INC = $(PERL_INC) /I if_perl_msvc
852!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000853PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
854XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
Bram Moolenaar52f83172011-09-14 19:01:42 +0200855!if exist($(XSUBPP))
Bram Moolenaar612af432011-09-14 10:49:46 +0200856XSUBPP = $(PERL_EXE) $(XSUBPP)
857!else
858XSUBPP = xsubpp
859!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000860XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
861
862!endif
863
864#
865# Support Ruby interface
866#
867!ifdef RUBY
868# Set default value
869!ifndef RUBY_VER
870RUBY_VER = 18
871!endif
872!ifndef RUBY_VER_LONG
873RUBY_VER_LONG = 1.8
874!endif
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200875!ifndef RUBY_API_VER
876RUBY_API_VER = $(RUBY_VER_LONG:.=)
877!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000878
879!if $(RUBY_VER) >= 18
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100880
Bram Moolenaar071d4272004-06-13 20:20:40 +0000881!ifndef RUBY_PLATFORM
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100882!if "$(CPU)" == "i386"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000883RUBY_PLATFORM = i386-mswin32
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100884!else # CPU
885RUBY_PLATFORM = x64-mswin64
886!endif # CPU
887!if $(MSVCRT_VER) >= 70
888RUBY_PLATFORM = $(RUBY_PLATFORM)_$(MSVCRT_VER)
889!endif # MSVCRT_VER
890!endif # RUBY_PLATFORM
891
Bram Moolenaar071d4272004-06-13 20:20:40 +0000892!ifndef RUBY_INSTALL_NAME
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100893!ifndef RUBY_MSVCRT_NAME
894# Base name of msvcrXX.dll which is used by ruby's dll.
895RUBY_MSVCRT_NAME = $(MSVCRT_NAME)
896!endif # RUBY_MSVCRT_NAME
897!if "$(CPU)" == "i386"
898RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
899!else # CPU
900RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
901!endif # CPU
902!endif # RUBY_INSTALL_NAME
903
904!else # $(RUBY_VER) >= 18
905
Bram Moolenaar071d4272004-06-13 20:20:40 +0000906!ifndef RUBY_PLATFORM
907RUBY_PLATFORM = i586-mswin32
908!endif
909!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200910RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000911!endif
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100912
Bram Moolenaar071d4272004-06-13 20:20:40 +0000913!endif # $(RUBY_VER) >= 18
914
915!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
916CFLAGS = $(CFLAGS) -DFEAT_RUBY
917RUBY_OBJ = $(OUTDIR)\if_ruby.obj
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200918!if $(RUBY_VER) >= 19
919RUBY_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 +0200920!else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000921RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
Bram Moolenaar69154f22010-07-18 21:42:34 +0200922!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000923RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
924# Do we want to load Ruby dynamically?
925!if "$(DYNAMIC_RUBY)" == "yes"
926!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000927CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
928 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000929!undef RUBY_LIB
930!endif
931!endif # RUBY
932
933#
934# Support PostScript printing
935#
936!if "$(POSTSCRIPT)" == "yes"
937CFLAGS = $(CFLAGS) -DMSWINPS
938!endif # POSTSCRIPT
939
940#
941# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
942#
943!if "$(FEATURES)"==""
944FEATURES = BIG
945!endif
946CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
947
948#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000949# Always generate the .pdb file, so that we get debug symbols that can be used
950# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000951# Generate edit-and-continue debug info when no optimization - allows to
952# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000953#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000954CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
955LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000956
957#
958# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000959#
960!message
961
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000962conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000963
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000964PATHDEF_SRC = $(OUTDIR)\pathdef.c
965
Bram Moolenaar071d4272004-06-13 20:20:40 +0000966!IF "$(MAP)" == "yes"
967# "/map" is for debugging
968conflags = $(conflags) /map
969!ELSEIF "$(MAP)" == "lines"
970# "/mapinfo:lines" is for debugging, only works for VC6 and later
971conflags = $(conflags) /map /mapinfo:lines
972!ENDIF
973
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000974LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200975LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200976 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000977 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000978
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000979# Report link time code generation progress if used.
980!ifdef NODEBUG
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100981!if $(MSVC_MAJOR) >= 8
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000982!if "$(OPTIMIZE)" != "SPACE"
983LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
984!endif
985!endif
986!endif
987
Bram Moolenaar24db7292016-01-03 16:56:10 +0100988all: $(VIM).exe \
989 vimrun.exe \
990 install.exe \
991 uninstal.exe \
992 xxd/xxd.exe \
993 tee/tee.exe \
994 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000995
Bram Moolenaarb6356332005-07-18 21:40:44 +0000996$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200997 $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200998 $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
999 version.c version.h
Bram Moolenaarb6356332005-07-18 21:40:44 +00001000 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +00001001 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001002 $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001003 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
1004 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaarb7776182014-05-22 16:29:06 +02001005 if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001006
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001007$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +00001008
1009$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00001010 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001011
1012install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001013 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +02001014 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +00001015 - if exist install.exe del install.exe
1016 ren dosinst.exe install.exe
1017
1018uninstal.exe: uninstal.c
1019 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
1020
1021vimrun.exe: vimrun.c
1022 $(CC) /nologo -DNDEBUG vimrun.c
1023
1024xxd/xxd.exe: xxd/xxd.c
1025 cd xxd
1026 $(MAKE) /NOLOGO -f Make_mvc.mak
1027 cd ..
1028
Bram Moolenaar24db7292016-01-03 16:56:10 +01001029tee/tee.exe: tee/tee.c
1030 cd tee
1031 $(MAKE) /NOLOGO -f Make_mvc.mak
1032 cd ..
1033
Bram Moolenaar071d4272004-06-13 20:20:40 +00001034GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
1035 cd GvimExt
1036 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
1037 cd ..
1038
1039
1040tags: notags
1041 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
1042
1043notags:
1044 - if exist tags del tags
1045
1046clean:
Bram Moolenaar02743632005-07-25 20:42:36 +00001047 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001048 - if exist *.obj del *.obj
1049 - if exist $(VIM).exe del $(VIM).exe
1050 - if exist $(VIM).ilk del $(VIM).ilk
1051 - if exist $(VIM).pdb del $(VIM).pdb
1052 - if exist $(VIM).map del $(VIM).map
1053 - if exist $(VIM).ncb del $(VIM).ncb
1054 - if exist vimrun.exe del vimrun.exe
1055 - if exist install.exe del install.exe
1056 - if exist uninstal.exe del uninstal.exe
1057 - if exist if_perl.c del if_perl.c
1058 - if exist dimm.h del dimm.h
1059 - if exist dimm_i.c del dimm_i.c
1060 - if exist dimm.tlb del dimm.tlb
1061 - if exist dosinst.exe del dosinst.exe
Bram Moolenaar2d6db762009-09-11 10:49:58 +00001062 - if exist mzscheme_base.c del mzscheme_base.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001063 cd xxd
1064 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1065 cd ..
Bram Moolenaard08a8d42016-01-10 15:20:29 +01001066 cd tee
1067 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1068 cd ..
Bram Moolenaar071d4272004-06-13 20:20:40 +00001069 cd GvimExt
1070 $(MAKE) /NOLOGO -f Makefile clean
1071 cd ..
1072 cd GvimExt
1073 $(MAKE) /NOLOGO -f Makefile clean
1074 cd ..
1075 - if exist testdir\*.out del testdir\*.out
1076
1077test:
1078 cd testdir
1079 $(MAKE) /NOLOGO -f Make_dos.mak win32
1080 cd ..
1081
Bram Moolenaar7eae47a2016-01-01 17:49:44 +01001082testgvim:
1083 cd testdir
1084 $(MAKE) /NOLOGO -f Make_dos.mak VIMPROG=..\gvim win32
1085 cd ..
1086
Bram Moolenaar34114692005-01-02 11:28:13 +00001087testclean:
1088 cd testdir
1089 $(MAKE) /NOLOGO -f Make_dos.mak clean
1090 cd ..
1091
Bram Moolenaar071d4272004-06-13 20:20:40 +00001092###########################################################################
1093
1094# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
1095# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +01001096!IF "$(_NMAKE_VER)" == ""
Bram Moolenaar071d4272004-06-13 20:20:40 +00001097.c{$(OUTDIR)/}.obj:
1098!ELSE
1099.c{$(OUTDIR)/}.obj::
1100!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001101 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001102
1103# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
1104# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +01001105!IF "$(_NMAKE_VER)" == ""
Bram Moolenaar071d4272004-06-13 20:20:40 +00001106.cpp{$(OUTDIR)/}.obj:
1107!ELSE
1108.cpp{$(OUTDIR)/}.obj::
1109!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001110 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001111
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001112$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
1113
Bram Moolenaaredac1852010-05-18 20:34:20 +02001114$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001115
Bram Moolenaar071d4272004-06-13 20:20:40 +00001116$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
1117
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001118$(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL)
1119
1120$(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c $(INCL)
1121
Bram Moolenaar071d4272004-06-13 20:20:40 +00001122$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
1123
1124$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
1125
1126$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
1127
1128$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
1129
1130$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
1131
1132$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
1133
1134$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
1135
1136$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
1137
1138$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
1139
1140$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
1141
1142$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
1143
1144$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
1145
Bram Moolenaar58d98232005-07-23 22:25:46 +00001146$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
1147
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001148$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +00001149
Bram Moolenaar071d4272004-06-13 20:20:40 +00001150$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
1151
Bram Moolenaar52b4b552005-03-07 23:00:57 +00001152$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
1153
Bram Moolenaar071d4272004-06-13 20:20:40 +00001154$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
1155
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +02001156$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
1157
Bram Moolenaar071d4272004-06-13 20:20:40 +00001158$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
1159
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001160$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
1161 $(CC) $(CFLAGS) $(LUA_INC) if_lua.c
1162
Bram Moolenaar071d4272004-06-13 20:20:40 +00001163if_perl.c : if_perl.xs typemap
Bram Moolenaar612af432011-09-14 10:49:46 +02001164 $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001165 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001166
1167$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001168 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001169
1170$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001171 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001172
Bram Moolenaar75676462013-01-30 14:55:42 +01001173$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +00001174 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001175 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001176mzscheme_base.c:
Bram Moolenaar5c5c9802015-07-10 16:12:48 +02001177!IF "$(MZSCHEME_MAIN_LIB)" == "racket"
1178 $(MZSCHEME)\raco ctool --c-mods mzscheme_base.c ++lib scheme/base
1179!ELSE
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001180 $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
Bram Moolenaar5c5c9802015-07-10 16:12:48 +02001181!ENDIF
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001182
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001183$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001184 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001185
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001186$(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL)
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001187 $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c
1188
Bram Moolenaar071d4272004-06-13 20:20:40 +00001189$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
1190
1191$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001192 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001193
1194$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001195 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001196
1197$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001198 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001199
1200$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
1201
1202$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
1203
1204$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
1205
1206$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1207
1208$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1209
1210$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1211
1212$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1213
1214$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1215
1216$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1217
1218$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1219
1220$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1221
1222$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1223
1224$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1225
1226$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1227
1228$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1229
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001230$(OUTDIR)/winclip.obj: $(OUTDIR) winclip.c $(INCL)
1231
Bram Moolenaar071d4272004-06-13 20:20:40 +00001232$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1233
1234$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1235
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001236$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1237 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001238
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001239$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001240
Bram Moolenaar071d4272004-06-13 20:20:40 +00001241$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1242
Bram Moolenaarfbc0d2e2013-05-19 19:40:29 +02001243$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c regexp_nfa.c $(INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001244
1245$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1246
1247$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1248
Bram Moolenaaredac1852010-05-18 20:34:20 +02001249$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1250
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001251$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1252
Bram Moolenaar071d4272004-06-13 20:20:40 +00001253$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1254
1255$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1256
1257$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1258
1259$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1260
1261$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1262
1263$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1264
1265$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001266 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001267
Bram Moolenaarcc448b32010-07-14 16:52:17 +02001268$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
1269 tearoff.bmp vim.ico vim_error.ico \
1270 vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001271 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1272
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001273iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001274 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1275 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001276
1277dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001278 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001279
1280$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1281
1282$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1283
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001284# $CFLAGS may contain backslashes and double quotes, escape them both.
1285E0_CFLAGS = $(CFLAGS:\=\\)
1286E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001287# ") stop the string
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001288# $LINKARGS2 may contain backslashes and double quotes, escape them both.
1289E0_LINKARGS2 = $(LINKARGS2:\=\\)
1290E_LINKARGS2 = $(E0_LINKARGS2:"=\")
1291# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001292
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001293$(PATHDEF_SRC): auto
1294 @echo creating $(PATHDEF_SRC)
1295 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1296 @echo #include "vim.h" >> $(PATHDEF_SRC)
1297 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1298 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1299 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001300 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC)
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001301 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1302 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001303
1304auto:
1305 if not exist auto/nul mkdir auto
1306
1307# End Custom Build
1308proto.h: \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001309 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001310 proto/buffer.pro \
1311 proto/charset.pro \
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001312 proto/crypt.pro \
1313 proto/crypt_zip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001314 proto/diff.pro \
1315 proto/digraph.pro \
1316 proto/edit.pro \
1317 proto/eval.pro \
1318 proto/ex_cmds.pro \
1319 proto/ex_cmds2.pro \
1320 proto/ex_docmd.pro \
1321 proto/ex_eval.pro \
1322 proto/ex_getln.pro \
1323 proto/fileio.pro \
1324 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001325 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001326 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001327 proto/main.pro \
1328 proto/mark.pro \
1329 proto/memfile.pro \
1330 proto/memline.pro \
1331 proto/menu.pro \
1332 proto/message.pro \
1333 proto/misc1.pro \
1334 proto/misc2.pro \
1335 proto/move.pro \
1336 proto/mbyte.pro \
1337 proto/normal.pro \
1338 proto/ops.pro \
1339 proto/option.pro \
1340 proto/os_mswin.pro \
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001341 proto/winclip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001342 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001343 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001344 proto/quickfix.pro \
1345 proto/regexp.pro \
1346 proto/screen.pro \
1347 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001348 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001349 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001350 proto/syntax.pro \
1351 proto/tag.pro \
1352 proto/term.pro \
1353 proto/ui.pro \
1354 proto/undo.pro \
1355 proto/window.pro \
1356 $(NETBEANS_PRO)
1357
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001358.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001359
1360# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1361# foo.cod"
1362.c.cod:
1363 $(CC) $(CFLAGS) /FAcs $<
1364
1365# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1366.c.i:
1367 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001368
1369
Bram Moolenaar071d4272004-06-13 20:20:40 +00001370# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: