blob: c7b28d59c17072ad14cf23bcf6362bbc74e2053b [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.
214! if ("$(ASSEMBLY_ARCHITECTURE)" == "i386") || ("$(ASSEMBLY_ARCHITECTURE)" == "I386")
215ASSEMBLY_ARCHITECTURE = x86
216! endif
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000217! else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000218CPU = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000219ASSEMBLY_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000220! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000221CPU = i386
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000222! endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000223! endif
224!else # !PROCESSOR_ARCHITECTURE
225# We're on Windows 95
226CPU = i386
227!endif # !PROCESSOR_ARCHITECTURE
Bram Moolenaare2db4362012-09-05 17:57:39 +0200228OBJDIR = $(OBJDIR)$(CPU)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229
Bram Moolenaar071d4272004-06-13 20:20:40 +0000230# Build a retail version by default
231
232!if "$(DEBUG)" != "yes"
233NODEBUG = 1
234!else
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000235!undef NODEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000236MAKEFLAGS_GVIMEXT = DEBUG=yes
237!endif
238
239
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000240# Get all sorts of useful, standard macros from the Platform SDK.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000241
Bram Moolenaar6f586de2012-09-18 22:00:08 +0200242!ifdef SDK_INCLUDE_DIR
243!include $(SDK_INCLUDE_DIR)\Win32.mak
244!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000245!include <Win32.mak>
Bram Moolenaar6f586de2012-09-18 22:00:08 +0200246!endif
247
Bram Moolenaar071d4272004-06-13 20:20:40 +0000248
Bram Moolenaar8cd213c2010-06-01 21:57:09 +0200249# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200250WP64CHECK = /Wp64
Bram Moolenaar071d4272004-06-13 20:20:40 +0000251
252#>>>>> path of the compiler and linker; name of include and lib directories
253# PATH = c:\msvc20\bin;$(PATH)
254# INCLUDE = c:\msvc20\include
255# LIB = c:\msvc20\lib
256
257!ifndef CTAGS
258CTAGS = ctags
259!endif
260
261!if "$(SNIFF)" == "yes"
262# SNIFF - Include support for SNiFF+.
263SNIFF_INCL = if_sniff.h
264SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
Bram Moolenaarb6356332005-07-18 21:40:44 +0000265SNIFF_LIB = shell32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000266SNIFF_DEFS = -DFEAT_SNIFF
267# The SNiFF integration needs multithreaded libraries!
268MULTITHREADED = yes
269!endif
270
271!ifndef CSCOPE
272CSCOPE = yes
273!endif
274
275!if "$(CSCOPE)" == "yes"
276# CSCOPE - Include support for Cscope
277CSCOPE_INCL = if_cscope.h
278CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
279CSCOPE_DEFS = -DFEAT_CSCOPE
280!endif
281
282!ifndef NETBEANS
283NETBEANS = $(GUI)
284!endif
285
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000286# Only allow NETBEANS and XPM for a GUI build.
287!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000288!if "$(NETBEANS)" == "yes"
289# NETBEANS - Include support for Netbeans integration
290NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000291NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000292NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000293
294!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000295NBDEBUG_DEFS = -DNBDEBUG
296NBDEBUG_INCL = nbdebug.h
297NBDEBUG_SRC = nbdebug.c
298!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000299NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000300!endif
301
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200302# DirectWrite(DirectX)
303!if "$(DIRECTX)" == "yes"
304DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
305DIRECTX_INCL = gui_dwrite.h
306DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj
307!endif
308
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200309!ifndef XPM
310# XPM is not set, use the included xpm files, depending on the architecture.
Bram Moolenaare2db4362012-09-05 17:57:39 +0200311!if "$(CPU)" == "AMD64"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200312XPM = xpm\x64
Bram Moolenaare2db4362012-09-05 17:57:39 +0200313!elseif "$(CPU)" == "i386"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200314XPM = xpm\x86
Bram Moolenaare2db4362012-09-05 17:57:39 +0200315!else
316XPM = no
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200317!endif
318!endif
319!if "$(XPM)" != "no"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000320# XPM - Include support for XPM signs
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200321# See the xpm directory for more information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000322XPM_OBJ = $(OBJDIR)/xpm_w32.obj
323XPM_DEFS = -DFEAT_XPM_W32
324XPM_LIB = $(XPM)\lib\libXpm.lib
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200325XPM_INC = -I $(XPM)\include -I $(XPM)\..\include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000326!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000327!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000328
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000329# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000330!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000331# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000332# !elseif defined(MULTITHREADED)
333# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000334!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000335# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000336# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000337!endif
338
339# need advapi32.lib for GetUserName()
340# need shell32.lib for ExtractIcon()
341# gdi32.lib and comdlg32.lib for printing support
342# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000343CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200344 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000345!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000346CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
347!endif
348
349### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
350# When set to 0x0500 ":browse" stops working.
351!ifndef WINVER
352WINVER = 0x0400
353!endif
354
355# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
356# default, use these lines.
357#VIMRCLOC = somewhere
358#VIMRUNTIMEDIR = somewhere
359
360CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
361 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
362 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000363 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
364 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000365
366#>>>>> end of choices
367###########################################################################
368
369!ifdef OS
370OS_TYPE = winnt
371DEL_TREE = rmdir /s /q
372!else
373OS_TYPE = win95
374DEL_TREE = deltree /y
375!endif
376
377INTDIR=$(OBJDIR)
378OUTDIR=$(OBJDIR)
379
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100380!if [echo MSVCVER=_MSC_VER> msvcver.c && $(CC) /EP msvcver.c > msvcver.~ 2> nul]
381!message *** ERROR
382!message Cannot run Visual C to determine its version. Make sure cl.exe is in your PATH.
383!message This can usually be done by running "vcvarsall.bat", located in the bin directory where Visual Studio was installed.
384!error Make aborted.
385!else
386!include msvcver.~
387!if [del msvcver.c msvcver.~]
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200388!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000389!endif
390
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100391!if $(MSVCVER) < 1900
392MSVC_MAJOR = ($(MSVCVER) / 100 - 6)
393!else
394MSVC_MAJOR = ($(MSVCVER) / 100 - 5)
395!endif
396
397!if $(MSVC_MAJOR) == 6
398CPU = ix86
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000399!endif
400
Bram Moolenaar071d4272004-06-13 20:20:40 +0000401# Convert processor ID to MVC-compatible number
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100402!if $(MSVC_MAJOR) < 8
Bram Moolenaar071d4272004-06-13 20:20:40 +0000403!if "$(CPUNR)" == "i386"
404CPUARG = /G3
405!elseif "$(CPUNR)" == "i486"
406CPUARG = /G4
407!elseif "$(CPUNR)" == "i586"
408CPUARG = /G5
409!elseif "$(CPUNR)" == "i686"
410CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000411!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000412CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000413!else
414CPUARG =
415!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000416!else
Bram Moolenaar3ed16dc2011-06-12 20:31:31 +0200417# VC8/9/10 only allows specifying SSE architecture but only for 32bit
418!if "$(ASSEMBLY_ARCHITECTURE)" == "x86" && "$(CPUNR)" == "pentium4"
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000419CPUARG = /arch:SSE2
420!endif
421!endif
422
423LIBC =
424DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000425
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200426# Don't use /nodefaultlib on MSVC 14
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100427!if $(MSVC_MAJOR) >= 14
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200428NODEFAULTLIB =
429!else
430NODEFAULTLIB = /nodefaultlib
431!endif
432
Bram Moolenaar071d4272004-06-13 20:20:40 +0000433!ifdef NODEBUG
434VIM = vim
435!if "$(OPTIMIZE)" == "SPACE"
436OPTFLAG = /O1
437!elseif "$(OPTIMIZE)" == "SPEED"
438OPTFLAG = /O2
439!else # MAXSPEED
440OPTFLAG = /Ox
441!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200442
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100443!if $(MSVC_MAJOR) >= 8
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000444# Use link time code generation if not worried about size
445!if "$(OPTIMIZE)" != "SPACE"
446OPTFLAG = $(OPTFLAG) /GL
447!endif
448!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200449
450# (/Wp64 is deprecated in VC9 and generates an obnoxious warning.)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100451!if ($(MSVC_MAJOR) == 7) || ($(MSVC_MAJOR) == 8)
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200452CFLAGS=$(CFLAGS) $(WP64CHECK)
453!endif
454
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100455# Static code analysis generally available starting with VS2012 (VC11) or
456# Windows SDK 7.1 (VC10)
457!if ("$(ANALYZE)" == "yes") && ($(MSVC_MAJOR) >= 10)
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200458CFLAGS=$(CFLAGS) /analyze
459!endif
460
Bram Moolenaar34114692005-01-02 11:28:13 +0000461CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000462RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000463! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000464CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000465LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000466! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000467LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000468CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000469! endif
470!else # DEBUG
471VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000472! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000473DEBUGINFO = /ZI
474! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000475CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000476RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
477# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100478! if $(MSVC_MAJOR) == 4
Bram Moolenaar071d4272004-06-13 20:20:40 +0000479LIBC =
480! else
481LIBC = /fixed:no
482! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000483! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000484CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000485LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000486! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000487LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000488CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000489! endif
490!endif # DEBUG
491
492INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
493 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
494 $(NBDEBUG_INCL)
495
496OBJ = \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200497 $(OUTDIR)\blowfish.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000498 $(OUTDIR)\buffer.obj \
499 $(OUTDIR)\charset.obj \
Bram Moolenaar07cf3822014-08-10 16:31:50 +0200500 $(OUTDIR)\crypt.obj \
501 $(OUTDIR)\crypt_zip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000502 $(OUTDIR)\diff.obj \
503 $(OUTDIR)\digraph.obj \
504 $(OUTDIR)\edit.obj \
505 $(OUTDIR)\eval.obj \
506 $(OUTDIR)\ex_cmds.obj \
507 $(OUTDIR)\ex_cmds2.obj \
508 $(OUTDIR)\ex_docmd.obj \
509 $(OUTDIR)\ex_eval.obj \
510 $(OUTDIR)\ex_getln.obj \
511 $(OUTDIR)\fileio.obj \
512 $(OUTDIR)\fold.obj \
513 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000514 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000515 $(OUTDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000516 $(OUTDIR)\main.obj \
517 $(OUTDIR)\mark.obj \
518 $(OUTDIR)\mbyte.obj \
519 $(OUTDIR)\memfile.obj \
520 $(OUTDIR)\memline.obj \
521 $(OUTDIR)\menu.obj \
522 $(OUTDIR)\message.obj \
523 $(OUTDIR)\misc1.obj \
524 $(OUTDIR)\misc2.obj \
525 $(OUTDIR)\move.obj \
526 $(OUTDIR)\normal.obj \
527 $(OUTDIR)\ops.obj \
528 $(OUTDIR)\option.obj \
529 $(OUTDIR)\os_mswin.obj \
Bram Moolenaar693e40c2013-02-26 14:56:42 +0100530 $(OUTDIR)\winclip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000531 $(OUTDIR)\os_win32.obj \
532 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000533 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000534 $(OUTDIR)\quickfix.obj \
535 $(OUTDIR)\regexp.obj \
536 $(OUTDIR)\screen.obj \
537 $(OUTDIR)\search.obj \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200538 $(OUTDIR)\sha256.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000539 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000540 $(OUTDIR)\syntax.obj \
541 $(OUTDIR)\tag.obj \
542 $(OUTDIR)\term.obj \
543 $(OUTDIR)\ui.obj \
544 $(OUTDIR)\undo.obj \
545 $(OUTDIR)\window.obj \
546 $(OUTDIR)\vim.res
547
548!if "$(OLE)" == "yes"
549CFLAGS = $(CFLAGS) -DFEAT_OLE
550RCFLAGS = $(RCFLAGS) -DFEAT_OLE
551OLE_OBJ = $(OUTDIR)\if_ole.obj
552OLE_IDL = if_ole.idl
553OLE_LIB = oleaut32.lib
554!endif
555
556!if "$(IME)" == "yes"
557CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
558!ifndef DYNAMIC_IME
559DYNAMIC_IME = yes
560!endif
561!if "$(DYNAMIC_IME)" == "yes"
562CFLAGS = $(CFLAGS) -DDYNAMIC_IME
563!else
564IME_LIB = imm32.lib
565!endif
566!endif
567
568!if "$(GIME)" == "yes"
569CFLAGS = $(CFLAGS) -DGLOBAL_IME
570OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
571MBYTE = yes
572!endif
573
574!if "$(MBYTE)" == "yes"
575CFLAGS = $(CFLAGS) -DFEAT_MBYTE
576!endif
577
578!if "$(GUI)" == "yes"
579SUBSYSTEM = windows
580CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
581RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
582VIM = g$(VIM)
583GUI_INCL = \
584 gui.h \
585 regexp.h \
586 ascii.h \
587 ex_cmds.h \
588 farsi.h \
589 feature.h \
590 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000591 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000592 keymap.h \
593 macros.h \
594 option.h \
595 os_dos.h \
596 os_win32.h
597GUI_OBJ = \
598 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000599 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000600 $(OUTDIR)\gui_w32.obj \
601 $(OUTDIR)\os_w32exe.obj
602GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000603 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000604 winspool.lib comctl32.lib advapi32.lib shell32.lib \
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200605 /machine:$(CPU)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000606!else
607SUBSYSTEM = console
608!endif
609
Bram Moolenaarce2f2e02014-08-22 18:12:57 +0200610!if "$(SUBSYSTEM_VER)" != ""
611SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
612!endif
613
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200614!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
615CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
616GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
617GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
618!endif
619
Bram Moolenaar071d4272004-06-13 20:20:40 +0000620# iconv.dll library (dynamically loaded)
621!ifndef ICONV
622ICONV = yes
623!endif
624!if "$(ICONV)" == "yes"
625CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
626!endif
627
628# libintl.dll library
629!ifndef GETTEXT
630GETTEXT = yes
631!endif
632!if "$(GETTEXT)" == "yes"
633CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
634!endif
635
636# TCL interface
637!ifdef TCL
638!ifndef TCL_VER
639TCL_VER = 83
640TCL_VER_LONG = 8.3
641!endif
642!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
643!if "$(DYNAMIC_TCL)" == "yes"
644!message Tcl DLL will be loaded dynamically
645TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000646CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
647 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000648TCL_OBJ = $(OUTDIR)\if_tcl.obj
649TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
Bram Moolenaar84a4c332012-02-22 16:01:56 +0100650TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000651!else
652CFLAGS = $(CFLAGS) -DFEAT_TCL
653TCL_OBJ = $(OUTDIR)\if_tcl.obj
654TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
655TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
656!endif
657!endif
658
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200659# Lua interface
660!ifdef LUA
661!ifndef LUA_VER
662LUA_VER = 51
663!endif
664!message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)"
665!if "$(DYNAMIC_LUA)" == "yes"
666!message Lua DLL will be loaded dynamically
667!endif
668CFLAGS = $(CFLAGS) -DFEAT_LUA
669LUA_OBJ = $(OUTDIR)\if_lua.obj
670LUA_INC = /I "$(LUA)\include" /I "$(LUA)"
671!if "$(DYNAMIC_LUA)" == "yes"
672CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \
673 -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
674LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib
675!else
676LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib"
677!endif
678!endif
679
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200680!ifdef PYTHON
681!ifdef PYTHON3
682DYNAMIC_PYTHON=yes
683DYNAMIC_PYTHON3=yes
684!endif
685!endif
686
Bram Moolenaar071d4272004-06-13 20:20:40 +0000687# PYTHON interface
688!ifdef PYTHON
689!ifndef PYTHON_VER
690PYTHON_VER = 22
691!endif
692!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
693!if "$(DYNAMIC_PYTHON)" == "yes"
694!message Python DLL will be loaded dynamically
695!endif
696CFLAGS = $(CFLAGS) -DFEAT_PYTHON
697PYTHON_OBJ = $(OUTDIR)\if_python.obj
698PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
699!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000700CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
701 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000702PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
703!else
704PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
705!endif
706!endif
707
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200708# PYTHON3 interface
709!ifdef PYTHON3
710!ifndef PYTHON3_VER
711PYTHON3_VER = 31
712!endif
713!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
714!if "$(DYNAMIC_PYTHON3)" == "yes"
715!message Python3 DLL will be loaded dynamically
716!endif
717CFLAGS = $(CFLAGS) -DFEAT_PYTHON3
718PYTHON3_OBJ = $(OUTDIR)\if_python3.obj
719PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC"
720!if "$(DYNAMIC_PYTHON3)" == "yes"
721CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \
722 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
723PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib
724!else
725PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
726!endif
727!endif
728
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000729# MzScheme interface
730!ifdef MZSCHEME
731!message MzScheme requested - root dir is "$(MZSCHEME)"
732!ifndef MZSCHEME_VER
733MZSCHEME_VER = 205_000
734!endif
735CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100736!if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \
Bram Moolenaar5c5c9802015-07-10 16:12:48 +0200737 || EXIST("$(MZSCHEME)\collects\scheme\base.rkt") \
738 || EXIST("$(MZSCHEME)\collects\racket\base.rkt")
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100739# for MzScheme >= 4 we need to include byte code for basic Scheme stuff
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000740MZSCHEME_EXTRA_DEP = mzscheme_base.c
741CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
742!endif
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100743!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib")
744MZSCHEME_MAIN_LIB=mzsch
745!else
746MZSCHEME_MAIN_LIB=racket
747!endif
748!if EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000749 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
750!message Building with Precise GC
751MZSCHEME_PRECISE_GC = yes
752CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
753!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000754!if "$(DYNAMIC_MZSCHEME)" == "yes"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000755!if "$(MZSCHEME_PRECISE_GC)" == "yes"
756!error MzScheme with Precise GC cannot be loaded dynamically
757!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000758!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000759CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100760 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000761 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000762!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000763!if "$(MZSCHEME_DEBUG)" == "yes"
764CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
765!endif
766!if "$(MZSCHEME_PRECISE_GC)" == "yes"
767# Precise GC does not use separate dll
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100768MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000769!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000770MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100771 $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000772!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000773!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000774MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
Bram Moolenaarbbc98db2012-02-12 01:55:55 +0100775# increase stack size
776MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000777!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000778
Bram Moolenaar071d4272004-06-13 20:20:40 +0000779# Perl interface
780!ifdef PERL
781!ifndef PERL_VER
782PERL_VER = 56
783!endif
784!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
785!if "$(DYNAMIC_PERL)" == "yes"
786!if $(PERL_VER) >= 56
787!message Perl DLL will be loaded dynamically
788!else
789!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
790!message Reverting to static loading...
791!undef DYNAMIC_PERL
792!endif
793!endif
794
795# Is Perl installed in architecture-specific directories?
796!if exist($(PERL)\Bin\MSWin32-x86)
797PERL_ARCH = \MSWin32-x86
798!endif
799
800PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
801
802# Version-dependent stuff
803!if $(PERL_VER) == 55
804PERL_LIB = $(PERL_INCDIR)\perl.lib
805!else
806PERL_DLL = perl$(PERL_VER).dll
Bram Moolenaar207fd752013-12-14 11:50:35 +0100807!if exist($(PERL_INCDIR)\perl$(PERL_VER).lib)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000808PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
Bram Moolenaar207fd752013-12-14 11:50:35 +0100809!else
810# For ActivePerl 5.18 and later
811PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a
812!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000813!endif
814
Bram Moolenaar367fbf12015-06-25 16:13:46 +0200815CFLAGS = $(CFLAGS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
Bram Moolenaar071d4272004-06-13 20:20:40 +0000816
817# Do we want to load Perl dynamically?
818!if "$(DYNAMIC_PERL)" == "yes"
819CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
820!undef PERL_LIB
821!endif
822
823PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
824PERL_INC = /I $(PERL_INCDIR)
825PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
826XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
Bram Moolenaar52f83172011-09-14 19:01:42 +0200827!if exist($(XSUBPP))
Bram Moolenaar612af432011-09-14 10:49:46 +0200828XSUBPP = $(PERL_EXE) $(XSUBPP)
829!else
830XSUBPP = xsubpp
831!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000832XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
833
834!endif
835
836#
837# Support Ruby interface
838#
839!ifdef RUBY
840# Set default value
841!ifndef RUBY_VER
842RUBY_VER = 18
843!endif
844!ifndef RUBY_VER_LONG
845RUBY_VER_LONG = 1.8
846!endif
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200847!ifndef RUBY_API_VER
848RUBY_API_VER = $(RUBY_VER_LONG:.=)
849!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000850
851!if $(RUBY_VER) >= 18
852!ifndef RUBY_PLATFORM
853RUBY_PLATFORM = i386-mswin32
854!endif
855!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200856RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000857!endif
858!else
859!ifndef RUBY_PLATFORM
860RUBY_PLATFORM = i586-mswin32
861!endif
862!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200863RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000864!endif
865!endif # $(RUBY_VER) >= 18
866
867!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
868CFLAGS = $(CFLAGS) -DFEAT_RUBY
869RUBY_OBJ = $(OUTDIR)\if_ruby.obj
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200870!if $(RUBY_VER) >= 19
871RUBY_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 +0200872!else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000873RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
Bram Moolenaar69154f22010-07-18 21:42:34 +0200874!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000875RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
876# Do we want to load Ruby dynamically?
877!if "$(DYNAMIC_RUBY)" == "yes"
878!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000879CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
880 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000881!undef RUBY_LIB
882!endif
883!endif # RUBY
884
885#
886# Support PostScript printing
887#
888!if "$(POSTSCRIPT)" == "yes"
889CFLAGS = $(CFLAGS) -DMSWINPS
890!endif # POSTSCRIPT
891
892#
893# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
894#
895!if "$(FEATURES)"==""
896FEATURES = BIG
897!endif
898CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
899
900#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000901# Always generate the .pdb file, so that we get debug symbols that can be used
902# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000903# Generate edit-and-continue debug info when no optimization - allows to
904# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000905#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000906CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
907LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000908
909#
910# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000911#
912!message
913
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000914conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000915
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000916PATHDEF_SRC = $(OUTDIR)\pathdef.c
917
Bram Moolenaar071d4272004-06-13 20:20:40 +0000918!IF "$(MAP)" == "yes"
919# "/map" is for debugging
920conflags = $(conflags) /map
921!ELSEIF "$(MAP)" == "lines"
922# "/mapinfo:lines" is for debugging, only works for VC6 and later
923conflags = $(conflags) /map /mapinfo:lines
924!ENDIF
925
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000926LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaarf300ad22015-05-04 16:18:42 +0200927LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200928 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000929 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000930
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000931# Report link time code generation progress if used.
932!ifdef NODEBUG
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +0100933!if $(MSVC_MAJOR) >= 8
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000934!if "$(OPTIMIZE)" != "SPACE"
935LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
936!endif
937!endif
938!endif
939
Bram Moolenaarb6356332005-07-18 21:40:44 +0000940all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
941 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000942
Bram Moolenaarb6356332005-07-18 21:40:44 +0000943$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200944 $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200945 $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
946 version.c version.h
Bram Moolenaarb6356332005-07-18 21:40:44 +0000947 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000948 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200949 $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000950 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
951 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaarb7776182014-05-22 16:29:06 +0200952 if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000953
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000954$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000955
956$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000957 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000958
959install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +0000960 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +0200961 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000962 - if exist install.exe del install.exe
963 ren dosinst.exe install.exe
964
965uninstal.exe: uninstal.c
966 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
967
968vimrun.exe: vimrun.c
969 $(CC) /nologo -DNDEBUG vimrun.c
970
971xxd/xxd.exe: xxd/xxd.c
972 cd xxd
973 $(MAKE) /NOLOGO -f Make_mvc.mak
974 cd ..
975
976GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
977 cd GvimExt
978 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
979 cd ..
980
981
982tags: notags
983 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
984
985notags:
986 - if exist tags del tags
987
988clean:
Bram Moolenaar02743632005-07-25 20:42:36 +0000989 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000990 - if exist *.obj del *.obj
991 - if exist $(VIM).exe del $(VIM).exe
992 - if exist $(VIM).ilk del $(VIM).ilk
993 - if exist $(VIM).pdb del $(VIM).pdb
994 - if exist $(VIM).map del $(VIM).map
995 - if exist $(VIM).ncb del $(VIM).ncb
996 - if exist vimrun.exe del vimrun.exe
997 - if exist install.exe del install.exe
998 - if exist uninstal.exe del uninstal.exe
999 - if exist if_perl.c del if_perl.c
1000 - if exist dimm.h del dimm.h
1001 - if exist dimm_i.c del dimm_i.c
1002 - if exist dimm.tlb del dimm.tlb
1003 - if exist dosinst.exe del dosinst.exe
Bram Moolenaar2d6db762009-09-11 10:49:58 +00001004 - if exist mzscheme_base.c del mzscheme_base.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001005 cd xxd
1006 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1007 cd ..
1008 cd GvimExt
1009 $(MAKE) /NOLOGO -f Makefile clean
1010 cd ..
1011 cd GvimExt
1012 $(MAKE) /NOLOGO -f Makefile clean
1013 cd ..
1014 - if exist testdir\*.out del testdir\*.out
1015
1016test:
1017 cd testdir
1018 $(MAKE) /NOLOGO -f Make_dos.mak win32
1019 cd ..
1020
Bram Moolenaar34114692005-01-02 11:28:13 +00001021testclean:
1022 cd testdir
1023 $(MAKE) /NOLOGO -f Make_dos.mak clean
1024 cd ..
1025
Bram Moolenaar071d4272004-06-13 20:20:40 +00001026###########################################################################
1027
1028# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
1029# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +01001030!IF "$(_NMAKE_VER)" == ""
Bram Moolenaar071d4272004-06-13 20:20:40 +00001031.c{$(OUTDIR)/}.obj:
1032!ELSE
1033.c{$(OUTDIR)/}.obj::
1034!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001035 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001036
1037# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
1038# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaar90f5d0a2015-12-03 22:37:21 +01001039!IF "$(_NMAKE_VER)" == ""
Bram Moolenaar071d4272004-06-13 20:20:40 +00001040.cpp{$(OUTDIR)/}.obj:
1041!ELSE
1042.cpp{$(OUTDIR)/}.obj::
1043!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001044 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001045
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001046$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
1047
Bram Moolenaaredac1852010-05-18 20:34:20 +02001048$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001049
Bram Moolenaar071d4272004-06-13 20:20:40 +00001050$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
1051
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001052$(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL)
1053
1054$(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c $(INCL)
1055
Bram Moolenaar071d4272004-06-13 20:20:40 +00001056$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
1057
1058$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
1059
1060$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
1061
1062$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
1063
1064$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
1065
1066$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
1067
1068$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
1069
1070$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
1071
1072$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
1073
1074$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
1075
1076$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
1077
1078$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
1079
Bram Moolenaar58d98232005-07-23 22:25:46 +00001080$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
1081
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001082$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +00001083
Bram Moolenaar071d4272004-06-13 20:20:40 +00001084$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
1085
Bram Moolenaar52b4b552005-03-07 23:00:57 +00001086$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
1087
Bram Moolenaar071d4272004-06-13 20:20:40 +00001088$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
1089
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +02001090$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
1091
Bram Moolenaar071d4272004-06-13 20:20:40 +00001092$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
1093
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001094$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
1095 $(CC) $(CFLAGS) $(LUA_INC) if_lua.c
1096
Bram Moolenaar071d4272004-06-13 20:20:40 +00001097if_perl.c : if_perl.xs typemap
Bram Moolenaar612af432011-09-14 10:49:46 +02001098 $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001099 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001100
1101$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001102 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001103
1104$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001105 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001106
Bram Moolenaar75676462013-01-30 14:55:42 +01001107$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +00001108 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001109 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001110mzscheme_base.c:
Bram Moolenaar5c5c9802015-07-10 16:12:48 +02001111!IF "$(MZSCHEME_MAIN_LIB)" == "racket"
1112 $(MZSCHEME)\raco ctool --c-mods mzscheme_base.c ++lib scheme/base
1113!ELSE
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001114 $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
Bram Moolenaar5c5c9802015-07-10 16:12:48 +02001115!ENDIF
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001116
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001117$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001118 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001119
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001120$(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL)
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001121 $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c
1122
Bram Moolenaar071d4272004-06-13 20:20:40 +00001123$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
1124
1125$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001126 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001127
1128$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001129 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001130
1131$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001132 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001133
1134$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
1135
1136$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
1137
1138$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
1139
1140$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1141
1142$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1143
1144$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1145
1146$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1147
1148$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1149
1150$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1151
1152$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1153
1154$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1155
1156$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1157
1158$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1159
1160$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1161
1162$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1163
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001164$(OUTDIR)/winclip.obj: $(OUTDIR) winclip.c $(INCL)
1165
Bram Moolenaar071d4272004-06-13 20:20:40 +00001166$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1167
1168$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1169
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001170$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1171 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001172
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001173$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001174
Bram Moolenaar071d4272004-06-13 20:20:40 +00001175$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1176
Bram Moolenaarfbc0d2e2013-05-19 19:40:29 +02001177$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c regexp_nfa.c $(INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001178
1179$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1180
1181$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1182
Bram Moolenaaredac1852010-05-18 20:34:20 +02001183$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1184
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001185$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1186
Bram Moolenaar071d4272004-06-13 20:20:40 +00001187$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1188
1189$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1190
1191$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1192
1193$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1194
1195$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1196
1197$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1198
1199$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001200 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001201
Bram Moolenaarcc448b32010-07-14 16:52:17 +02001202$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
1203 tearoff.bmp vim.ico vim_error.ico \
1204 vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001205 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1206
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001207iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001208 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1209 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001210
1211dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001212 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001213
1214$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1215
1216$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1217
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001218# $CFLAGS may contain backslashes and double quotes, escape them both.
1219E0_CFLAGS = $(CFLAGS:\=\\)
1220E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001221# ") stop the string
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001222# $LINKARGS2 may contain backslashes and double quotes, escape them both.
1223E0_LINKARGS2 = $(LINKARGS2:\=\\)
1224E_LINKARGS2 = $(E0_LINKARGS2:"=\")
1225# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001226
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001227$(PATHDEF_SRC): auto
1228 @echo creating $(PATHDEF_SRC)
1229 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1230 @echo #include "vim.h" >> $(PATHDEF_SRC)
1231 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1232 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1233 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001234 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC)
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001235 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1236 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001237
1238auto:
1239 if not exist auto/nul mkdir auto
1240
1241# End Custom Build
1242proto.h: \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001243 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001244 proto/buffer.pro \
1245 proto/charset.pro \
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001246 proto/crypt.pro \
1247 proto/crypt_zip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001248 proto/diff.pro \
1249 proto/digraph.pro \
1250 proto/edit.pro \
1251 proto/eval.pro \
1252 proto/ex_cmds.pro \
1253 proto/ex_cmds2.pro \
1254 proto/ex_docmd.pro \
1255 proto/ex_eval.pro \
1256 proto/ex_getln.pro \
1257 proto/fileio.pro \
1258 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001259 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001260 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001261 proto/main.pro \
1262 proto/mark.pro \
1263 proto/memfile.pro \
1264 proto/memline.pro \
1265 proto/menu.pro \
1266 proto/message.pro \
1267 proto/misc1.pro \
1268 proto/misc2.pro \
1269 proto/move.pro \
1270 proto/mbyte.pro \
1271 proto/normal.pro \
1272 proto/ops.pro \
1273 proto/option.pro \
1274 proto/os_mswin.pro \
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001275 proto/winclip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001276 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001277 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001278 proto/quickfix.pro \
1279 proto/regexp.pro \
1280 proto/screen.pro \
1281 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001282 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001283 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001284 proto/syntax.pro \
1285 proto/tag.pro \
1286 proto/term.pro \
1287 proto/ui.pro \
1288 proto/undo.pro \
1289 proto/window.pro \
1290 $(NETBEANS_PRO)
1291
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001292.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001293
1294# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1295# foo.cod"
1296.c.cod:
1297 $(CC) $(CFLAGS) /FAcs $<
1298
1299# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1300.c.i:
1301 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001302
1303
Bram Moolenaar071d4272004-06-13 20:20:40 +00001304# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: