blob: 31bcd6844066b165e0d775e0ecebd404fae41d7b [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 Moolenaarce2f2e02014-08-22 18:12:57 +0200660!if "$(SUBSYSTEM_VER)" != ""
661SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
662!endif
663
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200664!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
665CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
666GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
667GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
668!endif
669
Bram Moolenaar071d4272004-06-13 20:20:40 +0000670# iconv.dll library (dynamically loaded)
671!ifndef ICONV
672ICONV = yes
673!endif
674!if "$(ICONV)" == "yes"
675CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
676!endif
677
678# libintl.dll library
679!ifndef GETTEXT
680GETTEXT = yes
681!endif
682!if "$(GETTEXT)" == "yes"
683CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
684!endif
685
686# TCL interface
687!ifdef TCL
688!ifndef TCL_VER
689TCL_VER = 83
690TCL_VER_LONG = 8.3
691!endif
692!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
693!if "$(DYNAMIC_TCL)" == "yes"
694!message Tcl DLL will be loaded dynamically
695TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaarb6356332005-07-18 21:40:44 +0000696CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
697 -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000698TCL_OBJ = $(OUTDIR)\if_tcl.obj
699TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
Bram Moolenaar84a4c332012-02-22 16:01:56 +0100700TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000701!else
702CFLAGS = $(CFLAGS) -DFEAT_TCL
703TCL_OBJ = $(OUTDIR)\if_tcl.obj
704TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
705TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
706!endif
707!endif
708
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200709# Lua interface
710!ifdef LUA
711!ifndef LUA_VER
712LUA_VER = 51
713!endif
714!message Lua requested (version $(LUA_VER)) - root dir is "$(LUA)"
715!if "$(DYNAMIC_LUA)" == "yes"
716!message Lua DLL will be loaded dynamically
717!endif
718CFLAGS = $(CFLAGS) -DFEAT_LUA
719LUA_OBJ = $(OUTDIR)\if_lua.obj
720LUA_INC = /I "$(LUA)\include" /I "$(LUA)"
721!if "$(DYNAMIC_LUA)" == "yes"
722CFLAGS = $(CFLAGS) -DDYNAMIC_LUA \
723 -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
724LUA_LIB = /nodefaultlib:lua$(LUA_VER).lib
725!else
726LUA_LIB = "$(LUA)\lib\lua$(LUA_VER).lib"
727!endif
728!endif
729
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200730!ifdef PYTHON
731!ifdef PYTHON3
732DYNAMIC_PYTHON=yes
733DYNAMIC_PYTHON3=yes
734!endif
735!endif
736
Bram Moolenaar071d4272004-06-13 20:20:40 +0000737# PYTHON interface
738!ifdef PYTHON
739!ifndef PYTHON_VER
740PYTHON_VER = 22
741!endif
742!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
743!if "$(DYNAMIC_PYTHON)" == "yes"
744!message Python DLL will be loaded dynamically
745!endif
746CFLAGS = $(CFLAGS) -DFEAT_PYTHON
747PYTHON_OBJ = $(OUTDIR)\if_python.obj
748PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
749!if "$(DYNAMIC_PYTHON)" == "yes"
Bram Moolenaarb6356332005-07-18 21:40:44 +0000750CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON \
751 -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000752PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
753!else
754PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
755!endif
756!endif
757
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200758# PYTHON3 interface
759!ifdef PYTHON3
760!ifndef PYTHON3_VER
761PYTHON3_VER = 31
762!endif
763!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
764!if "$(DYNAMIC_PYTHON3)" == "yes"
765!message Python3 DLL will be loaded dynamically
766!endif
767CFLAGS = $(CFLAGS) -DFEAT_PYTHON3
768PYTHON3_OBJ = $(OUTDIR)\if_python3.obj
769PYTHON3_INC = /I "$(PYTHON3)\Include" /I "$(PYTHON3)\PC"
770!if "$(DYNAMIC_PYTHON3)" == "yes"
771CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON3 \
772 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
773PYTHON3_LIB = /nodefaultlib:python$(PYTHON3_VER).lib
774!else
775PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
776!endif
777!endif
778
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000779# MzScheme interface
780!ifdef MZSCHEME
781!message MzScheme requested - root dir is "$(MZSCHEME)"
782!ifndef MZSCHEME_VER
783MZSCHEME_VER = 205_000
784!endif
785CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100786!if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \
787 || EXIST("$(MZSCHEME)\collects\scheme\base.rkt")
788# for MzScheme >= 4 we need to include byte code for basic Scheme stuff
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000789MZSCHEME_EXTRA_DEP = mzscheme_base.c
790CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
791!endif
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100792!if EXIST("$(MZSCHEME)\lib\msvc\libmzsch$(MZSCHEME_VER).lib")
793MZSCHEME_MAIN_LIB=mzsch
794!else
795MZSCHEME_MAIN_LIB=racket
796!endif
797!if EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000798 && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
799!message Building with Precise GC
800MZSCHEME_PRECISE_GC = yes
801CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
802!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000803!if "$(DYNAMIC_MZSCHEME)" == "yes"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000804!if "$(MZSCHEME_PRECISE_GC)" == "yes"
805!error MzScheme with Precise GC cannot be loaded dynamically
806!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000807!message MzScheme DLLs will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000808CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100809 -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000810 -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000811!else
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000812!if "$(MZSCHEME_DEBUG)" == "yes"
813CFLAGS = $(CFLAGS) -DMZSCHEME_FORCE_GC
814!endif
815!if "$(MZSCHEME_PRECISE_GC)" == "yes"
816# Precise GC does not use separate dll
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100817MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000818!else
Bram Moolenaarb6356332005-07-18 21:40:44 +0000819MZSCHEME_LIB = $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib \
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100820 $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000821!endif
Bram Moolenaar9e70cf12009-05-26 20:59:55 +0000822!endif
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000823MZSCHEME_OBJ = $(OUTDIR)\if_mzsch.obj
Bram Moolenaarbbc98db2012-02-12 01:55:55 +0100824# increase stack size
825MZSCHEME_LIB = $(MZSCHEME_LIB) /STACK:8388608
Bram Moolenaaraab21c32005-01-25 21:46:35 +0000826!endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000827
Bram Moolenaar071d4272004-06-13 20:20:40 +0000828# Perl interface
829!ifdef PERL
830!ifndef PERL_VER
831PERL_VER = 56
832!endif
833!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
834!if "$(DYNAMIC_PERL)" == "yes"
835!if $(PERL_VER) >= 56
836!message Perl DLL will be loaded dynamically
837!else
838!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
839!message Reverting to static loading...
840!undef DYNAMIC_PERL
841!endif
842!endif
843
844# Is Perl installed in architecture-specific directories?
845!if exist($(PERL)\Bin\MSWin32-x86)
846PERL_ARCH = \MSWin32-x86
847!endif
848
849PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
850
851# Version-dependent stuff
852!if $(PERL_VER) == 55
853PERL_LIB = $(PERL_INCDIR)\perl.lib
854!else
855PERL_DLL = perl$(PERL_VER).dll
Bram Moolenaar207fd752013-12-14 11:50:35 +0100856!if exist($(PERL_INCDIR)\perl$(PERL_VER).lib)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000857PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
Bram Moolenaar207fd752013-12-14 11:50:35 +0100858!else
859# For ActivePerl 5.18 and later
860PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a
861!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000862!endif
863
864CFLAGS = $(CFLAGS) -DFEAT_PERL
865
866# Do we want to load Perl dynamically?
867!if "$(DYNAMIC_PERL)" == "yes"
868CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
869!undef PERL_LIB
870!endif
871
872PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
873PERL_INC = /I $(PERL_INCDIR)
874PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
875XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
Bram Moolenaar52f83172011-09-14 19:01:42 +0200876!if exist($(XSUBPP))
Bram Moolenaar612af432011-09-14 10:49:46 +0200877XSUBPP = $(PERL_EXE) $(XSUBPP)
878!else
879XSUBPP = xsubpp
880!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000881XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
882
883!endif
884
885#
886# Support Ruby interface
887#
888!ifdef RUBY
889# Set default value
890!ifndef RUBY_VER
891RUBY_VER = 18
892!endif
893!ifndef RUBY_VER_LONG
894RUBY_VER_LONG = 1.8
895!endif
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200896!ifndef RUBY_API_VER
897RUBY_API_VER = $(RUBY_VER_LONG:.=)
898!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000899
900!if $(RUBY_VER) >= 18
901!ifndef RUBY_PLATFORM
902RUBY_PLATFORM = i386-mswin32
903!endif
904!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200905RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000906!endif
907!else
908!ifndef RUBY_PLATFORM
909RUBY_PLATFORM = i586-mswin32
910!endif
911!ifndef RUBY_INSTALL_NAME
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200912RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000913!endif
914!endif # $(RUBY_VER) >= 18
915
916!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
917CFLAGS = $(CFLAGS) -DFEAT_RUBY
918RUBY_OBJ = $(OUTDIR)\if_ruby.obj
Bram Moolenaarda3cb832012-08-02 21:21:47 +0200919!if $(RUBY_VER) >= 19
920RUBY_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 +0200921!else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000922RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
Bram Moolenaar69154f22010-07-18 21:42:34 +0200923!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000924RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
925# Do we want to load Ruby dynamically?
926!if "$(DYNAMIC_RUBY)" == "yes"
927!message Ruby DLL will be loaded dynamically
Bram Moolenaarb6356332005-07-18 21:40:44 +0000928CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=$(RUBY_VER) \
929 -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000930!undef RUBY_LIB
931!endif
932!endif # RUBY
933
934#
935# Support PostScript printing
936#
937!if "$(POSTSCRIPT)" == "yes"
938CFLAGS = $(CFLAGS) -DMSWINPS
939!endif # POSTSCRIPT
940
941#
942# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
943#
944!if "$(FEATURES)"==""
945FEATURES = BIG
946!endif
947CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
948
949#
Bram Moolenaard9d30582005-05-18 22:10:28 +0000950# Always generate the .pdb file, so that we get debug symbols that can be used
951# on a crash (doesn't add overhead to the executable).
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000952# Generate edit-and-continue debug info when no optimization - allows to
953# debug more conveniently (able to look at variables which are in registers)
Bram Moolenaard9d30582005-05-18 22:10:28 +0000954#
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000955CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
956LINK_PDB = /PDB:$(VIM).pdb -debug
Bram Moolenaard9d30582005-05-18 22:10:28 +0000957
958#
959# End extra feature include
Bram Moolenaar071d4272004-06-13 20:20:40 +0000960#
961!message
962
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000963conflags = /nologo /subsystem:$(SUBSYSTEM)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000964
Bram Moolenaar8b6144b2006-02-08 09:20:24 +0000965PATHDEF_SRC = $(OUTDIR)\pathdef.c
966
Bram Moolenaar071d4272004-06-13 20:20:40 +0000967!IF "$(MAP)" == "yes"
968# "/map" is for debugging
969conflags = $(conflags) /map
970!ELSEIF "$(MAP)" == "lines"
971# "/mapinfo:lines" is for debugging, only works for VC6 and later
972conflags = $(conflags) /map /mapinfo:lines
973!ENDIF
974
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000975LINKARGS1 = $(linkdebug) $(conflags)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000976LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200977 $(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000978 $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000979
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000980# Report link time code generation progress if used.
981!ifdef NODEBUG
Bram Moolenaare5878f42013-11-08 03:15:47 +0100982!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0") || ("$(MSVCVER)" == "12.0")
Bram Moolenaarf22129b2007-10-03 11:29:44 +0000983!if "$(OPTIMIZE)" != "SPACE"
984LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
985!endif
986!endif
987!endif
988
Bram Moolenaarb6356332005-07-18 21:40:44 +0000989all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
990 GvimExt/gvimext.dll
Bram Moolenaar071d4272004-06-13 20:20:40 +0000991
Bram Moolenaarb6356332005-07-18 21:40:44 +0000992$(VIM).exe: $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(MZSCHEME_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200993 $(LUA_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) $(TCL_OBJ) \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200994 $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
995 version.c version.h
Bram Moolenaarb6356332005-07-18 21:40:44 +0000996 $(CC) $(CFLAGS) version.c
Bram Moolenaar0dc065e2005-07-04 22:49:24 +0000997 $(link) $(LINKARGS1) -out:$(VIM).exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200998 $(LUA_OBJ) $(MZSCHEME_OBJ) $(PERL_OBJ) $(PYTHON_OBJ) $(PYTHON3_OBJ) $(RUBY_OBJ) \
Bram Moolenaarb6356332005-07-18 21:40:44 +0000999 $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) \
1000 $(XPM_OBJ) $(OUTDIR)\version.obj $(LINKARGS2)
Bram Moolenaarb7776182014-05-22 16:29:06 +02001001 if exist $(VIM).exe.manifest mt.exe -nologo -manifest $(VIM).exe.manifest -updateresource:$(VIM).exe;1
Bram Moolenaar071d4272004-06-13 20:20:40 +00001002
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001003$(VIM): $(VIM).exe
Bram Moolenaar071d4272004-06-13 20:20:40 +00001004
1005$(OUTDIR):
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00001006 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001007
1008install.exe: dosinst.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001009 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib \
Bram Moolenaarb230bd52010-05-25 21:02:00 +02001010 user32.lib ole32.lib advapi32.lib uuid.lib
Bram Moolenaar071d4272004-06-13 20:20:40 +00001011 - if exist install.exe del install.exe
1012 ren dosinst.exe install.exe
1013
1014uninstal.exe: uninstal.c
1015 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
1016
1017vimrun.exe: vimrun.c
1018 $(CC) /nologo -DNDEBUG vimrun.c
1019
1020xxd/xxd.exe: xxd/xxd.c
1021 cd xxd
1022 $(MAKE) /NOLOGO -f Make_mvc.mak
1023 cd ..
1024
1025GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
1026 cd GvimExt
1027 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
1028 cd ..
1029
1030
1031tags: notags
1032 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
1033
1034notags:
1035 - if exist tags del tags
1036
1037clean:
Bram Moolenaar02743632005-07-25 20:42:36 +00001038 - if exist $(OUTDIR)/nul $(DEL_TREE) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001039 - if exist *.obj del *.obj
1040 - if exist $(VIM).exe del $(VIM).exe
1041 - if exist $(VIM).ilk del $(VIM).ilk
1042 - if exist $(VIM).pdb del $(VIM).pdb
1043 - if exist $(VIM).map del $(VIM).map
1044 - if exist $(VIM).ncb del $(VIM).ncb
1045 - if exist vimrun.exe del vimrun.exe
1046 - if exist install.exe del install.exe
1047 - if exist uninstal.exe del uninstal.exe
1048 - if exist if_perl.c del if_perl.c
1049 - if exist dimm.h del dimm.h
1050 - if exist dimm_i.c del dimm_i.c
1051 - if exist dimm.tlb del dimm.tlb
1052 - if exist dosinst.exe del dosinst.exe
Bram Moolenaar2d6db762009-09-11 10:49:58 +00001053 - if exist mzscheme_base.c del mzscheme_base.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001054 cd xxd
1055 $(MAKE) /NOLOGO -f Make_mvc.mak clean
1056 cd ..
1057 cd GvimExt
1058 $(MAKE) /NOLOGO -f Makefile clean
1059 cd ..
1060 cd GvimExt
1061 $(MAKE) /NOLOGO -f Makefile clean
1062 cd ..
1063 - if exist testdir\*.out del testdir\*.out
1064
1065test:
1066 cd testdir
1067 $(MAKE) /NOLOGO -f Make_dos.mak win32
1068 cd ..
1069
Bram Moolenaar34114692005-01-02 11:28:13 +00001070testclean:
1071 cd testdir
1072 $(MAKE) /NOLOGO -f Make_dos.mak clean
1073 cd ..
1074
Bram Moolenaar071d4272004-06-13 20:20:40 +00001075###########################################################################
1076
1077# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
1078# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001079!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001080.c{$(OUTDIR)/}.obj:
1081!ELSE
1082.c{$(OUTDIR)/}.obj::
1083!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001084 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001085
1086# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
1087# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
Bram Moolenaarf22129b2007-10-03 11:29:44 +00001088!IF "$(MSVCVER)" == "4.0"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001089.cpp{$(OUTDIR)/}.obj:
1090!ELSE
1091.cpp{$(OUTDIR)/}.obj::
1092!ENDIF
Bram Moolenaarb6356332005-07-18 21:40:44 +00001093 $(CC) $(CFLAGS) $<
Bram Moolenaar071d4272004-06-13 20:20:40 +00001094
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001095$(OUTDIR)/blowfish.obj: $(OUTDIR) blowfish.c $(INCL)
1096
Bram Moolenaaredac1852010-05-18 20:34:20 +02001097$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001098
Bram Moolenaar071d4272004-06-13 20:20:40 +00001099$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
1100
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001101$(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL)
1102
1103$(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c $(INCL)
1104
Bram Moolenaar071d4272004-06-13 20:20:40 +00001105$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
1106
1107$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
1108
1109$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
1110
1111$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
1112
1113$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
1114
1115$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
1116
1117$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
1118
1119$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
1120
1121$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
1122
1123$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
1124
1125$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
1126
1127$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
1128
Bram Moolenaar58d98232005-07-23 22:25:46 +00001129$(OUTDIR)/hardcopy.obj: $(OUTDIR) hardcopy.c $(INCL)
1130
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001131$(OUTDIR)/hashtab.obj: $(OUTDIR) hashtab.c $(INCL)
Bram Moolenaar383f9bc2005-01-19 22:18:32 +00001132
Bram Moolenaar071d4272004-06-13 20:20:40 +00001133$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
1134
Bram Moolenaar52b4b552005-03-07 23:00:57 +00001135$(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
1136
Bram Moolenaar071d4272004-06-13 20:20:40 +00001137$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
1138
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +02001139$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
1140
Bram Moolenaar071d4272004-06-13 20:20:40 +00001141$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
1142
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001143$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
1144 $(CC) $(CFLAGS) $(LUA_INC) if_lua.c
1145
Bram Moolenaar071d4272004-06-13 20:20:40 +00001146if_perl.c : if_perl.xs typemap
Bram Moolenaar612af432011-09-14 10:49:46 +02001147 $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001148 -typemap typemap if_perl.xs > if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001149
1150$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001151 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001152
1153$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001154 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001155
Bram Moolenaar75676462013-01-30 14:55:42 +01001156$(OUTDIR)/if_mzsch.obj: $(OUTDIR) if_mzsch.c if_mzsch.h $(INCL) $(MZSCHEME_EXTRA_DEP)
Bram Moolenaar6a9aa372005-07-20 21:54:57 +00001157 $(CC) $(CFLAGS) if_mzsch.c \
Bram Moolenaarb6356332005-07-18 21:40:44 +00001158 -DMZSCHEME_COLLECTS=\"$(MZSCHEME:\=\\)\\collects\"
Bram Moolenaar9e70cf12009-05-26 20:59:55 +00001159mzscheme_base.c:
1160 $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base
Bram Moolenaar325b7a22004-07-05 15:58:32 +00001161
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001162$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001163 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001164
Bram Moolenaardd9a4a42013-06-03 20:12:51 +02001165$(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL)
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +02001166 $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c
1167
Bram Moolenaar071d4272004-06-13 20:20:40 +00001168$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
1169
1170$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001171 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001172
1173$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001174 $(CC) $(CFLAGS) if_sniff.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001175
1176$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
Bram Moolenaarb6356332005-07-18 21:40:44 +00001177 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001178
1179$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
1180
1181$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
1182
1183$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
1184
1185$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
1186
1187$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
1188
1189$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
1190
1191$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
1192
1193$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
1194
1195$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
1196
1197$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
1198
1199$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
1200
1201$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
1202
1203$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
1204
1205$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
1206
1207$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
1208
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001209$(OUTDIR)/winclip.obj: $(OUTDIR) winclip.c $(INCL)
1210
Bram Moolenaar071d4272004-06-13 20:20:40 +00001211$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
1212
1213$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
1214
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001215$(OUTDIR)/pathdef.obj: $(OUTDIR) $(PATHDEF_SRC) $(INCL)
1216 $(CC) $(CFLAGS) $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001217
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001218$(OUTDIR)/popupmnu.obj: $(OUTDIR) popupmnu.c $(INCL)
Bram Moolenaarbb15b652005-10-03 21:52:09 +00001219
Bram Moolenaar071d4272004-06-13 20:20:40 +00001220$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
1221
Bram Moolenaarfbc0d2e2013-05-19 19:40:29 +02001222$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c regexp_nfa.c $(INCL)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001223
1224$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
1225
1226$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
1227
Bram Moolenaaredac1852010-05-18 20:34:20 +02001228$(OUTDIR)/sha256.obj: $(OUTDIR) sha256.c $(INCL)
1229
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001230$(OUTDIR)/spell.obj: $(OUTDIR) spell.c $(INCL)
1231
Bram Moolenaar071d4272004-06-13 20:20:40 +00001232$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
1233
1234$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
1235
1236$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
1237
1238$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
1239
1240$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
1241
1242$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
1243
1244$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
Bram Moolenaarb6356332005-07-18 21:40:44 +00001245 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
Bram Moolenaar071d4272004-06-13 20:20:40 +00001246
Bram Moolenaarcc448b32010-07-14 16:52:17 +02001247$(OUTDIR)/vim.res: $(OUTDIR) vim.rc gvim.exe.mnf version.h tools.bmp \
1248 tearoff.bmp vim.ico vim_error.ico \
1249 vim_alert.ico vim_info.ico vim_quest.ico
Bram Moolenaar071d4272004-06-13 20:20:40 +00001250 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
1251
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001252iid_ole.c if_ole.h vim.tlb: if_ole.idl
Bram Moolenaarb6356332005-07-18 21:40:44 +00001253 midl /nologo /error none /proxy nul /iid iid_ole.c /tlb vim.tlb \
1254 /header if_ole.h if_ole.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001255
1256dimm.h dimm_i.c: dimm.idl
Bram Moolenaar7d1f5db2005-07-03 21:39:27 +00001257 midl /nologo /error none /proxy nul dimm.idl
Bram Moolenaar071d4272004-06-13 20:20:40 +00001258
1259$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
1260
1261$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
1262
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001263# $CFLAGS may contain backslashes and double quotes, escape them both.
1264E0_CFLAGS = $(CFLAGS:\=\\)
1265E_CFLAGS = $(E0_CFLAGS:"=\")
Bram Moolenaar77f66d62007-02-20 02:16:18 +00001266# ") stop the string
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001267# $LINKARGS2 may contain backslashes and double quotes, escape them both.
1268E0_LINKARGS2 = $(LINKARGS2:\=\\)
1269E_LINKARGS2 = $(E0_LINKARGS2:"=\")
1270# ") stop the string
Bram Moolenaar89cb5e02004-07-19 20:55:54 +00001271
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001272$(PATHDEF_SRC): auto
1273 @echo creating $(PATHDEF_SRC)
1274 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1275 @echo #include "vim.h" >> $(PATHDEF_SRC)
1276 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> $(PATHDEF_SRC)
1277 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> $(PATHDEF_SRC)
1278 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> $(PATHDEF_SRC)
Bram Moolenaarc30846f2011-02-15 18:06:15 +01001279 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(E_LINKARGS2)"; >> $(PATHDEF_SRC)
Bram Moolenaar8b6144b2006-02-08 09:20:24 +00001280 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1281 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001282
1283auto:
1284 if not exist auto/nul mkdir auto
1285
1286# End Custom Build
1287proto.h: \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001288 proto/blowfish.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001289 proto/buffer.pro \
1290 proto/charset.pro \
Bram Moolenaar07cf3822014-08-10 16:31:50 +02001291 proto/crypt.pro \
1292 proto/crypt_zip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001293 proto/diff.pro \
1294 proto/digraph.pro \
1295 proto/edit.pro \
1296 proto/eval.pro \
1297 proto/ex_cmds.pro \
1298 proto/ex_cmds2.pro \
1299 proto/ex_docmd.pro \
1300 proto/ex_eval.pro \
1301 proto/ex_getln.pro \
1302 proto/fileio.pro \
1303 proto/getchar.pro \
Bram Moolenaar58d98232005-07-23 22:25:46 +00001304 proto/hardcopy.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001305 proto/hashtab.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001306 proto/main.pro \
1307 proto/mark.pro \
1308 proto/memfile.pro \
1309 proto/memline.pro \
1310 proto/menu.pro \
1311 proto/message.pro \
1312 proto/misc1.pro \
1313 proto/misc2.pro \
1314 proto/move.pro \
1315 proto/mbyte.pro \
1316 proto/normal.pro \
1317 proto/ops.pro \
1318 proto/option.pro \
1319 proto/os_mswin.pro \
Bram Moolenaar693e40c2013-02-26 14:56:42 +01001320 proto/winclip.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001321 proto/os_win32.pro \
Bram Moolenaarc01140a2006-03-24 22:21:52 +00001322 proto/popupmnu.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001323 proto/quickfix.pro \
1324 proto/regexp.pro \
1325 proto/screen.pro \
1326 proto/search.pro \
Bram Moolenaar40e6a712010-05-16 22:32:54 +02001327 proto/sha256.pro \
Bram Moolenaar2e4096b2005-03-20 22:25:45 +00001328 proto/spell.pro \
Bram Moolenaar071d4272004-06-13 20:20:40 +00001329 proto/syntax.pro \
1330 proto/tag.pro \
1331 proto/term.pro \
1332 proto/ui.pro \
1333 proto/undo.pro \
1334 proto/window.pro \
1335 $(NETBEANS_PRO)
1336
Bram Moolenaarf193fff2006-04-27 00:02:13 +00001337.SUFFIXES: .cod .i
Bram Moolenaar551dbcc2006-04-25 22:13:59 +00001338
1339# Generate foo.cod (mixed source and assembly listing) from foo.c via "nmake
1340# foo.cod"
1341.c.cod:
1342 $(CC) $(CFLAGS) /FAcs $<
1343
1344# Generate foo.i (preprocessor listing) from foo.c via "nmake foo.i"
1345.c.i:
1346 $(CC) $(CFLAGS) /P /C $<
Bram Moolenaar362e1a32006-03-06 23:29:24 +00001347
1348
Bram Moolenaar071d4272004-06-13 20:20:40 +00001349# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: