blob: 7c1cbd9c9a92392015b7646c0d8b0aa24f79b006 [file] [log] [blame]
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001# Makefile for VIM on Win32 (Cygwin and MinGW)
2#
3# This file contains common part for Cygwin and MinGW and it is included
4# from Make_cyg.mak and Make_ming.mak.
5#
6# Info at http://www.mingw.org
7# Alternative x86 and 64-builds: http://mingw-w64.sourceforge.net
8# Also requires GNU make, which you can download from the same sites.
9# Get missing libraries from http://gnuwin32.sf.net.
10#
11# Tested on Win32 NT 4 and Win95.
12#
13# To make everything, just 'make -f Make_ming.mak'.
14# To make just e.g. gvim.exe, 'make -f Make_ming.mak gvim.exe'.
15# After a run, you can 'make -f Make_ming.mak clean' to clean up.
16#
17# NOTE: Sometimes 'GNU Make' will stop after building vimrun.exe -- I think
18# it's just run out of memory or something. Run again, and it will continue
19# with 'xxd'.
20#
21# "make upx" makes *compressed* versions of the 32 bit GUI and console EXEs,
22# using the excellent UPX compressor:
Bram Moolenaar43cb6262018-03-14 21:39:02 +010023# https://upx.github.io/
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010024# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
25# http://www.matcode.com/mpress.htm
26#
27# Maintained by Ron Aaron <ronaharon@yahoo.com> et al.
28# Updated 2014 Oct 13.
29
30#>>>>> choose options:
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010031# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
32# Set to TINY to make minimal version (few features).
Bram Moolenaare5f2be62016-01-21 20:24:34 +010033FEATURES=HUGE
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020034
K.Takata9eccee02022-03-06 14:01:52 +000035# Set to yes for a debug build.
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020036DEBUG=no
37
K.Takata9eccee02022-03-06 14:01:52 +000038# Set to yes to create a mapfile.
Bram Moolenaarafde13b2019-04-28 19:46:49 +020039#MAP=yes
Bram Moolenaar4ff42902018-09-21 14:43:10 +020040
K.Takata9eccee02022-03-06 14:01:52 +000041# Set to yes to measure code coverage.
Bram Moolenaar18eedfa2020-09-03 19:50:05 +020042COVERAGE=no
43
K.Takata9eccee02022-03-06 14:01:52 +000044# Better encryption support using libsodium.
45# Set to yes or specify the path to the libsodium directory to enable it.
Christian Brabandtf573c6e2021-06-20 14:02:16 +020046#SODIUM=yes
47
K.Takata9eccee02022-03-06 14:01:52 +000048# Set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization.
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020049OPTIMIZE=MAXSPEED
50
K.Takata9eccee02022-03-06 14:01:52 +000051# Set to yes to make gvim, no for vim.
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020052GUI=yes
53
K.Takata9eccee02022-03-06 14:01:52 +000054# Set to yes to enable the DLL support (EXPERIMENTAL).
Bram Moolenaarafde13b2019-04-28 19:46:49 +020055# Creates vim{32,64}.dll, and stub gvim.exe and vim.exe.
56# "GUI" should be also set to "yes".
57#VIMDLL=yes
58
K.Takata9eccee02022-03-06 14:01:52 +000059# Set to no if you do not want to use DirectWrite (DirectX).
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020060# MinGW-w64 is needed, and ARCH should be set to i686 or x86-64.
61DIRECTX=yes
62
63# Disable Color emoji support
64# (default is yes if DIRECTX=yes, requires WinSDK 8.1 or later.)
65#COLOR_EMOJI=no
66
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010067# Set to one of i386, i486, i586, i686 as the minimum target processor.
68# For amd64/x64 architecture set ARCH=x86-64 .
Bram Moolenaare0485392016-07-12 21:17:03 +020069# If not set, it will be automatically detected. (Normally i686 or x86-64.)
70#ARCH=i686
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010071# Set to yes to cross-compile from unix; no=native Windows (and Cygwin).
72CROSS=no
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020073
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010074# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
Bram Moolenaarac8069b2017-10-14 20:24:19 +020075# Use "yes" when the path does not need to be define.
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010076#ICONV="."
77ICONV=yes
78GETTEXT=yes
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020079
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010080# Set to yes to include IME support.
81IME=yes
82DYNAMIC_IME=yes
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020083
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010084# Set to yes to enable writing a postscript file with :hardcopy.
85POSTSCRIPT=no
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020086
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010087# Set to yes to enable OLE support.
88OLE=no
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020089
Bram Moolenaar304925e2018-06-30 16:27:02 +020090# Set the default $(WINVER). Use 0x0501 to make it work with WinXP.
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010091ifndef WINVER
Bram Moolenaar304925e2018-06-30 16:27:02 +020092# WINVER = 0x0501
93WINVER = 0x0600
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010094endif
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020095
Bram Moolenaar4f7e8212014-11-05 13:53:32 +010096# Set to yes to enable Cscope support.
97CSCOPE=yes
Bram Moolenaarcccd62d2018-04-12 20:23:48 +020098
Bram Moolenaare0874f82016-01-24 20:36:41 +010099# Set to yes to enable Netbeans support (requires CHANNEL).
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100100NETBEANS=$(GUI)
Bram Moolenaarcccd62d2018-04-12 20:23:48 +0200101
Bram Moolenaare0874f82016-01-24 20:36:41 +0100102# Set to yes to enable inter process communication.
Bram Moolenaar1aa07bd2016-06-03 19:43:16 +0200103ifeq (HUGE, $(FEATURES))
104CHANNEL=yes
105else
Bram Moolenaare0874f82016-01-24 20:36:41 +0100106CHANNEL=$(GUI)
Bram Moolenaar1aa07bd2016-06-03 19:43:16 +0200107endif
Bram Moolenaarcccd62d2018-04-12 20:23:48 +0200108
Bram Moolenaar8a773062017-07-24 22:29:21 +0200109# Set to yes to enable terminal support.
Bram Moolenaarac8069b2017-10-14 20:24:19 +0200110ifeq (HUGE, $(FEATURES))
111TERMINAL=yes
112else
Bram Moolenaar4fc63502017-07-19 11:28:17 +0200113TERMINAL=no
Bram Moolenaarac8069b2017-10-14 20:24:19 +0200114endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100115
Bram Moolenaar9b283522019-06-17 22:19:33 +0200116# Set to yes to enable sound support.
117ifneq ($(findstring $(FEATURES),BIG HUGE),)
118SOUND=yes
119else
120SOUND=no
121endif
122
Bram Moolenaar9ac9dfa2017-09-01 18:41:26 +0200123ifndef CTAGS
124# this assumes ctags is Exuberant ctags
Bram Moolenaar467c32b2020-01-03 19:12:09 +0100125CTAGS = ctags -I INIT+,INIT2+,INIT3+,INIT4+,INIT5+ --fields=+S
Bram Moolenaar9ac9dfa2017-09-01 18:41:26 +0200126endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100127
128# Link against the shared version of libstdc++ by default. Set
129# STATIC_STDCPLUS to "yes" to link against static version instead.
130ifndef STATIC_STDCPLUS
131STATIC_STDCPLUS=no
132endif
133
Bram Moolenaare3af7632016-12-01 20:37:47 +0100134
135# Link against the shared version of libwinpthread by default. Set
136# STATIC_WINPTHREAD to "yes" to link against static version instead.
137ifndef STATIC_WINPTHREAD
138STATIC_WINPTHREAD=$(STATIC_STDCPLUS)
139endif
Bram Moolenaareda9e9c2018-10-21 22:45:43 +0200140# If you use TDM-GCC(-64), change HAS_GCC_EH to "no".
141# This is used when STATIC_STDCPLUS=yes.
142HAS_GCC_EH=yes
Bram Moolenaare3af7632016-12-01 20:37:47 +0100143
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100144# If the user doesn't want gettext, undefine it.
145ifeq (no, $(GETTEXT))
146GETTEXT=
147endif
148# Added by E.F. Amatria <eferna1@platea.ptic.mec.es> 2001 Feb 23
149# Uncomment the first line and one of the following three if you want Native Language
150# Support. You'll need gnu_gettext.win32, a MINGW32 Windows PORT of gettext by
151# Franco Bez <franco.bez@gmx.de>. It may be found at
152# http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
153# Tested with mingw32 with GCC-2.95.2 on Win98
154# Updated 2001 Jun 9
155#GETTEXT=c:/gettext.win32.msvcrt
156#STATIC_GETTEXT=USE_STATIC_GETTEXT
157#DYNAMIC_GETTEXT=USE_GETTEXT_DLL
158#DYNAMIC_GETTEXT=USE_SAFE_GETTEXT_DLL
159SAFE_GETTEXT_DLL_OBJ = $(GETTEXT)/src/safe_gettext_dll/safe_gettext_dll.o
160# Alternatively, if you uncomment the two following lines, you get a "safe" version
161# without linking the safe_gettext_dll.o object file.
162#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
163#GETTEXT_DYNAMIC=gnu_gettext.dll
164INTLPATH=$(GETTEXT)/lib/mingw32
165INTLLIB=gnu_gettext
166
167# If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext
168# or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/
169# uncomment the following, but I can't build a static version with them, ?-(|
170#GETTEXT=c:/gettext-0.10.37-20010430
171#STATIC_GETTEXT=USE_STATIC_GETTEXT
172#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
173#INTLPATH=$(GETTEXT)/lib
174#INTLLIB=intl
175
Bram Moolenaare0485392016-07-12 21:17:03 +0200176
177# Command definitions (depends on cross-compiling and shell)
178ifeq ($(CROSS),yes)
179# cross-compiler prefix:
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200180 ifndef CROSS_COMPILE
Bram Moolenaare0485392016-07-12 21:17:03 +0200181CROSS_COMPILE = i586-pc-mingw32msvc-
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200182 endif
Bram Moolenaare0485392016-07-12 21:17:03 +0200183DEL = rm
184MKDIR = mkdir -p
185DIRSLASH = /
186else
187# normal (Windows) compilation:
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200188 ifndef CROSS_COMPILE
Bram Moolenaare0485392016-07-12 21:17:03 +0200189CROSS_COMPILE =
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200190 endif
Bram Moolenaare828b762018-09-10 17:51:58 +0200191
192# About the "sh.exe" condition, as explained by Ken Takata:
193#
194# If the makefile is executed with mingw32-make and sh.exe is not found in
195# $PATH, then $SHELL is set to "sh.exe" (without any path). In this case,
196# unix-like commands might not work and a dos-style path is needed.
197#
198# If the makefile is executed with mingw32-make and sh.exe IS found in $PATH,
199# then $SHELL is set with the actual path of sh.exe (e.g.
200# "C:/msys64/usr/bin/sh.exe"). In this case, unix-like commands can be used.
201#
202# If it is executed by the "make" command from cmd.exe, $SHELL is set to
203# "/bin/sh". If the "make" command is in the $PATH, other unix-like commands
204# might also work.
205#
206# If it is executed by the "make" command from a unix-like shell,
207# $SHELL is set with the unix-style path (e.g. "/bin/bash").
208# In this case, unix-like commands can be used.
209#
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200210 ifneq (sh.exe, $(SHELL))
Bram Moolenaare0485392016-07-12 21:17:03 +0200211DEL = rm
212MKDIR = mkdir -p
213DIRSLASH = /
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200214 else
Bram Moolenaare0485392016-07-12 21:17:03 +0200215DEL = del
216MKDIR = mkdir
217DIRSLASH = \\
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200218 endif
Bram Moolenaare0485392016-07-12 21:17:03 +0200219endif
220CC := $(CROSS_COMPILE)gcc
221CXX := $(CROSS_COMPILE)g++
222ifeq ($(UNDER_CYGWIN),yes)
223WINDRES := $(CROSS_COMPILE)windres
224else
225WINDRES := windres
226endif
Bram Moolenaare0485392016-07-12 21:17:03 +0200227
228# Get the default ARCH.
229ifndef ARCH
Bram Moolenaarf62e7972016-07-14 20:25:03 +0200230ARCH := $(shell $(CC) -dumpmachine | sed -e 's/-.*//' -e 's/_/-/' -e 's/^mingw32$$/i686/')
Bram Moolenaare0485392016-07-12 21:17:03 +0200231endif
232
233
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100234# Perl interface:
235# PERL=[Path to Perl directory] (Set inside Make_cyg.mak or Make_ming.mak)
236# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200237# PERL_VER=[Perl version, eg 56, 58, 510] (default is 524)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100238ifdef PERL
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200239 ifndef PERL_VER
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200240PERL_VER=524
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200241 endif
242 ifndef DYNAMIC_PERL
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100243DYNAMIC_PERL=yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200244 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100245# on Linux, for cross-compile, it's here:
246#PERLLIB=/home/ron/ActivePerl/lib
247# on NT, it's here:
248PERLEXE=$(PERL)/bin/perl
249PERLLIB=$(PERL)/lib
250PERLLIBS=$(PERLLIB)/Core
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200251 ifeq ($(UNDER_CYGWIN),yes)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100252PERLTYPEMAP:=$(shell cygpath -m $(PERLLIB)/ExtUtils/typemap)
253XSUBPPTRY:=$(shell cygpath -m $(PERLLIB)/ExtUtils/xsubpp)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200254 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100255PERLTYPEMAP=$(PERLLIB)/ExtUtils/typemap
256XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200257 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100258XSUBPP_EXISTS=$(shell $(PERLEXE) -e "print 1 unless -e '$(XSUBPPTRY)'")
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200259 ifeq "$(XSUBPP_EXISTS)" ""
Bram Moolenaar345326a2014-11-06 10:03:01 +0100260XSUBPP=$(PERLEXE) $(XSUBPPTRY)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200261 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100262XSUBPP=xsubpp
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200263 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100264endif
265
266# Lua interface:
267# LUA=[Path to Lua directory] (Set inside Make_cyg.mak or Make_ming.mak)
Bram Moolenaarb872e632018-09-21 13:44:09 +0200268# LUA_LIBDIR=[Path to Lua library directory] (default: $LUA/lib)
269# LUA_INCDIR=[Path to Lua include directory] (default: $LUA/include)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100270# DYNAMIC_LUA=yes (to load the Lua DLL dynamically)
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200271# LUA_VER=[Lua version, eg 51, 52] (default is 53)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100272ifdef LUA
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200273 ifndef DYNAMIC_LUA
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100274DYNAMIC_LUA=yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200275 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100276
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200277 ifndef LUA_VER
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200278LUA_VER=53
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200279 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100280
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200281 ifeq (no,$(DYNAMIC_LUA))
Bram Moolenaarb872e632018-09-21 13:44:09 +0200282LUA_LIBDIR = $(LUA)/lib
283LUA_LIB = -L$(LUA_LIBDIR) -llua
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200284 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100285
286endif
287
288# MzScheme interface:
289# MZSCHEME=[Path to MzScheme directory] (Set inside Make_cyg.mak or Make_ming.mak)
290# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLL dynamically)
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200291# MZSCHEME_VER=[MzScheme version] (default is 3m_a0solc (6.6))
Bram Moolenaarf16c71b2017-09-18 20:01:02 +0200292# Used for the DLL file name. E.g.:
293# C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100294# MZSCHEME_DEBUG=no
295ifdef MZSCHEME
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200296 ifndef DYNAMIC_MZSCHEME
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100297DYNAMIC_MZSCHEME=yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200298 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100299
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200300 ifndef MZSCHEME_VER
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200301MZSCHEME_VER=3m_a0solc
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200302 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100303
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100304# for version 4.x we need to generate byte-code for Scheme base
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200305 ifndef MZSCHEME_GENERATE_BASE
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100306MZSCHEME_GENERATE_BASE=no
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200307 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100308
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200309 ifneq ($(wildcard $(MZSCHEME)/lib/msvc/libmzsch$(MZSCHEME_VER).lib),)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100310MZSCHEME_MAIN_LIB=mzsch
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200311 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100312MZSCHEME_MAIN_LIB=racket
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200313 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100314
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200315 ifndef MZSCHEME_PRECISE_GC
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100316MZSCHEME_PRECISE_GC=no
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200317 ifneq ($(wildcard $(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll),)
318 ifeq ($(wildcard $(MZSCHEME)\lib\libmzgc$(MZSCHEME_VER).dll),)
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100319MZSCHEME_PRECISE_GC=yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200320 endif
321 else
322 ifneq ($(wildcard $(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib),)
323 ifeq ($(wildcard $(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib),)
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100324MZSCHEME_PRECISE_GC=yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200325 endif
326 endif
327 endif
328 endif
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100329
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200330 ifeq (no,$(DYNAMIC_MZSCHEME))
331 ifeq (yes,$(MZSCHEME_PRECISE_GC))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100332MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200333 else
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100334MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200335 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100336# the modern MinGW can dynamically link to dlls directly.
337# point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200338 ifndef MZSCHEME_DLLS
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100339MZSCHEME_DLLS=$(MZSCHEME)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200340 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100341MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200342 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100343
344endif
345
346# Python interface:
347# PYTHON=[Path to Python directory] (Set inside Make_cyg.mak or Make_ming.mak)
348# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200349# PYTHON_VER=[Python version, eg 22, 23, ..., 27] (default is 27)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100350ifdef PYTHON
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200351 ifndef DYNAMIC_PYTHON
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100352DYNAMIC_PYTHON=yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200353 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100354
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200355 ifndef PYTHON_VER
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100356PYTHON_VER=27
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200357 endif
358 ifndef DYNAMIC_PYTHON_DLL
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100359DYNAMIC_PYTHON_DLL=python$(PYTHON_VER).dll
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200360 endif
361 ifdef PYTHON_HOME
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100362PYTHON_HOME_DEF=-DPYTHON_HOME=\"$(PYTHON_HOME)\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200363 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100364
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200365 ifeq (no,$(DYNAMIC_PYTHON))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100366PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200367 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100368# my include files are in 'win32inc' on Linux, and 'include' in the standard
369# NT distro (ActiveState)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200370 ifndef PYTHONINC
371 ifeq ($(CROSS),no)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100372PYTHONINC=-I $(PYTHON)/include
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200373 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100374PYTHONINC=-I $(PYTHON)/win32inc
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200375 endif
376 endif
Bram Moolenaar3c6f92e2016-01-02 20:26:36 +0100377endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100378
379# Python3 interface:
380# PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak)
381# DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100382# PYTHON3_VER=[Python3 version, eg 31, 32] (default is 36)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100383ifdef PYTHON3
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200384 ifndef DYNAMIC_PYTHON3
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100385DYNAMIC_PYTHON3=yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200386 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100387
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200388 ifndef PYTHON3_VER
Bram Moolenaar59eb0162017-12-10 18:17:44 +0100389PYTHON3_VER=36
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200390 endif
391 ifndef DYNAMIC_PYTHON3_DLL
Bram Moolenaara7c37952016-01-20 22:23:15 +0100392DYNAMIC_PYTHON3_DLL=python$(PYTHON3_VER).dll
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200393 endif
394 ifdef PYTHON3_HOME
Bram Moolenaaracd58ef2016-02-16 13:42:24 +0100395PYTHON3_HOME_DEF=-DPYTHON3_HOME=L\"$(PYTHON3_HOME)\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200396 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100397
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200398 ifeq (no,$(DYNAMIC_PYTHON3))
Bram Moolenaara7c37952016-01-20 22:23:15 +0100399PYTHON3LIB=-L$(PYTHON3)/libs -lpython$(PYTHON3_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200400 endif
Bram Moolenaara7c37952016-01-20 22:23:15 +0100401
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200402 ifndef PYTHON3INC
403 ifeq ($(CROSS),no)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100404PYTHON3INC=-I $(PYTHON3)/include
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200405 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100406PYTHON3INC=-I $(PYTHON3)/win32inc
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200407 endif
408 endif
Bram Moolenaara7c37952016-01-20 22:23:15 +0100409endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100410
411# TCL interface:
412# TCL=[Path to TCL directory] (Set inside Make_cyg.mak or Make_ming.mak)
413# DYNAMIC_TCL=yes (to load the TCL DLL dynamically)
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200414# TCL_VER=[TCL version, eg 83, 84] (default is 86)
415# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.6)
Bram Moolenaareca99bd2016-01-07 22:50:05 +0100416# You must set TCL_VER_LONG when you set TCL_VER.
Bram Moolenaar77f74742017-08-23 22:40:41 +0200417# TCL_DLL=[TCL dll name, eg tcl86.dll] (default is tcl86.dll)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100418ifdef TCL
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200419 ifndef DYNAMIC_TCL
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100420DYNAMIC_TCL=yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200421 endif
422 ifndef TCL_VER
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200423TCL_VER = 86
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200424 endif
425 ifndef TCL_VER_LONG
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200426TCL_VER_LONG = 8.6
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200427 endif
428 ifndef TCL_DLL
Bram Moolenaar77f74742017-08-23 22:40:41 +0200429TCL_DLL = tcl$(TCL_VER).dll
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200430 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100431TCLINC += -I$(TCL)/include
432endif
433
434
435# Ruby interface:
436# RUBY=[Path to Ruby directory] (Set inside Make_cyg.mak or Make_ming.mak)
Bram Moolenaar61766972018-04-20 22:31:41 +0200437# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically, "no" for static)
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200438# RUBY_VER=[Ruby version, eg 19, 22] (default is 22)
439# RUBY_API_VER_LONG=[Ruby API version, eg 1.8, 1.9.1, 2.2.0]
440# (default is 2.2.0)
441# You must set RUBY_API_VER_LONG when changing RUBY_VER.
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100442# Note: If you use Ruby 1.9.3, set as follows:
443# RUBY_VER=19
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200444# RUBY_API_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100445ifdef RUBY
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200446 ifndef DYNAMIC_RUBY
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100447DYNAMIC_RUBY=yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200448 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100449# Set default value
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200450 ifndef RUBY_VER
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200451RUBY_VER = 22
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200452 endif
453 ifndef RUBY_VER_LONG
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200454RUBY_VER_LONG = 2.2.0
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200455 endif
456 ifndef RUBY_API_VER_LONG
Bram Moolenaar0eaadec2016-09-08 20:28:45 +0200457RUBY_API_VER_LONG = $(RUBY_VER_LONG)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200458 endif
459 ifndef RUBY_API_VER
Bram Moolenaar6384c5d2016-09-06 22:06:35 +0200460RUBY_API_VER = $(subst .,,$(RUBY_API_VER_LONG))
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200461 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100462
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200463 ifndef RUBY_PLATFORM
464 ifeq ($(RUBY_VER), 16)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100465RUBY_PLATFORM = i586-mswin32
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200466 else ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/i386-mingw32),)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100467RUBY_PLATFORM = i386-mingw32
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200468 else ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/x64-mingw32),)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100469RUBY_PLATFORM = x64-mingw32
K.Takata1f47a282022-01-31 13:25:36 +0000470 else ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/x64-mingw-ucrt),)
471RUBY_PLATFORM = x64-mingw-ucrt
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200472 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100473RUBY_PLATFORM = i386-mswin32
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200474 endif
475 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100476
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200477 ifndef RUBY_INSTALL_NAME
478 ifeq ($(RUBY_VER), 16)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100479RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200480 else
481 ifndef RUBY_MSVCRT_NAME
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100482# Base name of msvcrXX.dll which is used by ruby's dll.
483RUBY_MSVCRT_NAME = msvcrt
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200484 endif
K.Takata1f47a282022-01-31 13:25:36 +0000485 ifeq ($(RUBY_PLATFORM),x64-mingw-ucrt)
486RUBY_INSTALL_NAME = x64-ucrt-ruby$(RUBY_API_VER)
487 else ifeq ($(ARCH),x86-64)
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100488RUBY_INSTALL_NAME = x64-$(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200489 else
Bram Moolenaar0bee2fe2016-01-07 22:45:09 +0100490RUBY_INSTALL_NAME = $(RUBY_MSVCRT_NAME)-ruby$(RUBY_API_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200491 endif
492 endif
493 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100494
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200495 ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100496RUBY_19_OR_LATER = 1
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200497 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100498
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200499 ifdef RUBY_19_OR_LATER
Bram Moolenaar76c612a2018-09-21 14:31:51 +0200500RUBYINC = -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200501 else
Bram Moolenaar76c612a2018-09-21 14:31:51 +0200502RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_API_VER_LONG)/$(RUBY_PLATFORM)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200503 endif
504 ifeq (no, $(DYNAMIC_RUBY))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100505RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200506 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100507
508endif # RUBY
509
510# See feature.h for a list of options.
511# Any other defines can be included here.
Bram Moolenaar0472b6d2019-02-18 21:41:37 +0100512DEF_GUI=-DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100513DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
Bram Moolenaar22fcfad2016-07-01 18:17:26 +0200514 -DHAVE_PATHDEF -DFEAT_$(FEATURES) -DHAVE_STDINT_H
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100515ifeq ($(ARCH),x86-64)
516DEFINES+=-DMS_WIN64
517endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100518
519#>>>>> end of choices
520###########################################################################
521
Bram Moolenaarb361db02018-10-16 21:13:14 +0200522CFLAGS = -I. -Iproto $(DEFINES) -pipe -march=$(ARCH) -Wall
Bram Moolenaar6c0e9842016-03-22 20:42:31 +0100523CXXFLAGS = -std=gnu++11
Bram Moolenaar5c829bf2021-01-25 19:18:02 +0100524# This used to have --preprocessor, but it's no longer supported
525WINDRES_FLAGS =
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100526EXTRA_LIBS =
527
528ifdef GETTEXT
529DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
530GETTEXTINCLUDE = $(GETTEXT)/include
531GETTEXTLIB = $(INTLPATH)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200532 ifeq (yes, $(GETTEXT))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100533DEFINES += -DDYNAMIC_GETTEXT
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200534 else ifdef DYNAMIC_GETTEXT
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100535DEFINES += -D$(DYNAMIC_GETTEXT)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200536 ifdef GETTEXT_DYNAMIC
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100537DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200538 endif
539 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100540endif
541
542ifdef PERL
Bram Moolenaar367fbf12015-06-25 16:13:46 +0200543CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200544 ifeq (yes, $(DYNAMIC_PERL))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100545CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
546EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200547 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100548endif
549
550ifdef LUA
Bram Moolenaarb872e632018-09-21 13:44:09 +0200551LUA_INCDIR = $(LUA)/include
552CFLAGS += -I$(LUA_INCDIR) -I$(LUA) -DFEAT_LUA
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200553 ifeq (yes, $(DYNAMIC_LUA))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100554CFLAGS += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200555 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100556endif
557
558ifdef MZSCHEME
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200559 ifndef MZSCHEME_COLLECTS
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100560MZSCHEME_COLLECTS=$(MZSCHEME)/collects
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200561 ifeq (yes, $(UNDER_CYGWIN))
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100562MZSCHEME_COLLECTS:=$(shell cygpath -m $(MZSCHEME_COLLECTS) | sed -e 's/ /\\ /g')
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200563 endif
564 endif
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100565CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME_COLLECTS)\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200566 ifeq (yes, $(DYNAMIC_MZSCHEME))
567 ifeq (yes, $(MZSCHEME_PRECISE_GC))
Bram Moolenaar4e640bd2016-01-16 16:20:38 +0100568# Precise GC does not use separate dll
569CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200570 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100571CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200572 endif
573 endif
574 ifeq (yes, "$(MZSCHEME_DEBUG)")
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100575CFLAGS += -DMZSCHEME_FORCE_GC
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200576 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100577endif
578
579ifdef RUBY
580CFLAGS += -DFEAT_RUBY $(RUBYINC)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200581 ifeq (yes, $(DYNAMIC_RUBY))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100582CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200583 endif
Bram Moolenaar259a90f2018-04-21 19:08:55 +0200584CFLAGS += -DRUBY_VERSION=$(RUBY_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200585 ifneq ($(findstring w64-mingw32,$(CC)),)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100586# A workaround for MinGW-w64
587CFLAGS += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200588 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100589endif
590
591ifdef PYTHON
Bram Moolenaar223b7232016-02-19 19:43:49 +0100592CFLAGS += -DFEAT_PYTHON
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200593 ifeq (yes, $(DYNAMIC_PYTHON))
Bram Moolenaar449538c2016-01-09 17:49:15 +0100594CFLAGS += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"$(DYNAMIC_PYTHON_DLL)\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200595 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100596endif
597
Bram Moolenaar223b7232016-02-19 19:43:49 +0100598ifdef PYTHON3
599CFLAGS += -DFEAT_PYTHON3
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200600 ifeq (yes, $(DYNAMIC_PYTHON3))
Bram Moolenaara7c37952016-01-20 22:23:15 +0100601CFLAGS += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"$(DYNAMIC_PYTHON3_DLL)\"
Bram Moolenaar56b8dc32020-08-06 21:47:11 +0200602 else
603CFLAGS += -DPYTHON3_DLL=\"$(DYNAMIC_PYTHON3_DLL)\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200604 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100605endif
606
607ifdef TCL
608CFLAGS += -DFEAT_TCL $(TCLINC)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200609 ifeq (yes, $(DYNAMIC_TCL))
Bram Moolenaar77f74742017-08-23 22:40:41 +0200610CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200611 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100612endif
613
614ifeq ($(POSTSCRIPT),yes)
615DEFINES += -DMSWINPS
616endif
617
618ifeq (yes, $(OLE))
619DEFINES += -DFEAT_OLE
620endif
621
622ifeq ($(CSCOPE),yes)
623DEFINES += -DFEAT_CSCOPE
624endif
625
626ifeq ($(NETBEANS),yes)
627# Only allow NETBEANS for a GUI build.
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200628 ifeq (yes, $(GUI))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100629DEFINES += -DFEAT_NETBEANS_INTG
630
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200631 ifeq ($(NBDEBUG), yes)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100632DEFINES += -DNBDEBUG
633NBDEBUG_INCL = nbdebug.h
634NBDEBUG_SRC = nbdebug.c
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200635 endif
636 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100637endif
638
Bram Moolenaare0874f82016-01-24 20:36:41 +0100639ifeq ($(CHANNEL),yes)
Bram Moolenaaraa822592020-04-17 20:48:57 +0200640DEFINES += -DFEAT_JOB_CHANNEL -DFEAT_IPV6
Bram Moolenaar852ea362020-06-04 21:32:49 +0200641 ifeq ($(shell expr "$$(($(WINVER)))" \>= "$$((0x600))"),1)
Bram Moolenaarb6fb0512020-04-18 18:24:18 +0200642DEFINES += -DHAVE_INET_NTOP
643 endif
Bram Moolenaare0874f82016-01-24 20:36:41 +0100644endif
645
Bram Moolenaar4fc63502017-07-19 11:28:17 +0200646ifeq ($(TERMINAL),yes)
647DEFINES += -DFEAT_TERMINAL
Bram Moolenaarf80451e2017-07-25 21:49:35 +0200648TERM_DEPS = \
649 libvterm/include/vterm.h \
650 libvterm/include/vterm_keycodes.h \
651 libvterm/src/rect.h \
652 libvterm/src/utf8.h \
653 libvterm/src/vterm_internal.h
Bram Moolenaar4fc63502017-07-19 11:28:17 +0200654endif
655
Bram Moolenaar9b283522019-06-17 22:19:33 +0200656ifeq ($(SOUND),yes)
657DEFINES += -DFEAT_SOUND
658endif
659
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100660# DirectWrite (DirectX)
661ifeq ($(DIRECTX),yes)
662# Only allow DirectWrite for a GUI build.
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200663 ifeq (yes, $(GUI))
Bram Moolenaarcccd62d2018-04-12 20:23:48 +0200664DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200665 ifneq ($(COLOR_EMOJI),no)
Bram Moolenaarcccd62d2018-04-12 20:23:48 +0200666DEFINES += -DFEAT_DIRECTX_COLOR_EMOJI
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200667 endif
668 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100669endif
670
K.Takata9eccee02022-03-06 14:01:52 +0000671ifdef SODIUM
672DEFINES += -DHAVE_SODIUM
673 ifneq ($(SODIUM),yes)
674CFLAGS += -I $(SODIUM)/include
675 endif
K.Takata1a8825d2022-01-19 13:32:57 +0000676 ifndef DYNAMIC_SODIUM
677DYNAMIC_SODIUM=yes
678 endif
679 ifeq ($(DYNAMIC_SODIUM),yes)
680DEFINES += -DDYNAMIC_SODIUM
681 else
Christian Brabandtf573c6e2021-06-20 14:02:16 +0200682SODIUMLIB = -lsodium
K.Takata1a8825d2022-01-19 13:32:57 +0000683 endif
Christian Brabandtf573c6e2021-06-20 14:02:16 +0200684endif
685
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100686# Only allow XPM for a GUI build.
687ifeq (yes, $(GUI))
688
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200689 ifndef XPM
690 ifeq ($(ARCH),i386)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100691XPM = xpm/x86
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200692 endif
693 ifeq ($(ARCH),i486)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100694XPM = xpm/x86
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200695 endif
696 ifeq ($(ARCH),i586)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100697XPM = xpm/x86
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200698 endif
699 ifeq ($(ARCH),i686)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100700XPM = xpm/x86
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200701 endif
702 ifeq ($(ARCH),x86-64)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100703XPM = xpm/x64
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200704 endif
705 endif
706 ifdef XPM
707 ifneq ($(XPM),no)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100708CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200709 endif
710 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100711
712endif
713
714ifeq ($(DEBUG),yes)
715CFLAGS += -g -fstack-check
716DEBUG_SUFFIX=d
717else
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200718 ifeq ($(OPTIMIZE), SIZE)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100719CFLAGS += -Os
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200720 else ifeq ($(OPTIMIZE), MAXSPEED)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100721CFLAGS += -O3
722CFLAGS += -fomit-frame-pointer -freg-struct-return
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200723 else # SPEED
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100724CFLAGS += -O2
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200725 endif
Bram Moolenaarafde13b2019-04-28 19:46:49 +0200726LFLAGS += -s
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100727endif
728
Bram Moolenaar18eedfa2020-09-03 19:50:05 +0200729ifeq ($(COVERAGE),yes)
730CFLAGS += --coverage
731LFLAGS += --coverage
732endif
733
Bram Moolenaar828c3d72018-06-19 18:58:07 +0200734LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion
Bram Moolenaar796cc422019-04-03 20:31:00 +0200735GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o
Bram Moolenaar97ff9b92016-06-26 20:37:46 +0200736CUIOBJ = $(OUTDIR)/iscygpty.o
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100737OBJ = \
Yegappan Lakshmanancbae5802021-08-06 21:51:55 +0200738 $(OUTDIR)/alloc.o \
Bram Moolenaar75464dc2016-07-02 20:27:50 +0200739 $(OUTDIR)/arabic.o \
Bram Moolenaar4ad62152019-08-17 14:38:55 +0200740 $(OUTDIR)/arglist.o \
Bram Moolenaar3e460fd2019-01-26 16:21:07 +0100741 $(OUTDIR)/autocmd.o \
Bram Moolenaarc3719bd2017-11-18 22:13:31 +0100742 $(OUTDIR)/beval.o \
Bram Moolenaar6e5ea8d2019-01-12 22:47:31 +0100743 $(OUTDIR)/blob.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100744 $(OUTDIR)/blowfish.o \
745 $(OUTDIR)/buffer.o \
Bram Moolenaar473952e2019-09-28 16:30:04 +0200746 $(OUTDIR)/bufwrite.o \
Bram Moolenaarec28d152019-05-11 18:36:34 +0200747 $(OUTDIR)/change.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100748 $(OUTDIR)/charset.o \
Bram Moolenaar14c01f82019-10-09 22:53:08 +0200749 $(OUTDIR)/cindent.o \
Bram Moolenaarf87a0402020-04-05 20:21:03 +0200750 $(OUTDIR)/clientserver.o \
Bram Moolenaar45fffdf2020-03-24 21:42:01 +0100751 $(OUTDIR)/clipboard.o \
Bram Moolenaar66b51422019-08-18 21:44:12 +0200752 $(OUTDIR)/cmdexpand.o \
Bram Moolenaard7663c22019-08-06 21:59:57 +0200753 $(OUTDIR)/cmdhist.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100754 $(OUTDIR)/crypt.o \
755 $(OUTDIR)/crypt_zip.o \
Bram Moolenaareead75c2019-04-21 11:35:00 +0200756 $(OUTDIR)/debugger.o \
Bram Moolenaar6583c442016-07-17 18:41:47 +0200757 $(OUTDIR)/dict.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100758 $(OUTDIR)/diff.o \
759 $(OUTDIR)/digraph.o \
Bram Moolenaar7528d1f2019-09-19 23:06:20 +0200760 $(OUTDIR)/drawline.o \
761 $(OUTDIR)/drawscreen.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100762 $(OUTDIR)/edit.o \
763 $(OUTDIR)/eval.o \
Bram Moolenaar261f3462019-09-07 15:45:32 +0200764 $(OUTDIR)/evalbuffer.o \
Bram Moolenaar73dad1e2016-07-17 22:13:49 +0200765 $(OUTDIR)/evalfunc.o \
Bram Moolenaar0522ba02019-08-27 22:48:30 +0200766 $(OUTDIR)/evalvars.o \
Bram Moolenaar261f3462019-09-07 15:45:32 +0200767 $(OUTDIR)/evalwindow.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100768 $(OUTDIR)/ex_cmds.o \
769 $(OUTDIR)/ex_cmds2.o \
770 $(OUTDIR)/ex_docmd.o \
771 $(OUTDIR)/ex_eval.o \
772 $(OUTDIR)/ex_getln.o \
773 $(OUTDIR)/fileio.o \
Bram Moolenaarb005cd82019-09-04 15:54:55 +0200774 $(OUTDIR)/filepath.o \
Bram Moolenaar5fd0f502019-02-13 23:13:28 +0100775 $(OUTDIR)/findfile.o \
Yegappan Lakshmanan01c798c2021-06-02 17:07:18 +0200776 $(OUTDIR)/float.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100777 $(OUTDIR)/fold.o \
778 $(OUTDIR)/getchar.o \
Bram Moolenaarf15c8b62020-06-01 14:34:43 +0200779 $(OUTDIR)/gui_xim.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100780 $(OUTDIR)/hardcopy.o \
781 $(OUTDIR)/hashtab.o \
Bram Moolenaarf868ba82020-07-21 21:07:20 +0200782 $(OUTDIR)/help.o \
Bram Moolenaarf9cc9f22019-07-14 21:29:22 +0200783 $(OUTDIR)/highlight.o \
Bram Moolenaar5ec84982019-09-06 21:46:15 +0200784 $(OUTDIR)/if_cscope.o \
Bram Moolenaar4b471622019-01-31 13:48:09 +0100785 $(OUTDIR)/indent.o \
Bram Moolenaar7591bb32019-03-30 13:53:47 +0100786 $(OUTDIR)/insexpand.o \
Bram Moolenaar520e1e42016-01-23 19:46:28 +0100787 $(OUTDIR)/json.o \
Bram Moolenaar6583c442016-07-17 18:41:47 +0200788 $(OUTDIR)/list.o \
Bram Moolenaar054f14b2020-07-22 19:11:19 +0200789 $(OUTDIR)/locale.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100790 $(OUTDIR)/main.o \
Bram Moolenaarb66bab32019-08-01 14:28:24 +0200791 $(OUTDIR)/map.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100792 $(OUTDIR)/mark.o \
Bram Moolenaar06cf97e2020-06-28 13:17:26 +0200793 $(OUTDIR)/match.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100794 $(OUTDIR)/memfile.o \
795 $(OUTDIR)/memline.o \
796 $(OUTDIR)/menu.o \
797 $(OUTDIR)/message.o \
798 $(OUTDIR)/misc1.o \
799 $(OUTDIR)/misc2.o \
Bram Moolenaarb20b9e12019-09-21 20:48:04 +0200800 $(OUTDIR)/mouse.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100801 $(OUTDIR)/move.o \
802 $(OUTDIR)/mbyte.o \
803 $(OUTDIR)/normal.o \
804 $(OUTDIR)/ops.o \
805 $(OUTDIR)/option.o \
Bram Moolenaardac13472019-09-16 21:06:21 +0200806 $(OUTDIR)/optionstr.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100807 $(OUTDIR)/os_mswin.o \
Bram Moolenaar796cc422019-04-03 20:31:00 +0200808 $(OUTDIR)/os_win32.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100809 $(OUTDIR)/pathdef.o \
Bram Moolenaar30e8e732019-09-27 13:08:36 +0200810 $(OUTDIR)/popupmenu.o \
Bram Moolenaar4d784b22019-05-25 19:51:39 +0200811 $(OUTDIR)/popupwin.o \
Bram Moolenaarfa55cfc2019-07-13 22:59:32 +0200812 $(OUTDIR)/profiler.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100813 $(OUTDIR)/quickfix.o \
814 $(OUTDIR)/regexp.o \
Bram Moolenaar4aea03e2019-09-25 22:37:17 +0200815 $(OUTDIR)/register.o \
Bram Moolenaar307c5a52019-08-25 15:41:00 +0200816 $(OUTDIR)/scriptfile.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100817 $(OUTDIR)/screen.o \
818 $(OUTDIR)/search.o \
Bram Moolenaar84538072019-07-28 14:15:42 +0200819 $(OUTDIR)/session.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100820 $(OUTDIR)/sha256.o \
Bram Moolenaarbbea4702019-01-01 13:20:31 +0100821 $(OUTDIR)/sign.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100822 $(OUTDIR)/spell.o \
Bram Moolenaar9ccfebd2016-07-19 16:39:08 +0200823 $(OUTDIR)/spellfile.o \
Bram Moolenaar46a426c2019-09-27 12:41:56 +0200824 $(OUTDIR)/spellsuggest.o \
Yegappan Lakshmanana2438132021-07-10 21:29:18 +0200825 $(OUTDIR)/strings.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100826 $(OUTDIR)/syntax.o \
827 $(OUTDIR)/tag.o \
828 $(OUTDIR)/term.o \
Bram Moolenaarecaa70e2019-07-14 14:55:39 +0200829 $(OUTDIR)/testing.o \
Bram Moolenaar11abd092020-05-01 14:26:37 +0200830 $(OUTDIR)/textformat.o \
Bram Moolenaared8ce052020-04-29 21:04:15 +0200831 $(OUTDIR)/textobject.o \
Bram Moolenaar98aefe72018-12-13 22:20:09 +0100832 $(OUTDIR)/textprop.o \
Bram Moolenaar0a8fed62020-02-14 13:22:17 +0100833 $(OUTDIR)/time.o \
Bram Moolenaar367d59e2020-05-30 17:06:14 +0200834 $(OUTDIR)/typval.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100835 $(OUTDIR)/ui.o \
836 $(OUTDIR)/undo.o \
Bram Moolenaarac9fb182019-04-27 13:04:13 +0200837 $(OUTDIR)/usercmd.o \
Bram Moolenaar6583c442016-07-17 18:41:47 +0200838 $(OUTDIR)/userfunc.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100839 $(OUTDIR)/version.o \
Bram Moolenaardc7c3662021-12-20 15:04:29 +0000840 $(OUTDIR)/vim9cmds.o \
Bram Moolenaar8a7d6542020-01-26 15:56:19 +0100841 $(OUTDIR)/vim9compile.o \
842 $(OUTDIR)/vim9execute.o \
Bram Moolenaardc7c3662021-12-20 15:04:29 +0000843 $(OUTDIR)/vim9expr.o \
844 $(OUTDIR)/vim9instr.o \
Bram Moolenaar8a7d6542020-01-26 15:56:19 +0100845 $(OUTDIR)/vim9script.o \
Bram Moolenaara7cc9e62020-08-09 15:25:14 +0200846 $(OUTDIR)/vim9type.o \
Bram Moolenaardefa0672019-07-21 19:25:37 +0200847 $(OUTDIR)/viminfo.o \
Bram Moolenaar796cc422019-04-03 20:31:00 +0200848 $(OUTDIR)/winclip.o \
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100849 $(OUTDIR)/window.o
850
Bram Moolenaarafde13b2019-04-28 19:46:49 +0200851ifeq ($(VIMDLL),yes)
matveyte97c7c92021-05-24 18:48:27 +0200852OBJ += $(OUTDIR)/os_w32dll.o $(OUTDIR)/vimresd.o
853EXEOBJC = $(OUTDIR)/os_w32exec.o $(OUTDIR)/vimresc.o
854EXEOBJG = $(OUTDIR)/os_w32exeg.o $(OUTDIR)/vimresg.o
Bram Moolenaarafde13b2019-04-28 19:46:49 +0200855else
matveyte97c7c92021-05-24 18:48:27 +0200856OBJ += $(OUTDIR)/os_w32exe.o $(OUTDIR)/vimres.o
Bram Moolenaarafde13b2019-04-28 19:46:49 +0200857endif
858
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100859ifdef PERL
860OBJ += $(OUTDIR)/if_perl.o
861endif
862ifdef LUA
863OBJ += $(OUTDIR)/if_lua.o
864endif
865ifdef MZSCHEME
866OBJ += $(OUTDIR)/if_mzsch.o
867MZSCHEME_INCL = if_mzsch.h
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200868 ifeq (yes,$(MZSCHEME_GENERATE_BASE))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100869CFLAGS += -DINCLUDE_MZSCHEME_BASE
870MZ_EXTRA_DEP += mzscheme_base.c
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200871 endif
872 ifeq (yes,$(MZSCHEME_PRECISE_GC))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100873CFLAGS += -DMZ_PRECISE_GC
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200874 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100875endif
876ifdef PYTHON
877OBJ += $(OUTDIR)/if_python.o
878endif
879ifdef PYTHON3
880OBJ += $(OUTDIR)/if_python3.o
881endif
882ifdef RUBY
883OBJ += $(OUTDIR)/if_ruby.o
884endif
885ifdef TCL
886OBJ += $(OUTDIR)/if_tcl.o
887endif
Bram Moolenaare0874f82016-01-24 20:36:41 +0100888
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100889ifeq ($(NETBEANS),yes)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200890 ifneq ($(CHANNEL),yes)
Bram Moolenaare0874f82016-01-24 20:36:41 +0100891# Cannot use Netbeans without CHANNEL
892NETBEANS=no
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200893 else ifneq (yes, $(GUI))
Bram Moolenaar44d57182016-02-14 23:11:23 +0100894# Cannot use Netbeans without GUI.
895NETBEANS=no
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200896 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100897OBJ += $(OUTDIR)/netbeans.o
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200898 endif
Bram Moolenaare0874f82016-01-24 20:36:41 +0100899endif
900
901ifeq ($(CHANNEL),yes)
Bram Moolenaar8b5866d2020-09-05 15:48:51 +0200902OBJ += $(OUTDIR)/job.o $(OUTDIR)/channel.o
Bram Moolenaarbfe13cc2020-04-12 17:53:12 +0200903LIB += -lwsock32 -lws2_32
Bram Moolenaare0874f82016-01-24 20:36:41 +0100904endif
Bram Moolenaare0874f82016-01-24 20:36:41 +0100905
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100906ifeq ($(DIRECTX),yes)
907# Only allow DIRECTX for a GUI build.
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200908 ifeq (yes, $(GUI))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100909OBJ += $(OUTDIR)/gui_dwrite.o
910LIB += -ld2d1 -ldwrite
911USE_STDCPLUS = yes
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200912 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100913endif
914ifneq ($(XPM),no)
915# Only allow XPM for a GUI build.
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200916 ifeq (yes, $(GUI))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100917OBJ += $(OUTDIR)/xpm_w32.o
918# You'll need libXpm.a from http://gnuwin32.sf.net
919LIB += -L$(XPM)/lib -lXpm
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +0200920 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100921endif
922
Bram Moolenaar4fc63502017-07-19 11:28:17 +0200923ifeq ($(TERMINAL),yes)
Bram Moolenaarf80451e2017-07-25 21:49:35 +0200924OBJ += $(OUTDIR)/terminal.o \
Bram Moolenaar93268052019-10-10 13:22:54 +0200925 $(OUTDIR)/vterm_encoding.o \
926 $(OUTDIR)/vterm_keyboard.o \
927 $(OUTDIR)/vterm_mouse.o \
928 $(OUTDIR)/vterm_parser.o \
929 $(OUTDIR)/vterm_pen.o \
930 $(OUTDIR)/vterm_screen.o \
931 $(OUTDIR)/vterm_state.o \
932 $(OUTDIR)/vterm_unicode.o \
933 $(OUTDIR)/vterm_vterm.o
Bram Moolenaar4fc63502017-07-19 11:28:17 +0200934endif
935
Bram Moolenaar9b283522019-06-17 22:19:33 +0200936ifeq ($(SOUND),yes)
937OBJ += $(OUTDIR)/sound.o
938endif
939
Bram Moolenaare828b762018-09-10 17:51:58 +0200940# Include xdiff
941OBJ += $(OUTDIR)/xdiffi.o \
942 $(OUTDIR)/xemit.o \
943 $(OUTDIR)/xprepare.o \
944 $(OUTDIR)/xutils.o \
945 $(OUTDIR)/xhistogram.o \
946 $(OUTDIR)/xpatience.o
947
948XDIFF_DEPS = \
949 xdiff/xdiff.h \
950 xdiff/xdiffi.h \
951 xdiff/xemit.h \
952 xdiff/xinclude.h \
953 xdiff/xmacros.h \
954 xdiff/xprepare.h \
955 xdiff/xtypes.h \
956 xdiff/xutils.h
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100957
958ifdef MZSCHEME
959MZSCHEME_SUFFIX = Z
960endif
961
Bram Moolenaar796cc422019-04-03 20:31:00 +0200962LFLAGS += -municode
963
Bram Moolenaarafde13b2019-04-28 19:46:49 +0200964ifeq ($(VIMDLL),yes)
965VIMEXE := vim$(DEBUG_SUFFIX).exe
966GVIMEXE := gvim$(DEBUG_SUFFIX).exe
967 ifeq ($(ARCH),x86-64)
968VIMDLLBASE := vim64$(DEBUG_SUFFIX)
969 else
970VIMDLLBASE := vim32$(DEBUG_SUFFIX)
971 endif
972TARGET = $(VIMDLLBASE).dll
973LFLAGS += -shared
974EXELFLAGS += -municode
975 ifneq ($(DEBUG),yes)
976EXELFLAGS += -s
977 endif
Bram Moolenaar18eedfa2020-09-03 19:50:05 +0200978 ifeq ($(COVERAGE),yes)
979EXELFLAGS += --coverage
980 endif
Bram Moolenaarafde13b2019-04-28 19:46:49 +0200981DEFINES += $(DEF_GUI) -DVIMDLL
982OBJ += $(GUIOBJ) $(CUIOBJ)
983OUTDIR = dobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
984MAIN_TARGET = $(GVIMEXE) $(VIMEXE) $(VIMDLLBASE).dll
985else ifeq ($(GUI),yes)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100986TARGET := gvim$(DEBUG_SUFFIX).exe
987DEFINES += $(DEF_GUI)
988OBJ += $(GUIOBJ)
989LFLAGS += -mwindows
990OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
Bram Moolenaarafde13b2019-04-28 19:46:49 +0200991MAIN_TARGET = $(TARGET)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100992else
Bram Moolenaar97ff9b92016-06-26 20:37:46 +0200993OBJ += $(CUIOBJ)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100994TARGET := vim$(DEBUG_SUFFIX).exe
995OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
Bram Moolenaarafde13b2019-04-28 19:46:49 +0200996MAIN_TARGET = $(TARGET)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +0100997endif
998
999ifdef GETTEXT
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001000 ifneq (yes, $(GETTEXT))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001001CFLAGS += -I$(GETTEXTINCLUDE)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001002 ifndef STATIC_GETTEXT
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001003LIB += -L$(GETTEXTLIB) -l$(INTLLIB)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001004 ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001005OBJ+=$(SAFE_GETTEXT_DLL_OBJ)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001006 endif
1007 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001008LIB += -L$(GETTEXTLIB) -lintl
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001009 endif
1010 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001011endif
1012
1013ifdef PERL
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001014 ifeq (no, $(DYNAMIC_PERL))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001015LIB += -L$(PERLLIBS) -lperl$(PERL_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001016 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001017endif
1018
1019ifdef TCL
1020LIB += -L$(TCL)/lib
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001021 ifeq (yes, $(DYNAMIC_TCL))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001022LIB += -ltclstub$(TCL_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001023 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001024LIB += -ltcl$(TCL_VER)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001025 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001026endif
1027
1028ifeq (yes, $(OLE))
1029LIB += -loleaut32
1030OBJ += $(OUTDIR)/if_ole.o
1031USE_STDCPLUS = yes
1032endif
1033
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001034ifeq (yes, $(IME))
1035DEFINES += -DFEAT_MBYTE_IME
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001036 ifeq (yes, $(DYNAMIC_IME))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001037DEFINES += -DDYNAMIC_IME
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001038 else
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001039LIB += -limm32
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001040 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001041endif
1042
1043ifdef ICONV
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001044 ifneq (yes, $(ICONV))
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001045LIB += -L$(ICONV)
1046CFLAGS += -I$(ICONV)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001047 endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001048DEFINES+=-DDYNAMIC_ICONV
1049endif
1050
Bram Moolenaar9b283522019-06-17 22:19:33 +02001051ifeq (yes, $(SOUND))
1052LIB += -lwinmm
1053endif
1054
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001055ifeq (yes, $(USE_STDCPLUS))
Bram Moolenaareda9e9c2018-10-21 22:45:43 +02001056LINK = $(CXX)
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001057 ifeq (yes, $(STATIC_STDCPLUS))
Bram Moolenaar60f807b2019-01-31 14:43:19 +01001058#LIB += -static-libstdc++ -static-libgcc
Bram Moolenaard91e5da2019-02-21 13:34:07 +01001059LIB += -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001060 endif
Bram Moolenaareda9e9c2018-10-21 22:45:43 +02001061else
1062LINK = $(CC)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001063endif
1064
Bram Moolenaare3af7632016-12-01 20:37:47 +01001065ifeq (yes, $(STATIC_WINPTHREAD))
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001066 ifeq (yes, $(HAS_GCC_EH))
Bram Moolenaareda9e9c2018-10-21 22:45:43 +02001067LIB += -lgcc_eh
Bram Moolenaar6e75e0a2019-05-11 21:24:26 +02001068 endif
Bram Moolenaare3af7632016-12-01 20:37:47 +01001069LIB += -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic
1070endif
1071
Bram Moolenaar4ff42902018-09-21 14:43:10 +02001072ifeq (yes, $(MAP))
1073LFLAGS += -Wl,-Map=$(TARGET).map
1074endif
1075
Bram Moolenaar30e8e732019-09-27 13:08:36 +02001076all: $(MAIN_TARGET) vimrun.exe xxd/xxd.exe tee/tee.exe install.exe uninstall.exe GvimExt/gvimext.dll
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001077
1078vimrun.exe: vimrun.c
1079 $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB)
1080
Bram Moolenaarf5f4b6c2019-12-14 13:17:11 +01001081install.exe: dosinst.c dosinst.h version.h
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001082 $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
1083
Bram Moolenaarf5f4b6c2019-12-14 13:17:11 +01001084uninstall.exe: uninstall.c dosinst.h version.h
Bram Moolenaar30e8e732019-09-27 13:08:36 +02001085 $(CC) $(CFLAGS) -o uninstall.exe uninstall.c $(LIB) -lole32
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001086
Bram Moolenaarc4390fe2020-11-16 18:49:47 +01001087$(OBJ): | $(OUTDIR)
Bram Moolenaar8496c9e2020-11-13 17:47:33 +01001088
Bram Moolenaarc4390fe2020-11-16 18:49:47 +01001089$(EXEOBJG): | $(OUTDIR)
Bram Moolenaar8496c9e2020-11-13 17:47:33 +01001090
Bram Moolenaarc4390fe2020-11-16 18:49:47 +01001091$(EXEOBJC): | $(OUTDIR)
Bram Moolenaar8496c9e2020-11-13 17:47:33 +01001092
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001093ifeq ($(VIMDLL),yes)
Bram Moolenaarc4390fe2020-11-16 18:49:47 +01001094$(TARGET): $(OBJ)
Christian Brabandtf573c6e2021-06-20 14:02:16 +02001095 $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001096
Bram Moolenaarc4390fe2020-11-16 18:49:47 +01001097$(GVIMEXE): $(EXEOBJG) $(VIMDLLBASE).dll
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001098 $(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE)
1099
Bram Moolenaarc4390fe2020-11-16 18:49:47 +01001100$(VIMEXE): $(EXEOBJC) $(VIMDLLBASE).dll
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001101 $(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE)
1102else
Bram Moolenaarc4390fe2020-11-16 18:49:47 +01001103$(TARGET): $(OBJ)
Christian Brabandtf573c6e2021-06-20 14:02:16 +02001104 $(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001105endif
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001106
1107upx: exes
1108 upx gvim.exe
1109 upx vim.exe
1110
1111mpress: exes
1112 mpress gvim.exe
1113 mpress vim.exe
1114
1115xxd/xxd.exe: xxd/xxd.c
1116 $(MAKE) -C xxd -f Make_ming.mak CC='$(CC)'
1117
Bram Moolenaar04c86d22018-10-17 22:45:54 +02001118tee/tee.exe: tee/tee.c
1119 $(MAKE) -C tee CC='$(CC)'
1120
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001121GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
1122 $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS)
1123
Bram Moolenaar9ac9dfa2017-09-01 18:41:26 +02001124tags: notags
Bram Moolenaar6dc67032018-12-19 21:05:57 +01001125 $(CTAGS) $(TAGS_FILES)
Bram Moolenaar9ac9dfa2017-09-01 18:41:26 +02001126
1127notags:
1128 -$(DEL) tags
1129
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001130clean:
1131 -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
1132 -$(DEL) $(OUTDIR)$(DIRSLASH)*.res
Bram Moolenaardfc14552019-06-21 17:36:10 +02001133 -$(DEL) $(OUTDIR)$(DIRSLASH)pathdef.c
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001134 -rmdir $(OUTDIR)
Bram Moolenaar30e8e732019-09-27 13:08:36 +02001135 -$(DEL) $(MAIN_TARGET) vimrun.exe install.exe uninstall.exe
Bram Moolenaar1e467052019-12-10 22:48:15 +01001136 -$(DEL) *.map
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001137ifdef PERL
1138 -$(DEL) if_perl.c
Bram Moolenaara16bc542018-10-14 16:25:10 +02001139 -$(DEL) auto$(DIRSLASH)if_perl.c
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001140endif
1141ifdef MZSCHEME
1142 -$(DEL) mzscheme_base.c
1143endif
1144 $(MAKE) -C GvimExt -f Make_ming.mak clean
1145 $(MAKE) -C xxd -f Make_ming.mak clean
Bram Moolenaar04c86d22018-10-17 22:45:54 +02001146 $(MAKE) -C tee clean
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001147
Bram Moolenaar0ba89ec2019-12-09 21:48:11 +01001148# Run vim script to generate the Ex command lookup table.
1149# This only needs to be run when a command name has been added or changed.
1150# If this fails because you don't have Vim yet, first build and install Vim
1151# without changes.
1152cmdidxs: ex_cmds.h
ichizok672776d2022-01-31 12:27:18 +00001153 vim --clean -N -X --not-a-term -u create_cmdidxs.vim -c quit
Bram Moolenaar0ba89ec2019-12-09 21:48:11 +01001154
Yegappan Lakshmanan4dc0dd82022-01-29 13:06:40 +00001155# Run vim script to generate the normal/visual mode command lookup table.
1156# This only needs to be run when a new normal/visual mode command has been
1157# added. If this fails because you don't have Vim yet:
ichizok672776d2022-01-31 12:27:18 +00001158# - change nv_cmds[] in nv_cmds.h to add the new normal/visual mode command.
1159# - run "make nvcmdidxs" to generate nv_cmdidxs.h
1160nvcmdidxs: nv_cmds.h
1161 $(CC) $(CFLAGS) -o create_nvcmdidxs.exe create_nvcmdidxs.c $(LIB)
1162 vim --clean -N -X --not-a-term -u create_nvcmdidxs.vim -c quit
1163 -$(DEL) create_nvcmdidxs.exe
Yegappan Lakshmanan4dc0dd82022-01-29 13:06:40 +00001164
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001165###########################################################################
Bram Moolenaarbc4c5052020-08-13 22:47:35 +02001166INCL = vim.h alloc.h ascii.h ex_cmds.h feature.h errors.h globals.h \
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001167 keymap.h macros.h option.h os_dos.h os_win32.h proto.h regexp.h \
Bram Moolenaarb3a29552021-11-19 11:28:04 +00001168 spell.h structs.h termdefs.h beval.h $(NBDEBUG_INCL)
Bram Moolenaarc3719bd2017-11-18 22:13:31 +01001169GUI_INCL = gui.h
Bram Moolenaard22a6f82019-05-24 17:17:54 +02001170ifeq ($(DIRECTX),yes)
1171GUI_INCL += gui_dwrite.h
1172endif
Bram Moolenaar97ff9b92016-06-26 20:37:46 +02001173CUI_INCL = iscygpty.h
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001174
Bram Moolenaardfc14552019-06-21 17:36:10 +02001175PATHDEF_SRC = $(OUTDIR)/pathdef.c
1176
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001177$(OUTDIR)/if_python.o: if_python.c if_py_both.h $(INCL)
Bram Moolenaar449538c2016-01-09 17:49:15 +01001178 $(CC) -c $(CFLAGS) $(PYTHONINC) $(PYTHON_HOME_DEF) $< -o $@
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001179
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001180$(OUTDIR)/if_python3.o: if_python3.c if_py_both.h $(INCL)
Bram Moolenaara7c37952016-01-20 22:23:15 +01001181 $(CC) -c $(CFLAGS) $(PYTHON3INC) $(PYTHON3_HOME_DEF) $< -o $@
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001182
1183$(OUTDIR)/%.o : %.c $(INCL)
1184 $(CC) -c $(CFLAGS) $< -o $@
1185
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001186ifeq ($(VIMDLL),yes)
matveyte97c7c92021-05-24 18:48:27 +02001187$(OUTDIR)/vimresc.o: vim.rc vim.manifest version.h gui_w32_rc.h vim.ico
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001188 $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) -UFEAT_GUI_MSWIN \
1189 --input-format=rc --output-format=coff -i vim.rc -o $@
1190
matveyte97c7c92021-05-24 18:48:27 +02001191$(OUTDIR)/vimresg.o: vim.rc vim.manifest version.h gui_w32_rc.h vim.ico
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001192 $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \
1193 --input-format=rc --output-format=coff -i vim.rc -o $@
1194
matveyte97c7c92021-05-24 18:48:27 +02001195$(OUTDIR)/vimresd.o: vim.rc version.h gui_w32_rc.h \
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001196 tools.bmp tearoff.bmp vim.ico vim_error.ico \
1197 vim_alert.ico vim_info.ico vim_quest.ico
1198 $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) -DRCDLL -DVIMDLLBASE=\\\"$(VIMDLLBASE)\\\" \
1199 --input-format=rc --output-format=coff -i vim.rc -o $@
1200else
matveyte97c7c92021-05-24 18:48:27 +02001201$(OUTDIR)/vimres.o: vim.rc vim.manifest version.h gui_w32_rc.h \
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001202 tools.bmp tearoff.bmp vim.ico vim_error.ico \
1203 vim_alert.ico vim_info.ico vim_quest.ico
1204 $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \
1205 --input-format=rc --output-format=coff -i vim.rc -o $@
1206endif
1207
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001208$(OUTDIR):
1209 $(MKDIR) $(OUTDIR)
1210
Bram Moolenaarf5f4b6c2019-12-14 13:17:11 +01001211$(OUTDIR)/buffer.o: buffer.c $(INCL) version.h
1212
1213$(OUTDIR)/evalfunc.o: evalfunc.c $(INCL) version.h
1214
1215$(OUTDIR)/evalvars.o: evalvars.c $(INCL) version.h
1216
1217$(OUTDIR)/ex_cmds.o: ex_cmds.c $(INCL) version.h
1218
1219$(OUTDIR)/ex_cmds2.o: ex_cmds2.c $(INCL) version.h
1220
Bram Moolenaar0ba89ec2019-12-09 21:48:11 +01001221$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmdidxs.h
1222
Bram Moolenaarf5f4b6c2019-12-14 13:17:11 +01001223$(OUTDIR)/hardcopy.o: hardcopy.c $(INCL) version.h
1224
1225$(OUTDIR)/misc1.o: misc1.c $(INCL) version.h
1226
ichizok672776d2022-01-31 12:27:18 +00001227$(OUTDIR)/normal.o: normal.c $(INCL) nv_cmdidxs.h nv_cmds.h
Yegappan Lakshmanan4dc0dd82022-01-29 13:06:40 +00001228
Bram Moolenaarf5f4b6c2019-12-14 13:17:11 +01001229$(OUTDIR)/netbeans.o: netbeans.c $(INCL) version.h
1230
1231$(OUTDIR)/version.o: version.c $(INCL) version.h
1232
K.Takata7f687aa2022-03-02 17:34:56 +00001233$(OUTDIR)/vim9cmds.o: vim9cmds.c $(INCL) vim9.h
Bram Moolenaardc7c3662021-12-20 15:04:29 +00001234
K.Takata7f687aa2022-03-02 17:34:56 +00001235$(OUTDIR)/vim9compile.o: vim9compile.c $(INCL) vim9.h
Bram Moolenaar8a7d6542020-01-26 15:56:19 +01001236
K.Takata7f687aa2022-03-02 17:34:56 +00001237$(OUTDIR)/vim9execute.o: vim9execute.c $(INCL) vim9.h
Bram Moolenaar8a7d6542020-01-26 15:56:19 +01001238
K.Takata7f687aa2022-03-02 17:34:56 +00001239$(OUTDIR)/vim9expr.o: vim9expr.c $(INCL) vim9.h
Bram Moolenaardc7c3662021-12-20 15:04:29 +00001240
K.Takata7f687aa2022-03-02 17:34:56 +00001241$(OUTDIR)/vim9instr.o: vim9instr.c $(INCL) vim9.h
Bram Moolenaardc7c3662021-12-20 15:04:29 +00001242
K.Takata7f687aa2022-03-02 17:34:56 +00001243$(OUTDIR)/vim9script.o: vim9script.c $(INCL) vim9.h
Bram Moolenaar8a7d6542020-01-26 15:56:19 +01001244
K.Takata7f687aa2022-03-02 17:34:56 +00001245$(OUTDIR)/vim9type.o: vim9type.c $(INCL) vim9.h
Bram Moolenaara7cc9e62020-08-09 15:25:14 +02001246
Bram Moolenaarf5f4b6c2019-12-14 13:17:11 +01001247$(OUTDIR)/viminfo.o: viminfo.c $(INCL) version.h
1248
Bram Moolenaard22a6f82019-05-24 17:17:54 +02001249$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp gui_dwrite.h
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001250 $(CC) -c $(CFLAGS) $(CXXFLAGS) gui_dwrite.cpp -o $@
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001251
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001252$(OUTDIR)/gui.o: gui.c $(INCL) $(GUI_INCL)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001253 $(CC) -c $(CFLAGS) gui.c -o $@
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001254
Bram Moolenaarc3719bd2017-11-18 22:13:31 +01001255$(OUTDIR)/beval.o: beval.c $(INCL) $(GUI_INCL)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001256 $(CC) -c $(CFLAGS) beval.c -o $@
Bram Moolenaarc3719bd2017-11-18 22:13:31 +01001257
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001258$(OUTDIR)/gui_beval.o: gui_beval.c $(INCL) $(GUI_INCL)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001259 $(CC) -c $(CFLAGS) gui_beval.c -o $@
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001260
Bram Moolenaarf5f4b6c2019-12-14 13:17:11 +01001261$(OUTDIR)/gui_w32.o: gui_w32.c $(INCL) $(GUI_INCL) version.h
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001262 $(CC) -c $(CFLAGS) gui_w32.c -o $@
Bram Moolenaarf80451e2017-07-25 21:49:35 +02001263
ichizok40503052022-01-13 18:09:11 +00001264$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001265 $(CC) -c $(CFLAGS) if_cscope.c -o $@
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001266
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001267$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) $(MZSCHEME_INCL) $(MZ_EXTRA_DEP)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001268 $(CC) -c $(CFLAGS) if_mzsch.c -o $@
Bram Moolenaarf80451e2017-07-25 21:49:35 +02001269
1270mzscheme_base.c:
1271 $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
1272
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001273# Remove -D__IID_DEFINED__ for newer versions of the w32api
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001274$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) if_ole.h
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001275 $(CC) -c $(CFLAGS) $(CXXFLAGS) if_ole.cpp -o $@
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001276
Bram Moolenaara16bc542018-10-14 16:25:10 +02001277auto/if_perl.c: if_perl.xs typemap
Bram Moolenaarf80451e2017-07-25 21:49:35 +02001278 $(XSUBPP) -prototypes -typemap \
1279 $(PERLTYPEMAP) if_perl.xs -output $@
1280
Bram Moolenaara16bc542018-10-14 16:25:10 +02001281$(OUTDIR)/if_perl.o: auto/if_perl.c $(INCL)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001282 $(CC) -c $(CFLAGS) auto/if_perl.c -o $@
Bram Moolenaara16bc542018-10-14 16:25:10 +02001283
1284
Bram Moolenaarf5f4b6c2019-12-14 13:17:11 +01001285$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL) version.h
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001286ifeq (16, $(RUBY))
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001287 $(CC) $(CFLAGS) -U_WIN32 -c -o $@ if_ruby.c
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001288endif
1289
Bram Moolenaar97ff9b92016-06-26 20:37:46 +02001290$(OUTDIR)/iscygpty.o: iscygpty.c $(CUI_INCL)
Bram Moolenaar2bc127f2016-07-10 13:57:40 +02001291 $(CC) -c $(CFLAGS) iscygpty.c -o $(OUTDIR)/iscygpty.o -U_WIN32_WINNT -D_WIN32_WINNT=0x0600 -DUSE_DYNFILEID -DENABLE_STUB_IMPL
Bram Moolenaar97ff9b92016-06-26 20:37:46 +02001292
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001293$(OUTDIR)/main.o: main.c $(INCL) $(CUI_INCL)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001294 $(CC) -c $(CFLAGS) main.c -o $@
Bram Moolenaar97ff9b92016-06-26 20:37:46 +02001295
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001296$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001297 $(CC) -c $(CFLAGS) netbeans.c -o $@
1298
1299$(OUTDIR)/os_w32exec.o: os_w32exe.c $(INCL)
1300 $(CC) -c $(CFLAGS) -UFEAT_GUI_MSWIN os_w32exe.c -o $@
1301
1302$(OUTDIR)/os_w32exeg.o: os_w32exe.c $(INCL)
1303 $(CC) -c $(CFLAGS) os_w32exe.c -o $@
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001304
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001305$(OUTDIR)/os_win32.o: os_win32.c $(INCL) $(MZSCHEME_INCL)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001306 $(CC) -c $(CFLAGS) os_win32.c -o $@
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001307
Bram Moolenaar6d7d7cf2019-09-07 23:16:33 +02001308$(OUTDIR)/regexp.o: regexp.c regexp_bt.c regexp_nfa.c $(INCL)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001309 $(CC) -c $(CFLAGS) regexp.c -o $@
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001310
Bram Moolenaar4aea03e2019-09-25 22:37:17 +02001311$(OUTDIR)/register.o: register.c $(INCL)
1312 $(CC) -c $(CFLAGS) register.c -o $@
1313
Bram Moolenaarf80451e2017-07-25 21:49:35 +02001314$(OUTDIR)/terminal.o: terminal.c $(INCL) $(TERM_DEPS)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001315 $(CC) -c $(CFLAGS) terminal.c -o $@
Bram Moolenaar98aefe72018-12-13 22:20:09 +01001316
Bram Moolenaardfc14552019-06-21 17:36:10 +02001317$(OUTDIR)/pathdef.o: $(PATHDEF_SRC) $(INCL)
1318 $(CC) -c $(CFLAGS) $(PATHDEF_SRC) -o $@
1319
Bram Moolenaarf80451e2017-07-25 21:49:35 +02001320
Bram Moolenaar6d0826d2017-08-22 22:12:17 +02001321CCCTERM = $(CC) -c $(CFLAGS) -Ilibvterm/include -DINLINE="" \
1322 -DVSNPRINTF=vim_vsnprintf \
Bram Moolenaarc4c9f7e2020-05-17 20:52:45 +02001323 -DSNPRINTF=vim_snprintf \
Bram Moolenaar6d0826d2017-08-22 22:12:17 +02001324 -DIS_COMBINING_FUNCTION=utf_iscomposing_uint \
Bram Moolenaar57da6982019-09-13 22:30:11 +02001325 -DWCWIDTH_FUNCTION=utf_uint2cells \
1326 -DGET_SPECIAL_PTY_TYPE_FUNCTION=get_special_pty_type
Bram Moolenaar6d0826d2017-08-22 22:12:17 +02001327
Bram Moolenaar93268052019-10-10 13:22:54 +02001328$(OUTDIR)/vterm_%.o : libvterm/src/%.c $(TERM_DEPS)
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001329 $(CCCTERM) $< -o $@
Bram Moolenaarf80451e2017-07-25 21:49:35 +02001330
Bram Moolenaarf80451e2017-07-25 21:49:35 +02001331
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001332$(OUTDIR)/%.o : xdiff/%.c $(XDIFF_DEPS)
1333 $(CC) -c $(CFLAGS) $< -o $@
Bram Moolenaarf80451e2017-07-25 21:49:35 +02001334
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001335
Bram Moolenaarc4390fe2020-11-16 18:49:47 +01001336$(PATHDEF_SRC): Make_cyg_ming.mak Make_cyg.mak Make_ming.mak | $(OUTDIR)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001337ifneq (sh.exe, $(SHELL))
Bram Moolenaardfc14552019-06-21 17:36:10 +02001338 @echo creating $(PATHDEF_SRC)
1339 @echo '/* pathdef.c */' > $(PATHDEF_SRC)
1340 @echo '#include "vim.h"' >> $(PATHDEF_SRC)
1341 @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> $(PATHDEF_SRC)
1342 @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> $(PATHDEF_SRC)
1343 @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> $(PATHDEF_SRC)
1344 @echo 'char_u *all_lflags = (char_u *)"$(LINK) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)";' >> $(PATHDEF_SRC)
1345 @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> $(PATHDEF_SRC)
1346 @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> $(PATHDEF_SRC)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001347else
Bram Moolenaardfc14552019-06-21 17:36:10 +02001348 @echo creating $(PATHDEF_SRC)
1349 @echo /* pathdef.c */ > $(PATHDEF_SRC)
1350 @echo #include "vim.h" >> $(PATHDEF_SRC)
1351 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> $(PATHDEF_SRC)
1352 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> $(PATHDEF_SRC)
1353 @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> $(PATHDEF_SRC)
1354 @echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> $(PATHDEF_SRC)
1355 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
1356 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
Bram Moolenaar4f7e8212014-11-05 13:53:32 +01001357endif
Bram Moolenaar96e7a6e2017-09-23 19:48:29 +02001358
1359# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: