blob: c93f4b4aaa8a8cbe2d8e6e21cea77665925f8da1 [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 \
Bram Moolenaar07cf3822014-08-10 16:31:50 +0200550 $(OUTDIR)\crypt.obj \
551 $(OUTDIR)\crypt_zip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000552 $(OUTDIR)\diff.obj \
553 $(OUTDIR)\digraph.obj \
554 $(OUTDIR)\edit.obj \
555 $(OUTDIR)\eval.obj \
556 $(OUTDIR)\ex_cmds.obj \
557 $(OUTDIR)\ex_cmds2.obj \
558 $(OUTDIR)\ex_docmd.obj \
559 $(OUTDIR)\ex_eval.obj \
560 $(OUTDIR)\ex_getln.obj \
561 $(OUTDIR)\fileio.obj \
562 $(OUTDIR)\fold.obj \
563 $(OUTDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000564 $(OUTDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000565 $(OUTDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000566 $(OUTDIR)\main.obj \
567 $(OUTDIR)\mark.obj \
568 $(OUTDIR)\mbyte.obj \
569 $(OUTDIR)\memfile.obj \
570 $(OUTDIR)\memline.obj \
571 $(OUTDIR)\menu.obj \
572 $(OUTDIR)\message.obj \
573 $(OUTDIR)\misc1.obj \
574 $(OUTDIR)\misc2.obj \
575 $(OUTDIR)\move.obj \
576 $(OUTDIR)\normal.obj \
577 $(OUTDIR)\ops.obj \
578 $(OUTDIR)\option.obj \
579 $(OUTDIR)\os_mswin.obj \
Bram Moolenaar693e40c2013-02-26 14:56:42 +0100580 $(OUTDIR)\winclip.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000581 $(OUTDIR)\os_win32.obj \
582 $(OUTDIR)\pathdef.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000583 $(OUTDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000584 $(OUTDIR)\quickfix.obj \
585 $(OUTDIR)\regexp.obj \
586 $(OUTDIR)\screen.obj \
587 $(OUTDIR)\search.obj \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200588 $(OUTDIR)\sha256.obj \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +0000589 $(OUTDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000590 $(OUTDIR)\syntax.obj \
591 $(OUTDIR)\tag.obj \
592 $(OUTDIR)\term.obj \
593 $(OUTDIR)\ui.obj \
594 $(OUTDIR)\undo.obj \
595 $(OUTDIR)\window.obj \
596 $(OUTDIR)\vim.res
597
598!if "$(OLE)" == "yes"
599CFLAGS = $(CFLAGS) -DFEAT_OLE
600RCFLAGS = $(RCFLAGS) -DFEAT_OLE
601OLE_OBJ = $(OUTDIR)\if_ole.obj
602OLE_IDL = if_ole.idl
603OLE_LIB = oleaut32.lib
604!endif
605
606!if "$(IME)" == "yes"
607CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
608!ifndef DYNAMIC_IME
609DYNAMIC_IME = yes
610!endif
611!if "$(DYNAMIC_IME)" == "yes"
612CFLAGS = $(CFLAGS) -DDYNAMIC_IME
613!else
614IME_LIB = imm32.lib
615!endif
616!endif
617
618!if "$(GIME)" == "yes"
619CFLAGS = $(CFLAGS) -DGLOBAL_IME
620OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
621MBYTE = yes
622!endif
623
624!if "$(MBYTE)" == "yes"
625CFLAGS = $(CFLAGS) -DFEAT_MBYTE
626!endif
627
628!if "$(GUI)" == "yes"
629SUBSYSTEM = windows
630CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
631RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
632VIM = g$(VIM)
633GUI_INCL = \
634 gui.h \
635 regexp.h \
636 ascii.h \
637 ex_cmds.h \
638 farsi.h \
639 feature.h \
640 globals.h \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000641 gui_beval.h \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000642 keymap.h \
643 macros.h \
644 option.h \
645 os_dos.h \
646 os_win32.h
647GUI_OBJ = \
648 $(OUTDIR)\gui.obj \
Bram Moolenaar52b4b552005-03-07 23:00:57 +0000649 $(OUTDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000650 $(OUTDIR)\gui_w32.obj \
651 $(OUTDIR)\os_w32exe.obj
652GUI_LIB = \
Bram Moolenaar0fde2902008-03-16 13:54:13 +0000653 gdi32.lib version.lib $(IME_LIB) \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000654 winspool.lib comctl32.lib advapi32.lib shell32.lib \
655 /machine:$(CPU) /nodefaultlib
656!else
657SUBSYSTEM = console
658!endif
659
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200660!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
661CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
662GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
663GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
664!endif
665
Bram Moolenaar071d4272004-06-13 20:20:40 +0000666# iconv.dll library (dynamically loaded)
667!ifndef ICONV
668ICONV = yes
669!endif
670!if "$(ICONV)" == "yes"
671CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
672!endif
673
674# libintl.dll library
675!ifndef GETTEXT
676GETTEXT = yes
677!endif
678!if "$(GETTEXT)" == "yes"
679CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
680!endif
681
682# TCL interface
683!ifdef TCL
684!ifndef TCL_VER
685TCL_VER = 83
686TCL_VER_LONG = 8.3
687!endif
688!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
689!if "$(DYNAMIC_TCL)" == "yes"
690!message Tcl DLL will be loaded dynamically
691TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000692CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
693 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000694TCL_OBJ = $(OUTDIR)\if_tcl.obj
695TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
Bram Moolenaar84a4c332012-02-22 16:01:56 +0100696TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000697!else
698CFLAGS = $(CFLAGS) -DFEAT_TCL
699TCL_OBJ = $(OUTDIR)\if_tcl.obj
700TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
701TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
702!endif
703!endif
704
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200705# Lua interface
706!ifdef LUA
707!ifndef LUA_VER
708LUA_VER = 51
709!endif
710!message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)"
711!if "$(DYNAMIC_LUA)" == "yes"
712!message Lua DLL will be loaded dynamically
713!endif
714CFLAGS = $(CFLAGS) -DFEAT_LUA
715LUA_OBJ = $(OUTDIR)\if_lua.obj
716LUA_INC = /I "$(LUA)\include" /I "$(LUA)"
717!if "$(DYNAMIC_LUA)" == "yes"
718CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \
719 -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
720LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib
721!else
722LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib"
723!endif
724!endif
725
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200726!ifdef PYTHON
727!ifdef PYTHON3
728DYNAMIC_PYTHON=yes
729DYNAMIC_PYTHON3=yes
730!endif
731!endif
732
Bram Moolenaar071d4272004-06-13 20:20:40 +0000733# PYTHON interface
734!ifdef PYTHON
735!ifndef PYTHON_VER
736PYTHON_VER = 22
737!endif
738!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
739!if "$(DYNAMIC_PYTHON)" == "yes"
740!message Python DLL will be loaded dynamically
741!endif
742CFLAGS = $(CFLAGS) -DFEAT_PYTHON
743PYTHON_OBJ = $(OUTDIR)\if_python.obj
744PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
745!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000746CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
747 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000748PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
749!else
750PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
751!endif
752!endif
753
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200754# PYTHON3 interface
755!ifdef PYTHON3
756!ifndef PYTHON3_VER
757PYTHON3_VER = 31
758!endif
759!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
760!if "$(DYNAMIC_PYTHON3)" == "yes"
761!message Python3 DLL will be loaded dynamically
762!endif
763CFLAGS = $(CFLAGS) -DFEAT_PYTHON3
764PYTHON3_OBJ = $(OUTDIR)\if_python3.obj
765PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC"
766!if "$(DYNAMIC_PYTHON3)" == "yes"
767CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \
768 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
769PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib
770!else
771PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
772!endif
773!endif
774
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000775# MzScheme interface
776!ifdef MZSCHEME
777!message MzScheme requested - root dir is "$(MZSCHEME)"
778!ifndef MZSCHEME_VER
779MZSCHEME_VER = 205_000
780!endif
781CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100782!if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \
783 || EXIST("$(MZSCHEME)\collects\scheme\base.rkt")
784# for MzScheme >= 4 we need to include byte code for basic Scheme stuff
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000785MZSCHEME_EXTRA_DEP = mzscheme_base.c
786CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
787!endif
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100788!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib")
789MZSCHEME_MAIN_LIB=mzsch
790!else
791MZSCHEME_MAIN_LIB=racket
792!endif
793!if EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000794 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
795!message Building with Precise GC
796MZSCHEME_PRECISE_GC = yes
797CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
798!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000799!if "$(DYNAMIC_MZSCHEME)" == "yes"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000800!if "$(MZSCHEME_PRECISE_GC)" == "yes"
801!error MzScheme with Precise GC cannot be loaded dynamically
802!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000803!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000804CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100805 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000806 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000807!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000808!if "$(MZSCHEME_DEBUG)" == "yes"
809CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
810!endif
811!if "$(MZSCHEME_PRECISE_GC)" == "yes"
812# Precise GC does not use separate dll
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100813MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000814!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000815MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100816 $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000817!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000818!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000819MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
Bram Moolenaarbbc98db2012-02-12 01:55:55 +0100820# increase stack size
821MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000822!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000823
Bram Moolenaar071d4272004-06-13 20:20:40 +0000824# Perl interface
825!ifdef PERL
826!ifndef PERL_VER
827PERL_VER = 56
828!endif
829!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
830!if "$(DYNAMIC_PERL)" == "yes"
831!if $(PERL_VER) >= 56
832!message Perl DLL will be loaded dynamically
833!else
834!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
835!message Reverting to static loading...
836!undef DYNAMIC_PERL
837!endif
838!endif
839
840# Is Perl installed in architecture-specific directories?
841!if exist($(PERL)\Bin\MSWin32-x86)
842PERL_ARCH = \MSWin32-x86
843!endif
844
845PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
846
847# Version-dependent stuff
848!if $(PERL_VER) == 55
849PERL_LIB = $(PERL_INCDIR)\perl.lib
850!else
851PERL_DLL = perl$(PERL_VER).dll
Bram Moolenaar207fd752013-12-14 11:50:35 +0100852!if exist($(PERL_INCDIR)\perl$(PERL_VER).lib)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000853PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
Bram Moolenaar207fd752013-12-14 11:50:35 +0100854!else
855# For ActivePerl 5.18 and later
856PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a
857!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000858!endif
859
860CFLAGS = $(CFLAGS) -DFEAT_PERL
861
862# Do we want to load Perl dynamically?
863!if "$(DYNAMIC_PERL)" == "yes"
864CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
865!undef PERL_LIB
866!endif
867
868PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
869PERL_INC = /I $(PERL_INCDIR)
870PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
871XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
Bram Moolenaar52f83172011-09-14 19:01:42 +0200872!if exist($(XSUBPP))
Bram Moolenaar612af432011-09-14 10:49:46 +0200873XSUBPP = $(PERL_EXE) $(XSUBPP)
874!else
875XSUBPP = xsubpp
876!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000877XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
878
879!endif
880
881#
882# Support Ruby interface
883#
884!ifdef RUBY
885# Set default value
886!ifndef RUBY_VER
887RUBY_VER = 18
888!endif
889!ifndef RUBY_VER_LONG
890RUBY_VER_LONG = 1.8
891!endif
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200892!ifndef RUBY_API_VER
893RUBY_API_VER = $(RUBY_VER_LONG:.=)
894!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000895
896!if $(RUBY_VER) >= 18
897!ifndef RUBY_PLATFORM
898RUBY_PLATFORM = i386-mswin32
899!endif
900!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200901RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000902!endif
903!else
904!ifndef RUBY_PLATFORM
905RUBY_PLATFORM = i586-mswin32
906!endif
907!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200908RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000909!endif
910!endif # $(RUBY_VER) >= 18
911
912!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
913CFLAGS = $(CFLAGS) -DFEAT_RUBY
914RUBY_OBJ = $(OUTDIR)\if_ruby.obj
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200915!if $(RUBY_VER) >= 19
916RUBY_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 +0200917!else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000918RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
Bram Moolenaar69154f22010-07-18 21:42:34 +0200919!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000920RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
921# Do we want to load Ruby dynamically?
922!if "$(DYNAMIC_RUBY)" == "yes"
923!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000924CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
925 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000926!undef RUBY_LIB
927!endif
928!endif # RUBY
929
930#
931# Support PostScript printing
932#
933!if "$(POSTSCRIPT)" == "yes"
934CFLAGS = $(CFLAGS) -DMSWINPS
935!endif # POSTSCRIPT
936
937#
938# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
939#
940!if "$(FEATURES)"==""
941FEATURES = BIG
942!endif
943CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
944
945#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000946# Always generate the .pdb file, so that we get debug symbols that can be used
947# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000948# Generate edit-and-continue debug info when no optimization - allows to
949# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000950#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000951CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
952LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000953
954#
955# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000956#
957!message
958
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000959conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000960
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000961PATHDEF_SRC = $(OUTDIR)\pathdef.c
962
Bram Moolenaar071d4272004-06-13 20:20:40 +0000963!IF "$(MAP)" == "yes"
964# "/map" is for debugging
965conflags = $(conflags) /map
966!ELSEIF "$(MAP)" == "lines"
967# "/mapinfo:lines" is for debugging, only works for VC6 and later
968conflags = $(conflags) /map /mapinfo:lines
969!ENDIF
970
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000971LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000972LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200973 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000974 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000975
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000976# Report link time code generation progress if used.
977!ifdef NODEBUG
Bram Moolenaare5878f42013-11-08 03:15:47 +0100978!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") || ("$(MSVCVER)" == "12.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000979!if "$(OPTIMIZE)" != "SPACE"
980LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
981!endif
982!endif
983!endif
984
Bram Moolenaarb6356332005-07-18 21:40:44 +0000985all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
986 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000987
Bram Moolenaarb6356332005-07-18 21:40:44 +0000988$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200989 $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200990 $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
991 version.c version.h
Bram Moolenaarb6356332005-07-18 21:40:44 +0000992 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000993 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200994 $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000995 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
996 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaarb7776182014-05-22 16:29:06 +0200997 if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
Bram Moolenaar071d4272004-06-13 20:20:40 +0000998
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +0000999$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +00001000
1001$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00001002 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001003
1004install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001005 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +02001006 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +00001007 - if exist install.exe del install.exe
1008 ren dosinst.exe install.exe
1009
1010uninstal.exe: uninstal.c
1011 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
1012
1013vimrun.exe: vimrun.c
1014 $(CC) /nologo -DNDEBUG vimrun.c
1015
1016xxd/xxd.exe: xxd/xxd.c
1017 cd xxd
1018 $(MAKE) /NOLOGO -f Make_mvc.mak
1019 cd ..
1020
1021GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
1022 cd GvimExt
1023 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
1024 cd ..
1025
1026
1027tags: notags
1028 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
1029
1030notags:
1031 - if exist tags del tags
1032
1033clean:
Bram Moolenaar02743632005-07-25 20:42:36 +00001034 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001035 - if exist *.obj del *.obj
1036 - if exist $(VIM).exe del $(VIM).exe
1037 - if exist $(VIM).ilk del $(VIM).ilk
1038 - if exist $(VIM).pdb del $(VIM).pdb
1039 - if exist $(VIM).map del $(VIM).map
1040 - if exist $(VIM).ncb del $(VIM).ncb
1041 - if exist vimrun.exe del vimrun.exe
1042 - if exist install.exe del install.exe
1043 - if exist uninstal.exe del uninstal.exe
1044 - if exist if_perl.c del if_perl.c
1045 - if exist dimm.h del dimm.h
1046 - if exist dimm_i.c del dimm_i.c
1047 - if exist dimm.tlb del dimm.tlb
1048 - if exist dosinst.exe del dosinst.exe
Bram Moolenaar2d6db762009-09-11 10:49:58 +00001049 - if exist mzscheme_base.c del mzscheme_base.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001050 cd xxd
1051 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1052 cd ..
1053 cd GvimExt
1054 $(MAKE) /NOLOGO -f Makefile clean
1055 cd ..
1056 cd GvimExt
1057 $(MAKE) /NOLOGO -f Makefile clean
1058 cd ..
1059 - if exist testdir\*.out del testdir\*.out
1060
1061test:
1062 cd testdir
1063 $(MAKE) /NOLOGO -f Make_dos.mak win32
1064 cd ..
1065
Bram Moolenaar34114692005-01-02 11:28:13 +00001066testclean:
1067 cd testdir
1068 $(MAKE) /NOLOGO -f Make_dos.mak clean
1069 cd ..
1070
Bram Moolenaar071d4272004-06-13 20:20:40 +00001071###########################################################################
1072
1073# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
1074# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001075!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001076.c{$(OUTDIR)/}.obj:
1077!ELSE
1078.c{$(OUTDIR)/}.obj::
1079!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001080 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001081
1082# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
1083# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001084!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001085.cpp{$(OUTDIR)/}.obj:
1086!ELSE
1087.cpp{$(OUTDIR)/}.obj::
1088!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001089 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001090
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001091$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
1092
Bram Moolenaaredac1852010-05-18 20:34:20 +02001093$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001094
Bram Moolenaar071d4272004-06-13 20:20:40 +00001095$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
1096
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001097$(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL)
1098
1099$(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c $(INCL)
1100
Bram Moolenaar071d4272004-06-13 20:20:40 +00001101$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
1102
1103$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
1104
1105$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
1106
1107$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
1108
1109$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
1110
1111$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
1112
1113$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
1114
1115$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
1116
1117$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
1118
1119$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
1120
1121$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
1122
1123$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
1124
Bram Moolenaar58d98232005-07-23 22:25:46 +00001125$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
1126
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001127$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +00001128
Bram Moolenaar071d4272004-06-13 20:20:40 +00001129$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
1130
Bram Moolenaar52b4b552005-03-07 23:00:57 +00001131$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
1132
Bram Moolenaar071d4272004-06-13 20:20:40 +00001133$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
1134
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +02001135$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
1136
Bram Moolenaar071d4272004-06-13 20:20:40 +00001137$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
1138
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001139$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
1140 $(CC) $(CFLAGS) $(LUA_INC) if_lua.c
1141
Bram Moolenaar071d4272004-06-13 20:20:40 +00001142if_perl.c : if_perl.xs typemap
Bram Moolenaar612af432011-09-14 10:49:46 +02001143 $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001144 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001145
1146$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001147 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001148
1149$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001150 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001151
Bram Moolenaar75676462013-01-30 14:55:42 +01001152$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +00001153 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001154 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001155mzscheme_base.c:
1156 $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001157
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001158$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001159 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001160
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001161$(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL)
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001162 $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c
1163
Bram Moolenaar071d4272004-06-13 20:20:40 +00001164$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
1165
1166$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001167 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001168
1169$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001170 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001171
1172$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001173 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001174
1175$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
1176
1177$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
1178
1179$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
1180
1181$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1182
1183$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1184
1185$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1186
1187$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1188
1189$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1190
1191$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1192
1193$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1194
1195$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1196
1197$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1198
1199$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1200
1201$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1202
1203$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1204
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001205$(OUTDIR)/winclip.obj: $(OUTDIR) winclip.c $(INCL)
1206
Bram Moolenaar071d4272004-06-13 20:20:40 +00001207$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1208
1209$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1210
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001211$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1212 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001213
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001214$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001215
Bram Moolenaar071d4272004-06-13 20:20:40 +00001216$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1217
Bram Moolenaarfbc0d2e2013-05-19 19:40:29 +02001218$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c regexp_nfa.c $(INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001219
1220$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1221
1222$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1223
Bram Moolenaaredac1852010-05-18 20:34:20 +02001224$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1225
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001226$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1227
Bram Moolenaar071d4272004-06-13 20:20:40 +00001228$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1229
1230$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1231
1232$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1233
1234$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1235
1236$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1237
1238$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1239
1240$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001241 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001242
Bram Moolenaarcc448b32010-07-14 16:52:17 +02001243$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
1244 tearoff.bmp vim.ico vim_error.ico \
1245 vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001246 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1247
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001248iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001249 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1250 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001251
1252dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001253 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001254
1255$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1256
1257$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1258
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001259# $CFLAGS may contain backslashes and double quotes, escape them both.
1260E0_CFLAGS = $(CFLAGS:\=\\)
1261E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001262# ") stop the string
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001263# $LINKARGS2 may contain backslashes and double quotes, escape them both.
1264E0_LINKARGS2 = $(LINKARGS2:\=\\)
1265E_LINKARGS2 = $(E0_LINKARGS2:"=\")
1266# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001267
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001268$(PATHDEF_SRC): auto
1269 @echo creating $(PATHDEF_SRC)
1270 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1271 @echo #include "vim.h" >> $(PATHDEF_SRC)
1272 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1273 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1274 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001275 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC)
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001276 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1277 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001278
1279auto:
1280 if not exist auto/nul mkdir auto
1281
1282# End Custom Build
1283proto.h: \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001284 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001285 proto/buffer.pro \
1286 proto/charset.pro \
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001287 proto/crypt.pro \
1288 proto/crypt_zip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001289 proto/diff.pro \
1290 proto/digraph.pro \
1291 proto/edit.pro \
1292 proto/eval.pro \
1293 proto/ex_cmds.pro \
1294 proto/ex_cmds2.pro \
1295 proto/ex_docmd.pro \
1296 proto/ex_eval.pro \
1297 proto/ex_getln.pro \
1298 proto/fileio.pro \
1299 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001300 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001301 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001302 proto/main.pro \
1303 proto/mark.pro \
1304 proto/memfile.pro \
1305 proto/memline.pro \
1306 proto/menu.pro \
1307 proto/message.pro \
1308 proto/misc1.pro \
1309 proto/misc2.pro \
1310 proto/move.pro \
1311 proto/mbyte.pro \
1312 proto/normal.pro \
1313 proto/ops.pro \
1314 proto/option.pro \
1315 proto/os_mswin.pro \
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001316 proto/winclip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001317 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001318 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001319 proto/quickfix.pro \
1320 proto/regexp.pro \
1321 proto/screen.pro \
1322 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001323 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001324 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001325 proto/syntax.pro \
1326 proto/tag.pro \
1327 proto/term.pro \
1328 proto/ui.pro \
1329 proto/undo.pro \
1330 proto/window.pro \
1331 $(NETBEANS_PRO)
1332
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001333.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001334
1335# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1336# foo.cod"
1337.c.cod:
1338 $(CC) $(CFLAGS) /FAcs $<
1339
1340# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1341.c.i:
1342 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001343
1344
Bram Moolenaar071d4272004-06-13 20:20:40 +00001345# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: