6326
|
1 # 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:
|
|
23 # http://upx.sourceforge.net/
|
|
24 # "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:
|
|
31 # set to yes for a debug build
|
|
32 DEBUG=no
|
|
33 # set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
|
|
34 OPTIMIZE=MAXSPEED
|
|
35 # set to yes to make gvim, no for vim
|
|
36 GUI=yes
|
|
37 # set to yes if you want to use DirectWrite (DirectX)
|
|
38 # MinGW-w64 is needed, and ARCH should be set to i686 or x86-64.
|
|
39 DIRECTX=no
|
|
40 # FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
|
|
41 # Set to TINY to make minimal version (few features).
|
|
42 FEATURES=BIG
|
|
43 # Set to one of i386, i486, i586, i686 as the minimum target processor.
|
|
44 # For amd64/x64 architecture set ARCH=x86-64 .
|
|
45 ARCH=i386
|
|
46 # Set to yes to cross-compile from unix; no=native Windows (and Cygwin).
|
|
47 CROSS=no
|
|
48 # Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
|
|
49 #ICONV="."
|
|
50 ICONV=yes
|
|
51 GETTEXT=yes
|
|
52 # Set to yes to include multibyte support.
|
|
53 MBYTE=yes
|
|
54 # Set to yes to include IME support.
|
|
55 IME=yes
|
|
56 DYNAMIC_IME=yes
|
|
57 # Set to yes to enable writing a postscript file with :hardcopy.
|
|
58 POSTSCRIPT=no
|
|
59 # Set to yes to enable OLE support.
|
|
60 OLE=no
|
|
61 # Set the default $(WINVER) to make it work with pre-Win2k.
|
|
62 ifndef WINVER
|
|
63 WINVER = 0x0500
|
|
64 endif
|
|
65 # Set to yes to enable Cscope support.
|
|
66 CSCOPE=yes
|
|
67 # Set to yes to enable Netbeans support.
|
|
68 NETBEANS=$(GUI)
|
|
69
|
|
70
|
|
71 # Link against the shared version of libstdc++ by default. Set
|
|
72 # STATIC_STDCPLUS to "yes" to link against static version instead.
|
|
73 ifndef STATIC_STDCPLUS
|
|
74 STATIC_STDCPLUS=no
|
|
75 endif
|
|
76
|
|
77 # If the user doesn't want gettext, undefine it.
|
|
78 ifeq (no, $(GETTEXT))
|
|
79 GETTEXT=
|
|
80 endif
|
|
81 # Added by E.F. Amatria <eferna1@platea.ptic.mec.es> 2001 Feb 23
|
|
82 # Uncomment the first line and one of the following three if you want Native Language
|
|
83 # Support. You'll need gnu_gettext.win32, a MINGW32 Windows PORT of gettext by
|
|
84 # Franco Bez <franco.bez@gmx.de>. It may be found at
|
|
85 # http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
|
|
86 # Tested with mingw32 with GCC-2.95.2 on Win98
|
|
87 # Updated 2001 Jun 9
|
|
88 #GETTEXT=c:/gettext.win32.msvcrt
|
|
89 #STATIC_GETTEXT=USE_STATIC_GETTEXT
|
|
90 #DYNAMIC_GETTEXT=USE_GETTEXT_DLL
|
|
91 #DYNAMIC_GETTEXT=USE_SAFE_GETTEXT_DLL
|
|
92 SAFE_GETTEXT_DLL_OBJ = $(GETTEXT)/src/safe_gettext_dll/safe_gettext_dll.o
|
|
93 # Alternatively, if you uncomment the two following lines, you get a "safe" version
|
|
94 # without linking the safe_gettext_dll.o object file.
|
|
95 #DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
|
|
96 #GETTEXT_DYNAMIC=gnu_gettext.dll
|
|
97 INTLPATH=$(GETTEXT)/lib/mingw32
|
|
98 INTLLIB=gnu_gettext
|
|
99
|
|
100 # If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext
|
|
101 # or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/
|
|
102 # uncomment the following, but I can't build a static version with them, ?-(|
|
|
103 #GETTEXT=c:/gettext-0.10.37-20010430
|
|
104 #STATIC_GETTEXT=USE_STATIC_GETTEXT
|
|
105 #DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
|
|
106 #INTLPATH=$(GETTEXT)/lib
|
|
107 #INTLLIB=intl
|
|
108
|
|
109 # Perl interface:
|
|
110 # PERL=[Path to Perl directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
|
111 # DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
|
|
112 # PERL_VER=[Perl version, eg 56, 58, 510] (default is 56)
|
|
113 ifdef PERL
|
|
114 ifndef PERL_VER
|
|
115 PERL_VER=56
|
|
116 endif
|
|
117 ifndef DYNAMIC_PERL
|
|
118 DYNAMIC_PERL=yes
|
|
119 endif
|
|
120 # on Linux, for cross-compile, it's here:
|
|
121 #PERLLIB=/home/ron/ActivePerl/lib
|
|
122 # on NT, it's here:
|
|
123 PERLEXE=$(PERL)/bin/perl
|
|
124 PERLLIB=$(PERL)/lib
|
|
125 PERLLIBS=$(PERLLIB)/Core
|
|
126 ifeq ($(UNDER_CYGWIN),yes)
|
|
127 PERLTYPEMAP:=$(shell cygpath -m $(PERLLIB)/ExtUtils/typemap)
|
|
128 XSUBPPTRY:=$(shell cygpath -m $(PERLLIB)/ExtUtils/xsubpp)
|
|
129 else
|
|
130 PERLTYPEMAP=$(PERLLIB)/ExtUtils/typemap
|
|
131 XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp
|
|
132 endif
|
|
133 XSUBPP_EXISTS=$(shell $(PERLEXE) -e "print 1 unless -e '$(XSUBPPTRY)'")
|
|
134 ifeq "$(XSUBPP_EXISTS)" ""
|
6349
|
135 XSUBPP=$(PERLEXE) $(XSUBPPTRY)
|
6326
|
136 else
|
|
137 XSUBPP=xsubpp
|
|
138 endif
|
|
139 endif
|
|
140
|
|
141 # Lua interface:
|
|
142 # LUA=[Path to Lua directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
|
143 # DYNAMIC_LUA=yes (to load the Lua DLL dynamically)
|
|
144 # LUA_VER=[Lua version, eg 51, 52] (default is 51)
|
|
145 ifdef LUA
|
|
146 ifndef DYNAMIC_LUA
|
|
147 DYNAMIC_LUA=yes
|
|
148 endif
|
|
149
|
|
150 ifndef LUA_VER
|
|
151 LUA_VER=51
|
|
152 endif
|
|
153
|
|
154 ifeq (no,$(DYNAMIC_LUA))
|
|
155 LUA_LIB = -L$(LUA)/lib -llua
|
|
156 endif
|
|
157
|
|
158 endif
|
|
159
|
|
160 # MzScheme interface:
|
|
161 # MZSCHEME=[Path to MzScheme directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
|
162 # DYNAMIC_MZSCHEME=yes (to load the MzScheme DLL dynamically)
|
|
163 # MZSCHEME_VER=[MzScheme version] (default is 205_000)
|
|
164 # MZSCHEME_DEBUG=no
|
|
165 ifdef MZSCHEME
|
|
166 ifndef DYNAMIC_MZSCHEME
|
|
167 DYNAMIC_MZSCHEME=yes
|
|
168 endif
|
|
169
|
|
170 ifndef MZSCHEME_VER
|
|
171 MZSCHEME_VER=205_000
|
|
172 endif
|
|
173
|
|
174 ifndef MZSCHEME_PRECISE_GC
|
|
175 MZSCHEME_PRECISE_GC=no
|
|
176 endif
|
|
177
|
|
178 # for version 4.x we need to generate byte-code for Scheme base
|
|
179 ifndef MZSCHEME_GENERATE_BASE
|
|
180 MZSCHEME_GENERATE_BASE=no
|
|
181 endif
|
|
182
|
|
183 ifndef MZSCHEME_USE_RACKET
|
|
184 MZSCHEME_MAIN_LIB=mzsch
|
|
185 else
|
|
186 MZSCHEME_MAIN_LIB=racket
|
|
187 endif
|
|
188
|
|
189 ifeq (no,$(DYNAMIC_MZSCHEME))
|
|
190 ifeq (yes,$(MZSCHEME_PRECISE_GC))
|
|
191 MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
|
|
192 else
|
|
193 MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
|
|
194 endif
|
|
195 # the modern MinGW can dynamically link to dlls directly.
|
|
196 # point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
|
|
197 ifndef MZSCHEME_DLLS
|
|
198 MZSCHEME_DLLS=$(MZSCHEME)
|
|
199 endif
|
|
200 MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib
|
|
201 endif
|
|
202
|
|
203 endif
|
|
204
|
|
205 # Python interface:
|
|
206 # PYTHON=[Path to Python directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
|
207 # DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
|
|
208 # PYTHON_VER=[Python version, eg 22, 23, ..., 27] (default is 22)
|
|
209 ifdef PYTHON
|
|
210 ifndef DYNAMIC_PYTHON
|
|
211 DYNAMIC_PYTHON=yes
|
|
212 endif
|
|
213
|
|
214 ifndef PYTHON_VER
|
|
215 PYTHON_VER=22
|
|
216 endif
|
|
217
|
|
218 ifeq (no,$(DYNAMIC_PYTHON))
|
|
219 PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
|
|
220 endif
|
|
221 # my include files are in 'win32inc' on Linux, and 'include' in the standard
|
|
222 # NT distro (ActiveState)
|
|
223 ifeq ($(CROSS),no)
|
|
224 PYTHONINC=-I $(PYTHON)/include
|
|
225 else
|
|
226 PYTHONINC=-I $(PYTHON)/win32inc
|
|
227 endif
|
|
228 endif
|
|
229
|
|
230 # Python3 interface:
|
|
231 # PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
|
232 # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
|
|
233 # PYTHON3_VER=[Python3 version, eg 31, 32] (default is 31)
|
|
234 ifdef PYTHON3
|
|
235 ifndef DYNAMIC_PYTHON3
|
|
236 DYNAMIC_PYTHON3=yes
|
|
237 endif
|
|
238
|
|
239 ifndef PYTHON3_VER
|
|
240 PYTHON3_VER=31
|
|
241 endif
|
|
242
|
|
243 ifeq (no,$(DYNAMIC_PYTHON3))
|
|
244 PYTHON3LIB=-L$(PYTHON3)/libs -lPYTHON$(PYTHON3_VER)
|
|
245 endif
|
|
246
|
|
247 ifeq ($(CROSS),no)
|
|
248 PYTHON3INC=-I $(PYTHON3)/include
|
|
249 else
|
|
250 PYTHON3INC=-I $(PYTHON3)/win32inc
|
|
251 endif
|
|
252 endif
|
|
253
|
|
254 # TCL interface:
|
|
255 # TCL=[Path to TCL directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
|
256 # DYNAMIC_TCL=yes (to load the TCL DLL dynamically)
|
|
257 # TCL_VER=[TCL version, eg 83, 84] (default is 83)
|
|
258 ifdef TCL
|
|
259 ifndef DYNAMIC_TCL
|
|
260 DYNAMIC_TCL=yes
|
|
261 endif
|
|
262 ifndef TCL_VER
|
|
263 TCL_VER = 83
|
|
264 endif
|
|
265 TCLINC += -I$(TCL)/include
|
|
266 endif
|
|
267
|
|
268
|
|
269 # Ruby interface:
|
|
270 # RUBY=[Path to Ruby directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
|
271 # DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
|
|
272 # RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18)
|
|
273 # RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8)
|
|
274 # You must set RUBY_VER_LONG when changing RUBY_VER.
|
|
275 # RUBY_API_VER is derived from RUBY_VER_LONG.
|
|
276 # Note: If you use Ruby 1.9.3, set as follows:
|
|
277 # RUBY_VER=19
|
|
278 # RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
|
|
279 ifdef RUBY
|
|
280 ifndef DYNAMIC_RUBY
|
|
281 DYNAMIC_RUBY=yes
|
|
282 endif
|
|
283 # Set default value
|
|
284 ifndef RUBY_VER
|
|
285 RUBY_VER = 18
|
|
286 endif
|
|
287 ifndef RUBY_VER_LONG
|
|
288 RUBY_VER_LONG = 1.8
|
|
289 endif
|
|
290 ifndef RUBY_API_VER
|
|
291 RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG))
|
|
292 endif
|
|
293
|
|
294 ifndef RUBY_PLATFORM
|
|
295 ifeq ($(RUBY_VER), 16)
|
|
296 RUBY_PLATFORM = i586-mswin32
|
|
297 else
|
|
298 ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),)
|
|
299 RUBY_PLATFORM = i386-mingw32
|
|
300 else
|
|
301 ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),)
|
|
302 RUBY_PLATFORM = x64-mingw32
|
|
303 else
|
|
304 RUBY_PLATFORM = i386-mswin32
|
|
305 endif
|
|
306 endif
|
|
307 endif
|
|
308 endif
|
|
309
|
|
310 ifndef RUBY_INSTALL_NAME
|
|
311 ifeq ($(RUBY_VER), 16)
|
|
312 RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
|
|
313 else
|
|
314 ifeq ($(ARCH),x86-64)
|
|
315 RUBY_INSTALL_NAME = x64-msvcrt-ruby$(RUBY_API_VER)
|
|
316 else
|
|
317 RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
|
|
318 endif
|
|
319 endif
|
|
320 endif
|
|
321
|
|
322 ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
|
|
323 RUBY_19_OR_LATER = 1
|
|
324 endif
|
|
325
|
|
326 RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
|
|
327 ifdef RUBY_19_OR_LATER
|
|
328 RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
|
|
329 endif
|
|
330 ifeq (no, $(DYNAMIC_RUBY))
|
|
331 RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
|
|
332 endif
|
|
333
|
|
334 endif # RUBY
|
|
335
|
|
336 # See feature.h for a list of options.
|
|
337 # Any other defines can be included here.
|
|
338 DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
|
|
339 DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
|
|
340 -DHAVE_PATHDEF -DFEAT_$(FEATURES)
|
|
341 ifeq ($(ARCH),x86-64)
|
|
342 DEFINES+=-DMS_WIN64
|
|
343 endif
|
|
344 ifeq ($(CROSS),yes)
|
|
345 # cross-compiler prefix:
|
|
346 ifndef CROSS_COMPILE
|
|
347 CROSS_COMPILE = i586-pc-mingw32msvc-
|
|
348 endif
|
|
349 DEL = rm
|
|
350 MKDIR = mkdir -p
|
|
351 DIRSLASH = /
|
|
352 else
|
|
353 # normal (Windows) compilation:
|
|
354 ifndef CROSS_COMPILE
|
|
355 CROSS_COMPILE =
|
|
356 endif
|
|
357 ifneq (sh.exe, $(SHELL))
|
|
358 DEL = rm
|
|
359 MKDIR = mkdir -p
|
|
360 DIRSLASH = /
|
|
361 else
|
|
362 DEL = del
|
|
363 MKDIR = mkdir
|
|
364 DIRSLASH = \\
|
|
365 endif
|
|
366 endif
|
|
367 CC := $(CROSS_COMPILE)gcc
|
|
368 CXX := $(CROSS_COMPILE)g++
|
6436
|
369 ifeq ($(UNDER_CYGWIN),yes)
|
6326
|
370 WINDRES := $(CROSS_COMPILE)windres
|
6436
|
371 else
|
|
372 WINDRES := windres
|
|
373 endif
|
6326
|
374 WINDRES_CC = $(CC)
|
|
375
|
|
376 #>>>>> end of choices
|
|
377 ###########################################################################
|
|
378
|
|
379 CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
|
|
380 WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
|
|
381 EXTRA_LIBS =
|
|
382
|
|
383 ifdef GETTEXT
|
|
384 DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
|
|
385 GETTEXTINCLUDE = $(GETTEXT)/include
|
|
386 GETTEXTLIB = $(INTLPATH)
|
|
387 ifeq (yes, $(GETTEXT))
|
|
388 DEFINES += -DDYNAMIC_GETTEXT
|
|
389 else
|
|
390 ifdef DYNAMIC_GETTEXT
|
|
391 DEFINES += -D$(DYNAMIC_GETTEXT)
|
|
392 ifdef GETTEXT_DYNAMIC
|
|
393 DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
|
|
394 endif
|
|
395 endif
|
|
396 endif
|
|
397 endif
|
|
398
|
|
399 ifdef PERL
|
6872
|
400 CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
|
6326
|
401 ifeq (yes, $(DYNAMIC_PERL))
|
|
402 CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
|
|
403 EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
|
|
404 endif
|
|
405 endif
|
|
406
|
|
407 ifdef LUA
|
|
408 CFLAGS += -I$(LUA)/include -I$(LUA) -DFEAT_LUA
|
|
409 ifeq (yes, $(DYNAMIC_LUA))
|
|
410 CFLAGS += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
|
|
411 endif
|
|
412 endif
|
|
413
|
|
414 ifdef MZSCHEME
|
|
415 CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\"
|
|
416 ifeq (yes, $(DYNAMIC_MZSCHEME))
|
|
417 CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
|
|
418 endif
|
|
419 ifeq (yes, "$(MZSCHEME_DEBUG)")
|
|
420 CFLAGS += -DMZSCHEME_FORCE_GC
|
|
421 endif
|
|
422 endif
|
|
423
|
|
424 ifdef RUBY
|
|
425 CFLAGS += -DFEAT_RUBY $(RUBYINC)
|
|
426 ifeq (yes, $(DYNAMIC_RUBY))
|
|
427 CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
|
|
428 CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
|
|
429 endif
|
|
430 ifneq ($(findstring w64-mingw32,$(CC)),)
|
|
431 # A workaround for MinGW-w64
|
|
432 CFLAGS += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE
|
|
433 endif
|
|
434 endif
|
|
435
|
|
436 ifdef PYTHON
|
|
437 CFLAGS += -DFEAT_PYTHON
|
|
438 ifeq (yes, $(DYNAMIC_PYTHON))
|
|
439 CFLAGS += -DDYNAMIC_PYTHON
|
|
440 endif
|
|
441 endif
|
|
442
|
|
443 ifdef PYTHON3
|
|
444 CFLAGS += -DFEAT_PYTHON3
|
|
445 ifeq (yes, $(DYNAMIC_PYTHON3))
|
|
446 CFLAGS += -DDYNAMIC_PYTHON3
|
|
447 endif
|
|
448 endif
|
|
449
|
|
450 ifdef TCL
|
|
451 CFLAGS += -DFEAT_TCL $(TCLINC)
|
|
452 ifeq (yes, $(DYNAMIC_TCL))
|
|
453 CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
|
|
454 endif
|
|
455 endif
|
|
456
|
|
457 ifeq ($(POSTSCRIPT),yes)
|
|
458 DEFINES += -DMSWINPS
|
|
459 endif
|
|
460
|
|
461 ifeq (yes, $(OLE))
|
|
462 DEFINES += -DFEAT_OLE
|
|
463 endif
|
|
464
|
|
465 ifeq ($(CSCOPE),yes)
|
|
466 DEFINES += -DFEAT_CSCOPE
|
|
467 endif
|
|
468
|
|
469 ifeq ($(NETBEANS),yes)
|
|
470 # Only allow NETBEANS for a GUI build.
|
|
471 ifeq (yes, $(GUI))
|
|
472 DEFINES += -DFEAT_NETBEANS_INTG
|
|
473
|
|
474 ifeq ($(NBDEBUG), yes)
|
|
475 DEFINES += -DNBDEBUG
|
|
476 NBDEBUG_INCL = nbdebug.h
|
|
477 NBDEBUG_SRC = nbdebug.c
|
|
478 endif
|
|
479 endif
|
|
480 endif
|
|
481
|
|
482 # DirectWrite (DirectX)
|
|
483 ifeq ($(DIRECTX),yes)
|
|
484 # Only allow DirectWrite for a GUI build.
|
|
485 ifeq (yes, $(GUI))
|
|
486 DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
|
|
487 endif
|
|
488 endif
|
|
489
|
|
490 # Only allow XPM for a GUI build.
|
|
491 ifeq (yes, $(GUI))
|
|
492
|
|
493 ifndef XPM
|
|
494 ifeq ($(ARCH),i386)
|
|
495 XPM = xpm/x86
|
|
496 endif
|
|
497 ifeq ($(ARCH),i486)
|
|
498 XPM = xpm/x86
|
|
499 endif
|
|
500 ifeq ($(ARCH),i586)
|
|
501 XPM = xpm/x86
|
|
502 endif
|
|
503 ifeq ($(ARCH),i686)
|
|
504 XPM = xpm/x86
|
|
505 endif
|
|
506 ifeq ($(ARCH),x86-64)
|
|
507 XPM = xpm/x64
|
|
508 endif
|
|
509 endif
|
|
510 ifdef XPM
|
|
511 ifneq ($(XPM),no)
|
|
512 CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include
|
|
513 endif
|
|
514 endif
|
|
515
|
|
516 endif
|
|
517
|
|
518 ifeq ($(DEBUG),yes)
|
|
519 CFLAGS += -g -fstack-check
|
|
520 DEBUG_SUFFIX=d
|
|
521 else
|
|
522 ifeq ($(OPTIMIZE), SIZE)
|
|
523 CFLAGS += -Os
|
|
524 else
|
|
525 ifeq ($(OPTIMIZE), MAXSPEED)
|
|
526 CFLAGS += -O3
|
|
527 CFLAGS += -fomit-frame-pointer -freg-struct-return
|
|
528 else # SPEED
|
|
529 CFLAGS += -O2
|
|
530 endif
|
|
531 endif
|
|
532 CFLAGS += -s
|
|
533 endif
|
|
534
|
|
535 LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion
|
|
536 GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o
|
|
537 OBJ = \
|
|
538 $(OUTDIR)/blowfish.o \
|
|
539 $(OUTDIR)/buffer.o \
|
|
540 $(OUTDIR)/charset.o \
|
|
541 $(OUTDIR)/crypt.o \
|
|
542 $(OUTDIR)/crypt_zip.o \
|
|
543 $(OUTDIR)/diff.o \
|
|
544 $(OUTDIR)/digraph.o \
|
|
545 $(OUTDIR)/edit.o \
|
|
546 $(OUTDIR)/eval.o \
|
|
547 $(OUTDIR)/ex_cmds.o \
|
|
548 $(OUTDIR)/ex_cmds2.o \
|
|
549 $(OUTDIR)/ex_docmd.o \
|
|
550 $(OUTDIR)/ex_eval.o \
|
|
551 $(OUTDIR)/ex_getln.o \
|
|
552 $(OUTDIR)/fileio.o \
|
|
553 $(OUTDIR)/fold.o \
|
|
554 $(OUTDIR)/getchar.o \
|
|
555 $(OUTDIR)/hardcopy.o \
|
|
556 $(OUTDIR)/hashtab.o \
|
|
557 $(OUTDIR)/main.o \
|
|
558 $(OUTDIR)/mark.o \
|
|
559 $(OUTDIR)/memfile.o \
|
|
560 $(OUTDIR)/memline.o \
|
|
561 $(OUTDIR)/menu.o \
|
|
562 $(OUTDIR)/message.o \
|
|
563 $(OUTDIR)/misc1.o \
|
|
564 $(OUTDIR)/misc2.o \
|
|
565 $(OUTDIR)/move.o \
|
|
566 $(OUTDIR)/mbyte.o \
|
|
567 $(OUTDIR)/normal.o \
|
|
568 $(OUTDIR)/ops.o \
|
|
569 $(OUTDIR)/option.o \
|
|
570 $(OUTDIR)/os_win32.o \
|
|
571 $(OUTDIR)/os_mswin.o \
|
|
572 $(OUTDIR)/winclip.o \
|
|
573 $(OUTDIR)/pathdef.o \
|
|
574 $(OUTDIR)/popupmnu.o \
|
|
575 $(OUTDIR)/quickfix.o \
|
|
576 $(OUTDIR)/regexp.o \
|
|
577 $(OUTDIR)/screen.o \
|
|
578 $(OUTDIR)/search.o \
|
|
579 $(OUTDIR)/sha256.o \
|
|
580 $(OUTDIR)/spell.o \
|
|
581 $(OUTDIR)/syntax.o \
|
|
582 $(OUTDIR)/tag.o \
|
|
583 $(OUTDIR)/term.o \
|
|
584 $(OUTDIR)/ui.o \
|
|
585 $(OUTDIR)/undo.o \
|
|
586 $(OUTDIR)/version.o \
|
|
587 $(OUTDIR)/vimrc.o \
|
|
588 $(OUTDIR)/window.o
|
|
589
|
|
590 ifdef PERL
|
|
591 OBJ += $(OUTDIR)/if_perl.o
|
|
592 endif
|
|
593 ifdef LUA
|
|
594 OBJ += $(OUTDIR)/if_lua.o
|
|
595 endif
|
|
596 ifdef MZSCHEME
|
|
597 OBJ += $(OUTDIR)/if_mzsch.o
|
|
598 MZSCHEME_INCL = if_mzsch.h
|
|
599 ifeq (yes,$(MZSCHEME_GENERATE_BASE))
|
|
600 CFLAGS += -DINCLUDE_MZSCHEME_BASE
|
|
601 MZ_EXTRA_DEP += mzscheme_base.c
|
|
602 endif
|
|
603 ifeq (yes,$(MZSCHEME_PRECISE_GC))
|
|
604 CFLAGS += -DMZ_PRECISE_GC
|
|
605 endif
|
|
606 endif
|
|
607 ifdef PYTHON
|
|
608 OBJ += $(OUTDIR)/if_python.o
|
|
609 endif
|
|
610 ifdef PYTHON3
|
|
611 OBJ += $(OUTDIR)/if_python3.o
|
|
612 endif
|
|
613 ifdef RUBY
|
|
614 OBJ += $(OUTDIR)/if_ruby.o
|
|
615 endif
|
|
616 ifdef TCL
|
|
617 OBJ += $(OUTDIR)/if_tcl.o
|
|
618 endif
|
|
619 ifeq ($(CSCOPE),yes)
|
|
620 OBJ += $(OUTDIR)/if_cscope.o
|
|
621 endif
|
|
622 ifeq ($(NETBEANS),yes)
|
|
623 # Only allow NETBEANS for a GUI build.
|
|
624 ifeq (yes, $(GUI))
|
|
625 OBJ += $(OUTDIR)/netbeans.o
|
|
626 LIB += -lwsock32
|
|
627 endif
|
|
628 endif
|
|
629 ifeq ($(DIRECTX),yes)
|
|
630 # Only allow DIRECTX for a GUI build.
|
|
631 ifeq (yes, $(GUI))
|
|
632 OBJ += $(OUTDIR)/gui_dwrite.o
|
|
633 LIB += -ld2d1 -ldwrite
|
|
634 USE_STDCPLUS = yes
|
|
635 endif
|
|
636 endif
|
|
637 ifneq ($(XPM),no)
|
|
638 # Only allow XPM for a GUI build.
|
|
639 ifeq (yes, $(GUI))
|
|
640 OBJ += $(OUTDIR)/xpm_w32.o
|
|
641 # You'll need libXpm.a from http://gnuwin32.sf.net
|
|
642 LIB += -L$(XPM)/lib -lXpm
|
|
643 endif
|
|
644 endif
|
|
645
|
|
646
|
|
647 ifdef MZSCHEME
|
|
648 MZSCHEME_SUFFIX = Z
|
|
649 endif
|
|
650
|
|
651 ifeq ($(GUI),yes)
|
|
652 TARGET := gvim$(DEBUG_SUFFIX).exe
|
|
653 DEFINES += $(DEF_GUI)
|
|
654 OBJ += $(GUIOBJ)
|
|
655 LFLAGS += -mwindows
|
|
656 OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
|
|
657 else
|
|
658 TARGET := vim$(DEBUG_SUFFIX).exe
|
|
659 OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
|
|
660 endif
|
|
661
|
|
662 ifdef GETTEXT
|
|
663 ifneq (yes, $(GETTEXT))
|
|
664 CFLAGS += -I$(GETTEXTINCLUDE)
|
|
665 ifndef STATIC_GETTEXT
|
|
666 LIB += -L$(GETTEXTLIB) -l$(INTLLIB)
|
|
667 ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT))
|
|
668 OBJ+=$(SAFE_GETTEXT_DLL_OBJ)
|
|
669 endif
|
|
670 else
|
|
671 LIB += -L$(GETTEXTLIB) -lintl
|
|
672 endif
|
|
673 endif
|
|
674 endif
|
|
675
|
|
676 ifdef PERL
|
|
677 ifeq (no, $(DYNAMIC_PERL))
|
|
678 LIB += -L$(PERLLIBS) -lperl$(PERL_VER)
|
|
679 endif
|
|
680 endif
|
|
681
|
|
682 ifdef TCL
|
|
683 LIB += -L$(TCL)/lib
|
|
684 ifeq (yes, $(DYNAMIC_TCL))
|
|
685 LIB += -ltclstub$(TCL_VER)
|
|
686 else
|
|
687 LIB += -ltcl$(TCL_VER)
|
|
688 endif
|
|
689 endif
|
|
690
|
|
691 ifeq (yes, $(OLE))
|
|
692 LIB += -loleaut32
|
|
693 OBJ += $(OUTDIR)/if_ole.o
|
|
694 USE_STDCPLUS = yes
|
|
695 endif
|
|
696
|
|
697 ifeq (yes, $(MBYTE))
|
|
698 DEFINES += -DFEAT_MBYTE
|
|
699 endif
|
|
700
|
|
701 ifeq (yes, $(IME))
|
|
702 DEFINES += -DFEAT_MBYTE_IME
|
|
703 ifeq (yes, $(DYNAMIC_IME))
|
|
704 DEFINES += -DDYNAMIC_IME
|
|
705 else
|
|
706 LIB += -limm32
|
|
707 endif
|
|
708 endif
|
|
709
|
|
710 ifdef ICONV
|
|
711 ifneq (yes, $(ICONV))
|
|
712 LIB += -L$(ICONV)
|
|
713 CFLAGS += -I$(ICONV)
|
|
714 endif
|
|
715 DEFINES+=-DDYNAMIC_ICONV
|
|
716 endif
|
|
717
|
|
718 ifeq (yes, $(USE_STDCPLUS))
|
|
719 ifeq (yes, $(STATIC_STDCPLUS))
|
|
720 LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
|
|
721 else
|
|
722 LIB += -lstdc++
|
|
723 endif
|
|
724 endif
|
|
725
|
|
726 all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
|
|
727
|
|
728 vimrun.exe: vimrun.c
|
|
729 $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB)
|
|
730
|
|
731 install.exe: dosinst.c
|
|
732 $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
|
|
733
|
|
734 uninstal.exe: uninstal.c
|
|
735 $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
|
|
736
|
|
737 $(TARGET): $(OUTDIR) $(OBJ)
|
|
738 $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
|
|
739
|
|
740 upx: exes
|
|
741 upx gvim.exe
|
|
742 upx vim.exe
|
|
743
|
|
744 mpress: exes
|
|
745 mpress gvim.exe
|
|
746 mpress vim.exe
|
|
747
|
|
748 xxd/xxd.exe: xxd/xxd.c
|
|
749 $(MAKE) -C xxd -f Make_ming.mak CC='$(CC)'
|
|
750
|
|
751 GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
|
|
752 $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS)
|
|
753
|
|
754 clean:
|
|
755 -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
|
|
756 -$(DEL) $(OUTDIR)$(DIRSLASH)*.res
|
|
757 -rmdir $(OUTDIR)
|
|
758 -$(DEL) *.exe
|
|
759 -$(DEL) pathdef.c
|
|
760 ifdef PERL
|
|
761 -$(DEL) if_perl.c
|
|
762 endif
|
|
763 ifdef MZSCHEME
|
|
764 -$(DEL) mzscheme_base.c
|
|
765 endif
|
|
766 $(MAKE) -C GvimExt -f Make_ming.mak clean
|
|
767 $(MAKE) -C xxd -f Make_ming.mak clean
|
|
768
|
|
769 ###########################################################################
|
|
770 INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
|
|
771 structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \
|
|
772 gui.h
|
|
773
|
|
774 $(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
|
|
775 $(CC) -c $(CFLAGS) $(PYTHONINC) -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\" $< -o $@
|
|
776
|
|
777 $(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
|
|
778 $(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@
|
|
779
|
|
780 $(OUTDIR)/%.o : %.c $(INCL)
|
|
781 $(CC) -c $(CFLAGS) $< -o $@
|
|
782
|
|
783 $(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
|
|
784 $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \
|
|
785 --input-format=rc --output-format=coff -i vim.rc -o $@
|
|
786
|
|
787 $(OUTDIR):
|
|
788 $(MKDIR) $(OUTDIR)
|
|
789
|
|
790 $(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
|
|
791 $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
|
|
792
|
|
793 $(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
|
|
794 $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
|
|
795
|
|
796 $(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL)
|
|
797 $(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
|
|
798
|
|
799 $(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
|
|
800 $(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
|
|
801
|
|
802 $(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
|
|
803 $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
|
|
804
|
|
805 # Remove -D__IID_DEFINED__ for newer versions of the w32api
|
|
806 $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
|
|
807 $(CC) $(CFLAGS) -c -o $(OUTDIR)/if_ole.o if_ole.cpp
|
|
808
|
|
809 $(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
|
|
810 ifeq (16, $(RUBY))
|
|
811 $(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
|
|
812 endif
|
|
813
|
|
814 if_perl.c: if_perl.xs typemap
|
|
815 $(XSUBPP) -prototypes -typemap \
|
6349
|
816 $(PERLTYPEMAP) if_perl.xs > $@
|
6326
|
817
|
|
818 $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
|
|
819 $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
|
|
820
|
|
821 $(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL)
|
|
822 $(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
|
|
823
|
|
824 $(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
|
|
825 $(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
|
|
826
|
|
827 mzscheme_base.c:
|
|
828 $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
|
|
829
|
|
830 pathdef.c: $(INCL)
|
|
831 ifneq (sh.exe, $(SHELL))
|
|
832 @echo creating pathdef.c
|
|
833 @echo '/* pathdef.c */' > pathdef.c
|
|
834 @echo '#include "vim.h"' >> pathdef.c
|
|
835 @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
|
|
836 @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
|
|
837 @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
|
|
838 @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.c
|
|
839 @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
|
|
840 @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
|
|
841 else
|
|
842 @echo creating pathdef.c
|
|
843 @echo /* pathdef.c */ > pathdef.c
|
|
844 @echo #include "vim.h" >> pathdef.c
|
|
845 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
|
|
846 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
|
|
847 @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
|
|
848 @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.c
|
|
849 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
|
|
850 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
|
|
851 endif
|