blob: 24069b24e99116b8e87f1591c71ee8ab17d66623 [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 Moolenaar7887d882005-07-01 22:33:52 +000053# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc]
54# (default is 56)
55#
Bram Moolenaar071d4272004-06-13 20:20:40 +000056# Python interface:
57# PYTHON=[Path to Python directory]
58# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
59# PYTHON_VER=[Python version, eg 15, 20] (default is 22)
Bram Moolenaar7887d882005-07-01 22:33:52 +000060#
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +020061# Python3 interface:
62# PYTHON3=[Path to Python3 directory]
63# DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
64# PYTHON3_VER=[Python3 version, eg 30, 31] (default is 31)
65#
Bram Moolenaar071d4272004-06-13 20:20:40 +000066# Ruby interface:
67# RUBY=[Path to Ruby directory]
68# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
69# RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
70# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
71# You must set RUBY_VER_LONG when change RUBY_VER.
Bram Moolenaarda3cb832012-08-02 21:21:47 +020072# You must set RUBY_API_VER to RUBY_VER_LONG.
73# Don't set ruby API version to RUBY_VER like 191.
Bram Moolenaar7887d882005-07-01 22:33:52 +000074#
Bram Moolenaar071d4272004-06-13 20:20:40 +000075# Tcl interface:
76# TCL=[Path to Tcl directory]
77# DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
78# TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
79# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
80# You must set TCL_VER_LONG when you set TCL_VER.
Bram Moolenaar7887d882005-07-01 22:33:52 +000081#
82# SNiFF+ interface: SNIFF=yes
83#
84# Cscope support: CSCOPE=yes
85#
86# Iconv library support (always dynamically loaded):
87# ICONV=[yes or no] (default is yes)
88#
89# Intl library support (always dynamically loaded):
90# GETTEXT=[yes or no] (default is yes)
91# See http://sourceforge.net/projects/gettext/
92#
Bram Moolenaar884f6e42013-05-19 21:03:54 +020093# PostScript printing: POSTSCRIPT=yes (default is no)
Bram Moolenaar7887d882005-07-01 22:33:52 +000094#
Bram Moolenaar884f6e42013-05-19 21:03:54 +020095# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
Bram Moolenaar7887d882005-07-01 22:33:52 +000096#
Bram Moolenaar884f6e42013-05-19 21:03:54 +020097# XPM Image Support: XPM=[path to XPM directory]
98# Default is "xpm", using the files included in the distribution.
99# Use "no" to disable this feature.
Bram Moolenaar7887d882005-07-01 22:33:52 +0000100#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200101# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000102#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200103# Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
104# i386)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000105#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200106# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000107#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000108# Debug version: DEBUG=yes
109# Mapfile: MAP=[no, yes or lines] (default is yes)
110# no: Don't write a mapfile.
111# yes: Write a normal mapfile.
112# lines: Write a mapfile with line numbers (only for VC6 and later)
Bram Moolenaar7887d882005-07-01 22:33:52 +0000113#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200114# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
115# doesn't work)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000116#
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200117# Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
118#
119# Static Code Analysis: ANALYZE=yes (works with VS2012 only)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000120#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000121# You can combine any of these interfaces
122#
123# Example: To build the non-debug, GUI version with Perl interface:
124# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
125#
Bram Moolenaar071d4272004-06-13 20:20:40 +0000126# DEBUG with Make_mvc.mak and Make_dvc.mak:
127# This makefile gives a fineness of control which is not supported in
128# Visual C++ configuration files. Therefore, debugging requires a bit of
129# extra work.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000130# Make_dvc.mak is a Visual C++ project to access that support. It may be
131# badly out of date for the Visual C++ you are using...
Bram Moolenaar071d4272004-06-13 20:20:40 +0000132# To use Make_dvc.mak:
133# 1) Build Vim with Make_mvc.mak.
134# Use a "DEBUG=yes" argument to build Vim with debug support.
135# E.g. the following builds gvimd.exe:
136# nmake -f Make_mvc.mak debug=yes gui=yes
137# 2) Use MS Devstudio and set it up to allow that file to be debugged:
138# i) Pass Make_dvc.mak to the IDE.
139# Use the "open workspace" menu entry to load Make_dvc.mak.
140# Alternatively, from the command line:
141# msdev /nologo Make_dvc.mak
142# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
143# this and offer to convert it to their own format. Accept that.
144# It creates a file called Make_dvc.dsw which can then be used
145# for further operations. E.g.
146# msdev /nologo Make_dvc.dsw
147# ii) Set the built executable for debugging:
148# a) Alt+F7/Debug takes you to the Debug dialog.
149# b) Fill "Executable for debug session". e.g. gvimd.exe
150# c) Fill "Program arguments". e.g. -R dosinst.c
151# d) Complete the dialog
152# 3) You can now debug the executable you built with Make_mvc.mak
153#
154# Note: Make_dvc.mak builds vimrun.exe, because it must build something
155# to be a valid makefile..
156
157### See feature.h for a list of optionals.
158# If you want to build some optional features without modifying the source,
159# you can set DEFINES on the command line, e.g.,
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000160# nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000161
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000162# Build on both Windows NT/XP and Windows 9x
Bram Moolenaar071d4272004-06-13 20:20:40 +0000163
164TARGETOS = BOTH
165
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000166# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
167# interfaces.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000168# If you change something else, do "make clean" first!
169!if "$(GUI)" == "yes"
170OBJDIR = .\ObjG
171!else
172OBJDIR = .\ObjC
173!endif
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200174!if "$(DIRECTX)" == "yes"
175OBJDIR = $(OBJDIR)X
176!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000177!if "$(OLE)" == "yes"
178OBJDIR = $(OBJDIR)O
179!endif
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200180!ifdef LUA
181OBJDIR = $(OBJDIR)U
182!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000183!ifdef PERL
184OBJDIR = $(OBJDIR)L
185!endif
186!ifdef PYTHON
187OBJDIR = $(OBJDIR)Y
188!endif
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200189!ifdef PYTHON3
190OBJDIR = $(OBJDIR)H
191!endif
Bram Moolenaar9ba0eb82005-06-13 22:28:56 +0000192!ifdef TCL
193OBJDIR = $(OBJDIR)T
194!endif
195!ifdef RUBY
196OBJDIR = $(OBJDIR)R
197!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000198!ifdef MZSCHEME
199OBJDIR = $(OBJDIR)Z
200!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000201!if "$(DEBUG)" == "yes"
202OBJDIR = $(OBJDIR)d
203!endif
204
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000205# Win32.mak requires that CPU be set appropriately.
206# To cross-compile for Win64, set CPU=AMD64 or CPU=IA64.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000207
208!ifdef PROCESSOR_ARCHITECTURE
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000209# We're on Windows NT or using VC 6+
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000210! ifdef CPU
211ASSEMBLY_ARCHITECTURE=$(CPU)
Bram Moolenaarf9393ef2006-04-24 19:47:27 +0000212# Using I386 for $ASSEMBLY_ARCHITECTURE doesn't work for VC7.
213! if ("$(ASSEMBLY_ARCHITECTURE)" == "i386") || ("$(ASSEMBLY_ARCHITECTURE)" == "I386")
214ASSEMBLY_ARCHITECTURE = x86
215! endif
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000216! else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000217CPU = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaareb3593b2006-04-22 22:33:57 +0000218ASSEMBLY_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000219! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000220CPU = i386
Bram Moolenaara93fa7e2006-04-17 22:14:47 +0000221! endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000222! endif
223!else # !PROCESSOR_ARCHITECTURE
224# We're on Windows 95
225CPU = i386
226!endif # !PROCESSOR_ARCHITECTURE
Bram Moolenaare2db4362012-09-05 17:57:39 +0200227OBJDIR = $(OBJDIR)$(CPU)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000228
Bram Moolenaar071d4272004-06-13 20:20:40 +0000229# Build a retail version by default
230
231!if "$(DEBUG)" != "yes"
232NODEBUG = 1
233!else
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000234!undef NODEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000235MAKEFLAGS_GVIMEXT = DEBUG=yes
236!endif
237
238
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000239# Get all sorts of useful, standard macros from the Platform SDK.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000240
Bram Moolenaar6f586de2012-09-18 22:00:08 +0200241!ifdef SDK_INCLUDE_DIR
242!include $(SDK_INCLUDE_DIR)\Win32.mak
243!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000244!include <Win32.mak>
Bram Moolenaar6f586de2012-09-18 22:00:08 +0200245!endif
246
Bram Moolenaar071d4272004-06-13 20:20:40 +0000247
Bram Moolenaar8cd213c2010-06-01 21:57:09 +0200248# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200249WP64CHECK = /Wp64
Bram Moolenaar071d4272004-06-13 20:20:40 +0000250
251#>>>>> path of the compiler and linker; name of include and lib directories
252# PATH = c:\msvc20\bin;$(PATH)
253# INCLUDE = c:\msvc20\include
254# LIB = c:\msvc20\lib
255
256!ifndef CTAGS
257CTAGS = ctags
258!endif
259
260!if "$(SNIFF)" == "yes"
261# SNIFF - Include support for SNiFF+.
262SNIFF_INCL = if_sniff.h
263SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
Bram Moolenaarb6356332005-07-18 21:40:44 +0000264SNIFF_LIB = shell32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000265SNIFF_DEFS = -DFEAT_SNIFF
266# The SNiFF integration needs multithreaded libraries!
267MULTITHREADED = yes
268!endif
269
270!ifndef CSCOPE
271CSCOPE = yes
272!endif
273
274!if "$(CSCOPE)" == "yes"
275# CSCOPE - Include support for Cscope
276CSCOPE_INCL = if_cscope.h
277CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
278CSCOPE_DEFS = -DFEAT_CSCOPE
279!endif
280
281!ifndef NETBEANS
282NETBEANS = $(GUI)
283!endif
284
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000285# Only allow NETBEANS and XPM for a GUI build.
286!if "$(GUI)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000287!if "$(NETBEANS)" == "yes"
288# NETBEANS - Include support for Netbeans integration
289NETBEANS_PRO = proto/netbeans.pro
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000290NETBEANS_OBJ = $(OBJDIR)/netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000291NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000292
293!if "$(NBDEBUG)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000294NBDEBUG_DEFS = -DNBDEBUG
295NBDEBUG_INCL = nbdebug.h
296NBDEBUG_SRC = nbdebug.c
297!endif
Bram Moolenaarb6356332005-07-18 21:40:44 +0000298NETBEANS_LIB = WSock32.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000299!endif
300
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200301# DirectWrite(DirectX)
302!if "$(DIRECTX)" == "yes"
303DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
304DIRECTX_INCL = gui_dwrite.h
305DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj
306!endif
307
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200308!ifndef XPM
309# XPM is not set, use the included xpm files, depending on the architecture.
Bram Moolenaare2db4362012-09-05 17:57:39 +0200310!if "$(CPU)" == "AMD64"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200311XPM = xpm\x64
Bram Moolenaare2db4362012-09-05 17:57:39 +0200312!elseif "$(CPU)" == "i386"
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200313XPM = xpm\x86
Bram Moolenaare2db4362012-09-05 17:57:39 +0200314!else
315XPM = no
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200316!endif
317!endif
318!if "$(XPM)" != "no"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000319# XPM - Include support for XPM signs
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200320# See the xpm directory for more information.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000321XPM_OBJ = $(OBJDIR)/xpm_w32.obj
322XPM_DEFS = -DFEAT_XPM_W32
323XPM_LIB = $(XPM)\lib\libXpm.lib
Bram Moolenaarc6c1d8b2012-08-29 14:18:33 +0200324XPM_INC = -I $(XPM)\include -I $(XPM)\..\include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000325!endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000326!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000327
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000328# Set which version of the CRT to use
Bram Moolenaar071d4272004-06-13 20:20:40 +0000329!if defined(USE_MSVCRT)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000330# CVARS = $(cvarsdll)
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000331# !elseif defined(MULTITHREADED)
332# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000333!else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000334# CVARS = $(cvars)
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000335# CVARS = $(cvarsmt)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000336!endif
337
338# need advapi32.lib for GetUserName()
339# need shell32.lib for ExtractIcon()
340# gdi32.lib and comdlg32.lib for printing support
341# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000342CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
343 comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000344!if "$(DELAYLOAD)" == "yes"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000345CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
346!endif
347
348### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
349# When set to 0x0500 ":browse" stops working.
350!ifndef WINVER
351WINVER = 0x0400
352!endif
353
354# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
355# default, use these lines.
356#VIMRCLOC = somewhere
357#VIMRUNTIMEDIR = somewhere
358
359CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
360 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
361 $(NBDEBUG_DEFS) $(XPM_DEFS) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000362 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
363 /Fo$(OUTDIR)/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000364
365#>>>>> end of choices
366###########################################################################
367
368!ifdef OS
369OS_TYPE = winnt
370DEL_TREE = rmdir /s /q
371!else
372OS_TYPE = win95
373DEL_TREE = deltree /y
374!endif
375
376INTDIR=$(OBJDIR)
377OUTDIR=$(OBJDIR)
378
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000379# Derive version of VC being used from nmake if not specified
380!if "$(MSVCVER)" == ""
381!if "$(_NMAKE_VER)" == ""
382MSVCVER = 4.0
383!endif
384!if "$(_NMAKE_VER)" == "162"
385MSVCVER = 5.0
386!endif
387!if "$(_NMAKE_VER)" == "6.00.8168.0"
388MSVCVER = 6.0
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000389CPU = ix86
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000390!endif
Bram Moolenaar67a4f6c2012-10-21 02:41:08 +0200391!if "$(_NMAKE_VER)" == "6.00.9782.0"
392MSVCVER = 6.0
393CPU = ix86
394!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000395!if "$(_NMAKE_VER)" == "7.00.9466"
396MSVCVER = 7.0
397!endif
398!if "$(_NMAKE_VER)" == "7.10.3077"
399MSVCVER = 7.1
400!endif
401!if "$(_NMAKE_VER)" == "8.00.50727.42"
402MSVCVER = 8.0
403!endif
404!if "$(_NMAKE_VER)" == "8.00.50727.762"
405MSVCVER = 8.0
406!endif
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000407!if "$(_NMAKE_VER)" == "9.00.20706.01"
408MSVCVER = 9.0
409!endif
Bram Moolenaara7241f52008-06-24 20:39:31 +0000410!if "$(_NMAKE_VER)" == "9.00.21022.08"
411MSVCVER = 9.0
412!endif
Bram Moolenaar13658312009-02-04 17:35:52 +0000413!if "$(_NMAKE_VER)" == "9.00.30729.01"
414MSVCVER = 9.0
415!endif
Bram Moolenaarda2f99a2009-06-16 14:34:38 +0000416!if "$(_NMAKE_VER)" == "10.00.20506.01"
417MSVCVER = 10.0
418!endif
Bram Moolenaar2498b3a2010-03-02 17:59:44 +0100419!if "$(_NMAKE_VER)" == "10.00.30128.01"
420MSVCVER = 10.0
421!endif
Bram Moolenaar218116c2010-05-20 21:46:00 +0200422!if "$(_NMAKE_VER)" == "10.00.30319.01"
423MSVCVER = 10.0
424!endif
Bram Moolenaare3a22462012-10-23 05:35:34 +0200425!if "$(_NMAKE_VER)" == "10.00.40219.01"
426MSVCVER = 10.0
427!endif
Bram Moolenaar2b017fa2012-09-18 18:27:12 +0200428!if "$(_NMAKE_VER)" == "11.00.50727.1"
429MSVCVER = 11.0
430!endif
Bram Moolenaar52cc2662012-12-06 21:30:29 +0100431!if "$(_NMAKE_VER)" == "11.00.51106.1"
432MSVCVER = 11.0
433!endif
Bram Moolenaar29042482013-05-07 05:11:17 +0200434!if "$(_NMAKE_VER)" == "11.00.60315.1"
435MSVCVER = 11.0
436!endif
Bram Moolenaarc64b85a2013-07-09 13:15:46 +0200437!if "$(_NMAKE_VER)" == "11.00.60610.1"
438MSVCVER = 11.0
439!endif
Bram Moolenaarc8643822014-02-15 19:47:51 +0100440!if "$(_NMAKE_VER)" == "11.00.61030.0"
441MSVCVER = 11.0
442!endif
Bram Moolenaare5878f42013-11-08 03:15:47 +0100443!if "$(_NMAKE_VER)" == "12.00.21005.1"
444MSVCVER = 12.0
445!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000446!endif
447
Bram Moolenaar84a05ac2013-05-06 04:24:17 +0200448# Abort building VIM if version of VC is unrecognised.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000449!ifndef MSVCVER
450!message *** ERROR
451!message Cannot determine Visual C version being used. If you are using the
452!message Windows SDK then you must have the environment variable MSVCVER set to
453!message your version of the VC compiler. If you are not using the Express
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000454!message version of Visual C, you can either set MSVCVER or update this makefile
455!message to handle the new value for _NMAKE_VER, "$(_NMAKE_VER)".
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000456!error Make aborted.
457!endif
458
Bram Moolenaar071d4272004-06-13 20:20:40 +0000459# Convert processor ID to MVC-compatible number
Bram Moolenaare5878f42013-11-08 03:15:47 +0100460!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0") && ("$(MSVCVER)" != "11.0") && ("$(MSVCVER)" != "12.0")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000461!if "$(CPUNR)" == "i386"
462CPUARG = /G3
463!elseif "$(CPUNR)" == "i486"
464CPUARG = /G4
465!elseif "$(CPUNR)" == "i586"
466CPUARG = /G5
467!elseif "$(CPUNR)" == "i686"
468CPUARG = /G6
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000469!elseif "$(CPUNR)" == "pentium4"
Bram Moolenaar34114692005-01-02 11:28:13 +0000470CPUARG = /G7 /arch:SSE2
Bram Moolenaar071d4272004-06-13 20:20:40 +0000471!else
472CPUARG =
473!endif
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000474!else
Bram Moolenaar3ed16dc2011-06-12 20:31:31 +0200475# VC8/9/10 only allows specifying SSE architecture but only for 32bit
476!if "$(ASSEMBLY_ARCHITECTURE)" == "x86" && "$(CPUNR)" == "pentium4"
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000477CPUARG = /arch:SSE2
478!endif
479!endif
480
481LIBC =
482DEBUGINFO = /Zi
Bram Moolenaar071d4272004-06-13 20:20:40 +0000483
484!ifdef NODEBUG
485VIM = vim
486!if "$(OPTIMIZE)" == "SPACE"
487OPTFLAG = /O1
488!elseif "$(OPTIMIZE)" == "SPEED"
489OPTFLAG = /O2
490!else # MAXSPEED
491OPTFLAG = /Ox
492!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200493
Bram Moolenaare5878f42013-11-08 03:15:47 +0100494!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") || ("$(MSVCVER)" == "12.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000495# Use link time code generation if not worried about size
496!if "$(OPTIMIZE)" != "SPACE"
497OPTFLAG = $(OPTFLAG) /GL
498!endif
499!endif
Bram Moolenaar83d09bb2010-06-01 19:58:08 +0200500
501# (/Wp64 is deprecated in VC9 and generates an obnoxious warning.)
502!if ("$(MSVCVER)" == "7.0") || ("$(MSVCVER)" == "7.1") || ("$(MSVCVER)" == "8.0")
503CFLAGS=$(CFLAGS) $(WP64CHECK)
504!endif
505
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200506# Static code analysis generally available starting with VS2012
Bram Moolenaar815135e2013-11-09 02:32:18 +0100507!if ("$(ANALYZE)" == "yes") && (("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") || ("$(MSVCVER)" == "12.0"))
Bram Moolenaar884f6e42013-05-19 21:03:54 +0200508CFLAGS=$(CFLAGS) /analyze
509!endif
510
Bram Moolenaar34114692005-01-02 11:28:13 +0000511CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000512RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
Bram Moolenaar071d4272004-06-13 20:20:40 +0000513! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000514CFLAGS = $(CFLAGS) /MD
Bram Moolenaar071d4272004-06-13 20:20:40 +0000515LIBC = msvcrt.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +0000516! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000517LIBC = libcmt.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000518CFLAGS = $(CFLAGS) /Zl /MT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000519! endif
520!else # DEBUG
521VIM = vimd
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000522! if ("$(CPU)" == "i386") || ("$(CPU)" == "ix86")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000523DEBUGINFO = /ZI
524! endif
Bram Moolenaard9d30582005-05-18 22:10:28 +0000525CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
Bram Moolenaar071d4272004-06-13 20:20:40 +0000526RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
527# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000528! if "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000529LIBC =
530! else
531LIBC = /fixed:no
532! endif
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000533! ifdef USE_MSVCRT
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000534CFLAGS = $(CFLAGS) /MDd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000535LIBC = $(LIBC) msvcrtd.lib
Bram Moolenaar6a9aa372005-07-20 21:54:57 +0000536! else
Bram Moolenaar362e1a32006-03-06 23:29:24 +0000537LIBC = $(LIBC) libcmtd.lib
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000538CFLAGS = $(CFLAGS) /Zl /MTd
Bram Moolenaar071d4272004-06-13 20:20:40 +0000539! endif
540!endif # DEBUG
541
542INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
543 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
544 $(NBDEBUG_INCL)
545
546OBJ = \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200547 $(OUTDIR)\blowfish.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000548 $(OUTDIR)\buffer.obj \
549 $(OUTDIR)\charset.obj \
550 $(OUTDIR)\diff.obj \
551 $(OUTDIR)\digraph.obj \
552 $(OUTDIR)\edit.obj \
553 $(OUTDIR)\eval.obj \
554 $(OUTDIR)\ex_cmds.obj \
555 $(OUTDIR)\ex_cmds2.obj \
556 $(OUTDIR)\ex_docmd.obj \
557 $(OUTDIR)\ex_eval.obj \
558 $(OUTDIR)\ex_getln.obj \
559 $(OUTDIR)\fileio.obj \
560 $(OUTDIR)\fold.obj \
561 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000562 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000563 $(OUTDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000564 $(OUTDIR)\main.obj \
565 $(OUTDIR)\mark.obj \
566 $(OUTDIR)\mbyte.obj \
567 $(OUTDIR)\memfile.obj \
568 $(OUTDIR)\memline.obj \
569 $(OUTDIR)\menu.obj \
570 $(OUTDIR)\message.obj \
571 $(OUTDIR)\misc1.obj \
572 $(OUTDIR)\misc2.obj \
573 $(OUTDIR)\move.obj \
574 $(OUTDIR)\normal.obj \
575 $(OUTDIR)\ops.obj \
576 $(OUTDIR)\option.obj \
577 $(OUTDIR)\os_mswin.obj \
Bram Moolenaar693e40c2013-02-26 14:56:42 +0100578 $(OUTDIR)\winclip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000579 $(OUTDIR)\os_win32.obj \
580 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000581 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000582 $(OUTDIR)\quickfix.obj \
583 $(OUTDIR)\regexp.obj \
584 $(OUTDIR)\screen.obj \
585 $(OUTDIR)\search.obj \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200586 $(OUTDIR)\sha256.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000587 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000588 $(OUTDIR)\syntax.obj \
589 $(OUTDIR)\tag.obj \
590 $(OUTDIR)\term.obj \
591 $(OUTDIR)\ui.obj \
592 $(OUTDIR)\undo.obj \
593 $(OUTDIR)\window.obj \
594 $(OUTDIR)\vim.res
595
596!if "$(OLE)" == "yes"
597CFLAGS = $(CFLAGS) -DFEAT_OLE
598RCFLAGS = $(RCFLAGS) -DFEAT_OLE
599OLE_OBJ = $(OUTDIR)\if_ole.obj
600OLE_IDL = if_ole.idl
601OLE_LIB = oleaut32.lib
602!endif
603
604!if "$(IME)" == "yes"
605CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
606!ifndef DYNAMIC_IME
607DYNAMIC_IME = yes
608!endif
609!if "$(DYNAMIC_IME)" == "yes"
610CFLAGS = $(CFLAGS) -DDYNAMIC_IME
611!else
612IME_LIB = imm32.lib
613!endif
614!endif
615
616!if "$(GIME)" == "yes"
617CFLAGS = $(CFLAGS) -DGLOBAL_IME
618OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
619MBYTE = yes
620!endif
621
622!if "$(MBYTE)" == "yes"
623CFLAGS = $(CFLAGS) -DFEAT_MBYTE
624!endif
625
626!if "$(GUI)" == "yes"
627SUBSYSTEM = windows
628CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
629RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
630VIM = g$(VIM)
631GUI_INCL = \
632 gui.h \
633 regexp.h \
634 ascii.h \
635 ex_cmds.h \
636 farsi.h \
637 feature.h \
638 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000639 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000640 keymap.h \
641 macros.h \
642 option.h \
643 os_dos.h \
644 os_win32.h
645GUI_OBJ = \
646 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000647 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000648 $(OUTDIR)\gui_w32.obj \
649 $(OUTDIR)\os_w32exe.obj
650GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000651 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000652 winspool.lib comctl32.lib advapi32.lib shell32.lib \
653 /machine:$(CPU) /nodefaultlib
654!else
655SUBSYSTEM = console
656!endif
657
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200658!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
659CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
660GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
661GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
662!endif
663
Bram Moolenaar071d4272004-06-13 20:20:40 +0000664# iconv.dll library (dynamically loaded)
665!ifndef ICONV
666ICONV = yes
667!endif
668!if "$(ICONV)" == "yes"
669CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
670!endif
671
672# libintl.dll library
673!ifndef GETTEXT
674GETTEXT = yes
675!endif
676!if "$(GETTEXT)" == "yes"
677CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
678!endif
679
680# TCL interface
681!ifdef TCL
682!ifndef TCL_VER
683TCL_VER = 83
684TCL_VER_LONG = 8.3
685!endif
686!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
687!if "$(DYNAMIC_TCL)" == "yes"
688!message Tcl DLL will be loaded dynamically
689TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000690CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
691 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000692TCL_OBJ = $(OUTDIR)\if_tcl.obj
693TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
Bram Moolenaar84a4c332012-02-22 16:01:56 +0100694TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000695!else
696CFLAGS = $(CFLAGS) -DFEAT_TCL
697TCL_OBJ = $(OUTDIR)\if_tcl.obj
698TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
699TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
700!endif
701!endif
702
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200703# Lua interface
704!ifdef LUA
705!ifndef LUA_VER
706LUA_VER = 51
707!endif
708!message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)"
709!if "$(DYNAMIC_LUA)" == "yes"
710!message Lua DLL will be loaded dynamically
711!endif
712CFLAGS = $(CFLAGS) -DFEAT_LUA
713LUA_OBJ = $(OUTDIR)\if_lua.obj
714LUA_INC = /I "$(LUA)\include" /I "$(LUA)"
715!if "$(DYNAMIC_LUA)" == "yes"
716CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \
717 -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
718LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib
719!else
720LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib"
721!endif
722!endif
723
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200724!ifdef PYTHON
725!ifdef PYTHON3
726DYNAMIC_PYTHON=yes
727DYNAMIC_PYTHON3=yes
728!endif
729!endif
730
Bram Moolenaar071d4272004-06-13 20:20:40 +0000731# PYTHON interface
732!ifdef PYTHON
733!ifndef PYTHON_VER
734PYTHON_VER = 22
735!endif
736!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
737!if "$(DYNAMIC_PYTHON)" == "yes"
738!message Python DLL will be loaded dynamically
739!endif
740CFLAGS = $(CFLAGS) -DFEAT_PYTHON
741PYTHON_OBJ = $(OUTDIR)\if_python.obj
742PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
743!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000744CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
745 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000746PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
747!else
748PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
749!endif
750!endif
751
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200752# PYTHON3 interface
753!ifdef PYTHON3
754!ifndef PYTHON3_VER
755PYTHON3_VER = 31
756!endif
757!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
758!if "$(DYNAMIC_PYTHON3)" == "yes"
759!message Python3 DLL will be loaded dynamically
760!endif
761CFLAGS = $(CFLAGS) -DFEAT_PYTHON3
762PYTHON3_OBJ = $(OUTDIR)\if_python3.obj
763PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC"
764!if "$(DYNAMIC_PYTHON3)" == "yes"
765CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \
766 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
767PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib
768!else
769PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
770!endif
771!endif
772
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000773# MzScheme interface
774!ifdef MZSCHEME
775!message MzScheme requested - root dir is "$(MZSCHEME)"
776!ifndef MZSCHEME_VER
777MZSCHEME_VER = 205_000
778!endif
779CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100780!if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \
781 || EXIST("$(MZSCHEME)\collects\scheme\base.rkt")
782# for MzScheme >= 4 we need to include byte code for basic Scheme stuff
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000783MZSCHEME_EXTRA_DEP = mzscheme_base.c
784CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
785!endif
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100786!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib")
787MZSCHEME_MAIN_LIB=mzsch
788!else
789MZSCHEME_MAIN_LIB=racket
790!endif
791!if EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000792 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
793!message Building with Precise GC
794MZSCHEME_PRECISE_GC = yes
795CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
796!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000797!if "$(DYNAMIC_MZSCHEME)" == "yes"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000798!if "$(MZSCHEME_PRECISE_GC)" == "yes"
799!error MzScheme with Precise GC cannot be loaded dynamically
800!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000801!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000802CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100803 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000804 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000805!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000806!if "$(MZSCHEME_DEBUG)" == "yes"
807CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
808!endif
809!if "$(MZSCHEME_PRECISE_GC)" == "yes"
810# Precise GC does not use separate dll
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100811MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000812!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000813MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100814 $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000815!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000816!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000817MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
Bram Moolenaarbbc98db2012-02-12 01:55:55 +0100818# increase stack size
819MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000820!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000821
Bram Moolenaar071d4272004-06-13 20:20:40 +0000822# Perl interface
823!ifdef PERL
824!ifndef PERL_VER
825PERL_VER = 56
826!endif
827!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
828!if "$(DYNAMIC_PERL)" == "yes"
829!if $(PERL_VER) >= 56
830!message Perl DLL will be loaded dynamically
831!else
832!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
833!message Reverting to static loading...
834!undef DYNAMIC_PERL
835!endif
836!endif
837
838# Is Perl installed in architecture-specific directories?
839!if exist($(PERL)\Bin\MSWin32-x86)
840PERL_ARCH = \MSWin32-x86
841!endif
842
843PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
844
845# Version-dependent stuff
846!if $(PERL_VER) == 55
847PERL_LIB = $(PERL_INCDIR)\perl.lib
848!else
849PERL_DLL = perl$(PERL_VER).dll
Bram Moolenaar207fd752013-12-14 11:50:35 +0100850!if exist($(PERL_INCDIR)\perl$(PERL_VER).lib)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000851PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
Bram Moolenaar207fd752013-12-14 11:50:35 +0100852!else
853# For ActivePerl 5.18 and later
854PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a
855!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000856!endif
857
858CFLAGS = $(CFLAGS) -DFEAT_PERL
859
860# Do we want to load Perl dynamically?
861!if "$(DYNAMIC_PERL)" == "yes"
862CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
863!undef PERL_LIB
864!endif
865
866PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
867PERL_INC = /I $(PERL_INCDIR)
868PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
869XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
Bram Moolenaar52f83172011-09-14 19:01:42 +0200870!if exist($(XSUBPP))
Bram Moolenaar612af432011-09-14 10:49:46 +0200871XSUBPP = $(PERL_EXE) $(XSUBPP)
872!else
873XSUBPP = xsubpp
874!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000875XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
876
877!endif
878
879#
880# Support Ruby interface
881#
882!ifdef RUBY
883# Set default value
884!ifndef RUBY_VER
885RUBY_VER = 18
886!endif
887!ifndef RUBY_VER_LONG
888RUBY_VER_LONG = 1.8
889!endif
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200890!ifndef RUBY_API_VER
891RUBY_API_VER = $(RUBY_VER_LONG:.=)
892!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000893
894!if $(RUBY_VER) >= 18
895!ifndef RUBY_PLATFORM
896RUBY_PLATFORM = i386-mswin32
897!endif
898!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200899RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000900!endif
901!else
902!ifndef RUBY_PLATFORM
903RUBY_PLATFORM = i586-mswin32
904!endif
905!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200906RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000907!endif
908!endif # $(RUBY_VER) >= 18
909
910!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
911CFLAGS = $(CFLAGS) -DFEAT_RUBY
912RUBY_OBJ = $(OUTDIR)\if_ruby.obj
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200913!if $(RUBY_VER) >= 19
914RUBY_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 +0200915!else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000916RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
Bram Moolenaar69154f22010-07-18 21:42:34 +0200917!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000918RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
919# Do we want to load Ruby dynamically?
920!if "$(DYNAMIC_RUBY)" == "yes"
921!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000922CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
923 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000924!undef RUBY_LIB
925!endif
926!endif # RUBY
927
928#
929# Support PostScript printing
930#
931!if "$(POSTSCRIPT)" == "yes"
932CFLAGS = $(CFLAGS) -DMSWINPS
933!endif # POSTSCRIPT
934
935#
936# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
937#
938!if "$(FEATURES)"==""
939FEATURES = BIG
940!endif
941CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
942
943#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000944# Always generate the .pdb file, so that we get debug symbols that can be used
945# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000946# Generate edit-and-continue debug info when no optimization - allows to
947# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000948#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000949CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
950LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000951
952#
953# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000954#
955!message
956
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000957conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000958
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000959PATHDEF_SRC = $(OUTDIR)\pathdef.c
960
Bram Moolenaar071d4272004-06-13 20:20:40 +0000961!IF "$(MAP)" == "yes"
962# "/map" is for debugging
963conflags = $(conflags) /map
964!ELSEIF "$(MAP)" == "lines"
965# "/mapinfo:lines" is for debugging, only works for VC6 and later
966conflags = $(conflags) /map /mapinfo:lines
967!ENDIF
968
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000969LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000970LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200971 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000972 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000973
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000974# Report link time code generation progress if used.
975!ifdef NODEBUG
Bram Moolenaare5878f42013-11-08 03:15:47 +0100976!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") || ("$(MSVCVER)" == "12.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000977!if "$(OPTIMIZE)" != "SPACE"
978LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
979!endif
980!endif
981!endif
982
Bram Moolenaarb6356332005-07-18 21:40:44 +0000983all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
984 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000985
Bram Moolenaarb6356332005-07-18 21:40:44 +0000986$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200987 $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200988 $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
989 version.c version.h
Bram Moolenaarb6356332005-07-18 21:40:44 +0000990 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000991 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200992 $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000993 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
994 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaarb7776182014-05-22 16:29:06 +0200995 if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000996
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000997$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000998
999$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00001000 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001001
1002install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001003 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +02001004 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +00001005 - if exist install.exe del install.exe
1006 ren dosinst.exe install.exe
1007
1008uninstal.exe: uninstal.c
1009 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
1010
1011vimrun.exe: vimrun.c
1012 $(CC) /nologo -DNDEBUG vimrun.c
1013
1014xxd/xxd.exe: xxd/xxd.c
1015 cd xxd
1016 $(MAKE) /NOLOGO -f Make_mvc.mak
1017 cd ..
1018
1019GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
1020 cd GvimExt
1021 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
1022 cd ..
1023
1024
1025tags: notags
1026 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
1027
1028notags:
1029 - if exist tags del tags
1030
1031clean:
Bram Moolenaar02743632005-07-25 20:42:36 +00001032 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001033 - if exist *.obj del *.obj
1034 - if exist $(VIM).exe del $(VIM).exe
1035 - if exist $(VIM).ilk del $(VIM).ilk
1036 - if exist $(VIM).pdb del $(VIM).pdb
1037 - if exist $(VIM).map del $(VIM).map
1038 - if exist $(VIM).ncb del $(VIM).ncb
1039 - if exist vimrun.exe del vimrun.exe
1040 - if exist install.exe del install.exe
1041 - if exist uninstal.exe del uninstal.exe
1042 - if exist if_perl.c del if_perl.c
1043 - if exist dimm.h del dimm.h
1044 - if exist dimm_i.c del dimm_i.c
1045 - if exist dimm.tlb del dimm.tlb
1046 - if exist dosinst.exe del dosinst.exe
Bram Moolenaar2d6db762009-09-11 10:49:58 +00001047 - if exist mzscheme_base.c del mzscheme_base.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001048 cd xxd
1049 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1050 cd ..
1051 cd GvimExt
1052 $(MAKE) /NOLOGO -f Makefile clean
1053 cd ..
1054 cd GvimExt
1055 $(MAKE) /NOLOGO -f Makefile clean
1056 cd ..
1057 - if exist testdir\*.out del testdir\*.out
1058
1059test:
1060 cd testdir
1061 $(MAKE) /NOLOGO -f Make_dos.mak win32
1062 cd ..
1063
Bram Moolenaar34114692005-01-02 11:28:13 +00001064testclean:
1065 cd testdir
1066 $(MAKE) /NOLOGO -f Make_dos.mak clean
1067 cd ..
1068
Bram Moolenaar071d4272004-06-13 20:20:40 +00001069###########################################################################
1070
1071# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
1072# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001073!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001074.c{$(OUTDIR)/}.obj:
1075!ELSE
1076.c{$(OUTDIR)/}.obj::
1077!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001078 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001079
1080# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
1081# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001082!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001083.cpp{$(OUTDIR)/}.obj:
1084!ELSE
1085.cpp{$(OUTDIR)/}.obj::
1086!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001087 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001088
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001089$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
1090
Bram Moolenaaredac1852010-05-18 20:34:20 +02001091$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001092
Bram Moolenaar071d4272004-06-13 20:20:40 +00001093$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
1094
1095$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
1096
1097$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
1098
1099$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
1100
1101$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
1102
1103$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
1104
1105$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
1106
1107$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
1108
1109$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
1110
1111$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
1112
1113$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
1114
1115$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
1116
1117$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
1118
Bram Moolenaar58d98232005-07-23 22:25:46 +00001119$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
1120
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001121$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +00001122
Bram Moolenaar071d4272004-06-13 20:20:40 +00001123$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
1124
Bram Moolenaar52b4b552005-03-07 23:00:57 +00001125$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
1126
Bram Moolenaar071d4272004-06-13 20:20:40 +00001127$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
1128
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +02001129$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
1130
Bram Moolenaar071d4272004-06-13 20:20:40 +00001131$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
1132
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001133$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
1134 $(CC) $(CFLAGS) $(LUA_INC) if_lua.c
1135
Bram Moolenaar071d4272004-06-13 20:20:40 +00001136if_perl.c : if_perl.xs typemap
Bram Moolenaar612af432011-09-14 10:49:46 +02001137 $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001138 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001139
1140$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001141 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001142
1143$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001144 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001145
Bram Moolenaar75676462013-01-30 14:55:42 +01001146$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +00001147 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001148 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001149mzscheme_base.c:
1150 $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001151
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001152$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001153 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001154
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001155$(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL)
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001156 $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c
1157
Bram Moolenaar071d4272004-06-13 20:20:40 +00001158$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
1159
1160$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001161 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001162
1163$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001164 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001165
1166$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001167 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001168
1169$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
1170
1171$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
1172
1173$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
1174
1175$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1176
1177$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1178
1179$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1180
1181$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1182
1183$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1184
1185$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1186
1187$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1188
1189$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1190
1191$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1192
1193$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1194
1195$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1196
1197$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1198
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001199$(OUTDIR)/winclip.obj: $(OUTDIR) winclip.c $(INCL)
1200
Bram Moolenaar071d4272004-06-13 20:20:40 +00001201$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1202
1203$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1204
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001205$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1206 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001207
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001208$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001209
Bram Moolenaar071d4272004-06-13 20:20:40 +00001210$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1211
Bram Moolenaarfbc0d2e2013-05-19 19:40:29 +02001212$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c regexp_nfa.c $(INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001213
1214$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1215
1216$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1217
Bram Moolenaaredac1852010-05-18 20:34:20 +02001218$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1219
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001220$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1221
Bram Moolenaar071d4272004-06-13 20:20:40 +00001222$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1223
1224$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1225
1226$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1227
1228$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1229
1230$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1231
1232$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1233
1234$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001235 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001236
Bram Moolenaarcc448b32010-07-14 16:52:17 +02001237$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
1238 tearoff.bmp vim.ico vim_error.ico \
1239 vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001240 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1241
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001242iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001243 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1244 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001245
1246dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001247 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001248
1249$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1250
1251$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1252
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001253# $CFLAGS may contain backslashes and double quotes, escape them both.
1254E0_CFLAGS = $(CFLAGS:\=\\)
1255E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001256# ") stop the string
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001257# $LINKARGS2 may contain backslashes and double quotes, escape them both.
1258E0_LINKARGS2 = $(LINKARGS2:\=\\)
1259E_LINKARGS2 = $(E0_LINKARGS2:"=\")
1260# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001261
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001262$(PATHDEF_SRC): auto
1263 @echo creating $(PATHDEF_SRC)
1264 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1265 @echo #include "vim.h" >> $(PATHDEF_SRC)
1266 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1267 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1268 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001269 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC)
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001270 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1271 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001272
1273auto:
1274 if not exist auto/nul mkdir auto
1275
1276# End Custom Build
1277proto.h: \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001278 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001279 proto/buffer.pro \
1280 proto/charset.pro \
1281 proto/diff.pro \
1282 proto/digraph.pro \
1283 proto/edit.pro \
1284 proto/eval.pro \
1285 proto/ex_cmds.pro \
1286 proto/ex_cmds2.pro \
1287 proto/ex_docmd.pro \
1288 proto/ex_eval.pro \
1289 proto/ex_getln.pro \
1290 proto/fileio.pro \
1291 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001292 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001293 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001294 proto/main.pro \
1295 proto/mark.pro \
1296 proto/memfile.pro \
1297 proto/memline.pro \
1298 proto/menu.pro \
1299 proto/message.pro \
1300 proto/misc1.pro \
1301 proto/misc2.pro \
1302 proto/move.pro \
1303 proto/mbyte.pro \
1304 proto/normal.pro \
1305 proto/ops.pro \
1306 proto/option.pro \
1307 proto/os_mswin.pro \
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001308 proto/winclip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001309 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001310 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001311 proto/quickfix.pro \
1312 proto/regexp.pro \
1313 proto/screen.pro \
1314 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001315 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001316 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001317 proto/syntax.pro \
1318 proto/tag.pro \
1319 proto/term.pro \
1320 proto/ui.pro \
1321 proto/undo.pro \
1322 proto/window.pro \
1323 $(NETBEANS_PRO)
1324
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001325.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001326
1327# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1328# foo.cod"
1329.c.cod:
1330 $(CC) $(CFLAGS) /FAcs $<
1331
1332# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1333.c.i:
1334 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001335
1336
Bram Moolenaar071d4272004-06-13 20:20:40 +00001337# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: