Mercurial > vim
annotate src/Make_cyg_ming.mak @ 7513:37e061ec063c v7.4.1058
commit https://github.com/vim/vim/commit/75bdf6aa30a5c99d67c42886cf7a4a000bbaa422
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jan 7 21:25:08 2016 +0100
patch 7.4.1058
Problem: It is not possible to test code that is only reached when memory
allocation fails.
Solution: Add the alloc_fail() function. Try it out with :vimgrep.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 07 Jan 2016 21:30:05 +0100 |
parents | 2c5e813e8852 |
children | 665330ac1d78 |
rev | line source |
---|---|
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 | |
7456
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
215 PYTHON_VER=27 |
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
216 endif |
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
217 ifndef DYNAMIC_PYTHON_DLL |
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
218 DYNAMIC_PYTHON_DLL=python$(PYTHON_VER).dll |
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
219 endif |
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
220 ifdef PYTHON_HOME |
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
221 PYTHON_HOME_DEF=-DPYTHON_HOME=\"$(PYTHON_HOME)\" |
6326 | 222 endif |
223 | |
224 ifeq (no,$(DYNAMIC_PYTHON)) | |
225 PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER) | |
226 endif | |
227 # my include files are in 'win32inc' on Linux, and 'include' in the standard | |
228 # NT distro (ActiveState) | |
7456
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
229 ifndef PYTHONINC |
6326 | 230 ifeq ($(CROSS),no) |
231 PYTHONINC=-I $(PYTHON)/include | |
232 else | |
233 PYTHONINC=-I $(PYTHON)/win32inc | |
234 endif | |
235 endif | |
7456
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
236 endif |
6326 | 237 |
238 # Python3 interface: | |
239 # PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak) | |
240 # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically) | |
241 # PYTHON3_VER=[Python3 version, eg 31, 32] (default is 31) | |
242 ifdef PYTHON3 | |
243 ifndef DYNAMIC_PYTHON3 | |
244 DYNAMIC_PYTHON3=yes | |
245 endif | |
246 | |
247 ifndef PYTHON3_VER | |
248 PYTHON3_VER=31 | |
249 endif | |
250 | |
251 ifeq (no,$(DYNAMIC_PYTHON3)) | |
252 PYTHON3LIB=-L$(PYTHON3)/libs -lPYTHON$(PYTHON3_VER) | |
253 endif | |
254 | |
255 ifeq ($(CROSS),no) | |
256 PYTHON3INC=-I $(PYTHON3)/include | |
257 else | |
258 PYTHON3INC=-I $(PYTHON3)/win32inc | |
259 endif | |
260 endif | |
261 | |
262 # TCL interface: | |
263 # TCL=[Path to TCL directory] (Set inside Make_cyg.mak or Make_ming.mak) | |
264 # DYNAMIC_TCL=yes (to load the TCL DLL dynamically) | |
265 # TCL_VER=[TCL version, eg 83, 84] (default is 83) | |
266 ifdef TCL | |
267 ifndef DYNAMIC_TCL | |
268 DYNAMIC_TCL=yes | |
269 endif | |
270 ifndef TCL_VER | |
271 TCL_VER = 83 | |
272 endif | |
273 TCLINC += -I$(TCL)/include | |
274 endif | |
275 | |
276 | |
277 # Ruby interface: | |
278 # RUBY=[Path to Ruby directory] (Set inside Make_cyg.mak or Make_ming.mak) | |
279 # DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically) | |
280 # RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18) | |
281 # RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8) | |
282 # You must set RUBY_VER_LONG when changing RUBY_VER. | |
283 # RUBY_API_VER is derived from RUBY_VER_LONG. | |
284 # Note: If you use Ruby 1.9.3, set as follows: | |
285 # RUBY_VER=19 | |
286 # RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.) | |
287 ifdef RUBY | |
288 ifndef DYNAMIC_RUBY | |
289 DYNAMIC_RUBY=yes | |
290 endif | |
291 # Set default value | |
292 ifndef RUBY_VER | |
293 RUBY_VER = 18 | |
294 endif | |
295 ifndef RUBY_VER_LONG | |
296 RUBY_VER_LONG = 1.8 | |
297 endif | |
298 ifndef RUBY_API_VER | |
299 RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG)) | |
300 endif | |
301 | |
302 ifndef RUBY_PLATFORM | |
303 ifeq ($(RUBY_VER), 16) | |
304 RUBY_PLATFORM = i586-mswin32 | |
305 else | |
306 ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),) | |
307 RUBY_PLATFORM = i386-mingw32 | |
308 else | |
309 ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),) | |
310 RUBY_PLATFORM = x64-mingw32 | |
311 else | |
312 RUBY_PLATFORM = i386-mswin32 | |
313 endif | |
314 endif | |
315 endif | |
316 endif | |
317 | |
318 ifndef RUBY_INSTALL_NAME | |
319 ifeq ($(RUBY_VER), 16) | |
320 RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER) | |
321 else | |
322 ifeq ($(ARCH),x86-64) | |
323 RUBY_INSTALL_NAME = x64-msvcrt-ruby$(RUBY_API_VER) | |
324 else | |
325 RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER) | |
326 endif | |
327 endif | |
328 endif | |
329 | |
330 ifeq (19, $(word 1,$(sort 19 $(RUBY_VER)))) | |
331 RUBY_19_OR_LATER = 1 | |
332 endif | |
333 | |
334 RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM) | |
335 ifdef RUBY_19_OR_LATER | |
336 RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM) | |
337 endif | |
338 ifeq (no, $(DYNAMIC_RUBY)) | |
339 RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME) | |
340 endif | |
341 | |
342 endif # RUBY | |
343 | |
344 # See feature.h for a list of options. | |
345 # Any other defines can be included here. | |
346 DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD | |
347 DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \ | |
348 -DHAVE_PATHDEF -DFEAT_$(FEATURES) | |
349 ifeq ($(ARCH),x86-64) | |
350 DEFINES+=-DMS_WIN64 | |
351 endif | |
352 ifeq ($(CROSS),yes) | |
353 # cross-compiler prefix: | |
354 ifndef CROSS_COMPILE | |
355 CROSS_COMPILE = i586-pc-mingw32msvc- | |
356 endif | |
357 DEL = rm | |
358 MKDIR = mkdir -p | |
359 DIRSLASH = / | |
360 else | |
361 # normal (Windows) compilation: | |
362 ifndef CROSS_COMPILE | |
363 CROSS_COMPILE = | |
364 endif | |
365 ifneq (sh.exe, $(SHELL)) | |
366 DEL = rm | |
367 MKDIR = mkdir -p | |
368 DIRSLASH = / | |
369 else | |
370 DEL = del | |
371 MKDIR = mkdir | |
372 DIRSLASH = \\ | |
373 endif | |
374 endif | |
375 CC := $(CROSS_COMPILE)gcc | |
376 CXX := $(CROSS_COMPILE)g++ | |
6436 | 377 ifeq ($(UNDER_CYGWIN),yes) |
6326 | 378 WINDRES := $(CROSS_COMPILE)windres |
6436 | 379 else |
380 WINDRES := windres | |
381 endif | |
6326 | 382 WINDRES_CC = $(CC) |
383 | |
384 #>>>>> end of choices | |
385 ########################################################################### | |
386 | |
387 CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall | |
388 WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED | |
389 EXTRA_LIBS = | |
390 | |
391 ifdef GETTEXT | |
392 DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H | |
393 GETTEXTINCLUDE = $(GETTEXT)/include | |
394 GETTEXTLIB = $(INTLPATH) | |
395 ifeq (yes, $(GETTEXT)) | |
396 DEFINES += -DDYNAMIC_GETTEXT | |
397 else | |
398 ifdef DYNAMIC_GETTEXT | |
399 DEFINES += -D$(DYNAMIC_GETTEXT) | |
400 ifdef GETTEXT_DYNAMIC | |
401 DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\" | |
402 endif | |
403 endif | |
404 endif | |
405 endif | |
406 | |
407 ifdef PERL | |
6872 | 408 CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS |
6326 | 409 ifeq (yes, $(DYNAMIC_PERL)) |
410 CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\" | |
411 EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER) | |
412 endif | |
413 endif | |
414 | |
415 ifdef LUA | |
416 CFLAGS += -I$(LUA)/include -I$(LUA) -DFEAT_LUA | |
417 ifeq (yes, $(DYNAMIC_LUA)) | |
418 CFLAGS += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\" | |
419 endif | |
420 endif | |
421 | |
422 ifdef MZSCHEME | |
423 CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\" | |
424 ifeq (yes, $(DYNAMIC_MZSCHEME)) | |
425 CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\" | |
426 endif | |
427 ifeq (yes, "$(MZSCHEME_DEBUG)") | |
428 CFLAGS += -DMZSCHEME_FORCE_GC | |
429 endif | |
430 endif | |
431 | |
432 ifdef RUBY | |
433 CFLAGS += -DFEAT_RUBY $(RUBYINC) | |
434 ifeq (yes, $(DYNAMIC_RUBY)) | |
435 CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" | |
436 CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER) | |
437 endif | |
438 ifneq ($(findstring w64-mingw32,$(CC)),) | |
439 # A workaround for MinGW-w64 | |
440 CFLAGS += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE | |
441 endif | |
442 endif | |
443 | |
444 ifdef PYTHON | |
445 CFLAGS += -DFEAT_PYTHON | |
446 ifeq (yes, $(DYNAMIC_PYTHON)) | |
447 CFLAGS += -DDYNAMIC_PYTHON | |
448 endif | |
449 endif | |
450 | |
451 ifdef PYTHON3 | |
452 CFLAGS += -DFEAT_PYTHON3 | |
453 ifeq (yes, $(DYNAMIC_PYTHON3)) | |
454 CFLAGS += -DDYNAMIC_PYTHON3 | |
455 endif | |
456 endif | |
457 | |
458 ifdef TCL | |
459 CFLAGS += -DFEAT_TCL $(TCLINC) | |
460 ifeq (yes, $(DYNAMIC_TCL)) | |
461 CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\" | |
462 endif | |
463 endif | |
464 | |
465 ifeq ($(POSTSCRIPT),yes) | |
466 DEFINES += -DMSWINPS | |
467 endif | |
468 | |
469 ifeq (yes, $(OLE)) | |
470 DEFINES += -DFEAT_OLE | |
471 endif | |
472 | |
473 ifeq ($(CSCOPE),yes) | |
474 DEFINES += -DFEAT_CSCOPE | |
475 endif | |
476 | |
477 ifeq ($(NETBEANS),yes) | |
478 # Only allow NETBEANS for a GUI build. | |
479 ifeq (yes, $(GUI)) | |
480 DEFINES += -DFEAT_NETBEANS_INTG | |
481 | |
482 ifeq ($(NBDEBUG), yes) | |
483 DEFINES += -DNBDEBUG | |
484 NBDEBUG_INCL = nbdebug.h | |
485 NBDEBUG_SRC = nbdebug.c | |
486 endif | |
487 endif | |
488 endif | |
489 | |
490 # DirectWrite (DirectX) | |
491 ifeq ($(DIRECTX),yes) | |
492 # Only allow DirectWrite for a GUI build. | |
493 ifeq (yes, $(GUI)) | |
494 DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX | |
495 endif | |
496 endif | |
497 | |
498 # Only allow XPM for a GUI build. | |
499 ifeq (yes, $(GUI)) | |
500 | |
501 ifndef XPM | |
502 ifeq ($(ARCH),i386) | |
503 XPM = xpm/x86 | |
504 endif | |
505 ifeq ($(ARCH),i486) | |
506 XPM = xpm/x86 | |
507 endif | |
508 ifeq ($(ARCH),i586) | |
509 XPM = xpm/x86 | |
510 endif | |
511 ifeq ($(ARCH),i686) | |
512 XPM = xpm/x86 | |
513 endif | |
514 ifeq ($(ARCH),x86-64) | |
515 XPM = xpm/x64 | |
516 endif | |
517 endif | |
518 ifdef XPM | |
519 ifneq ($(XPM),no) | |
520 CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include | |
521 endif | |
522 endif | |
523 | |
524 endif | |
525 | |
526 ifeq ($(DEBUG),yes) | |
527 CFLAGS += -g -fstack-check | |
528 DEBUG_SUFFIX=d | |
529 else | |
530 ifeq ($(OPTIMIZE), SIZE) | |
531 CFLAGS += -Os | |
532 else | |
533 ifeq ($(OPTIMIZE), MAXSPEED) | |
534 CFLAGS += -O3 | |
535 CFLAGS += -fomit-frame-pointer -freg-struct-return | |
536 else # SPEED | |
537 CFLAGS += -O2 | |
538 endif | |
539 endif | |
540 CFLAGS += -s | |
541 endif | |
542 | |
543 LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion | |
544 GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o | |
545 OBJ = \ | |
546 $(OUTDIR)/blowfish.o \ | |
547 $(OUTDIR)/buffer.o \ | |
548 $(OUTDIR)/charset.o \ | |
549 $(OUTDIR)/crypt.o \ | |
550 $(OUTDIR)/crypt_zip.o \ | |
551 $(OUTDIR)/diff.o \ | |
552 $(OUTDIR)/digraph.o \ | |
553 $(OUTDIR)/edit.o \ | |
554 $(OUTDIR)/eval.o \ | |
555 $(OUTDIR)/ex_cmds.o \ | |
556 $(OUTDIR)/ex_cmds2.o \ | |
557 $(OUTDIR)/ex_docmd.o \ | |
558 $(OUTDIR)/ex_eval.o \ | |
559 $(OUTDIR)/ex_getln.o \ | |
560 $(OUTDIR)/fileio.o \ | |
561 $(OUTDIR)/fold.o \ | |
562 $(OUTDIR)/getchar.o \ | |
563 $(OUTDIR)/hardcopy.o \ | |
564 $(OUTDIR)/hashtab.o \ | |
565 $(OUTDIR)/main.o \ | |
566 $(OUTDIR)/mark.o \ | |
567 $(OUTDIR)/memfile.o \ | |
568 $(OUTDIR)/memline.o \ | |
569 $(OUTDIR)/menu.o \ | |
570 $(OUTDIR)/message.o \ | |
571 $(OUTDIR)/misc1.o \ | |
572 $(OUTDIR)/misc2.o \ | |
573 $(OUTDIR)/move.o \ | |
574 $(OUTDIR)/mbyte.o \ | |
575 $(OUTDIR)/normal.o \ | |
576 $(OUTDIR)/ops.o \ | |
577 $(OUTDIR)/option.o \ | |
578 $(OUTDIR)/os_win32.o \ | |
579 $(OUTDIR)/os_mswin.o \ | |
580 $(OUTDIR)/winclip.o \ | |
581 $(OUTDIR)/pathdef.o \ | |
582 $(OUTDIR)/popupmnu.o \ | |
583 $(OUTDIR)/quickfix.o \ | |
584 $(OUTDIR)/regexp.o \ | |
585 $(OUTDIR)/screen.o \ | |
586 $(OUTDIR)/search.o \ | |
587 $(OUTDIR)/sha256.o \ | |
588 $(OUTDIR)/spell.o \ | |
589 $(OUTDIR)/syntax.o \ | |
590 $(OUTDIR)/tag.o \ | |
591 $(OUTDIR)/term.o \ | |
592 $(OUTDIR)/ui.o \ | |
593 $(OUTDIR)/undo.o \ | |
594 $(OUTDIR)/version.o \ | |
595 $(OUTDIR)/vimrc.o \ | |
596 $(OUTDIR)/window.o | |
597 | |
598 ifdef PERL | |
599 OBJ += $(OUTDIR)/if_perl.o | |
600 endif | |
601 ifdef LUA | |
602 OBJ += $(OUTDIR)/if_lua.o | |
603 endif | |
604 ifdef MZSCHEME | |
605 OBJ += $(OUTDIR)/if_mzsch.o | |
606 MZSCHEME_INCL = if_mzsch.h | |
607 ifeq (yes,$(MZSCHEME_GENERATE_BASE)) | |
608 CFLAGS += -DINCLUDE_MZSCHEME_BASE | |
609 MZ_EXTRA_DEP += mzscheme_base.c | |
610 endif | |
611 ifeq (yes,$(MZSCHEME_PRECISE_GC)) | |
612 CFLAGS += -DMZ_PRECISE_GC | |
613 endif | |
614 endif | |
615 ifdef PYTHON | |
616 OBJ += $(OUTDIR)/if_python.o | |
617 endif | |
618 ifdef PYTHON3 | |
619 OBJ += $(OUTDIR)/if_python3.o | |
620 endif | |
621 ifdef RUBY | |
622 OBJ += $(OUTDIR)/if_ruby.o | |
623 endif | |
624 ifdef TCL | |
625 OBJ += $(OUTDIR)/if_tcl.o | |
626 endif | |
627 ifeq ($(CSCOPE),yes) | |
628 OBJ += $(OUTDIR)/if_cscope.o | |
629 endif | |
630 ifeq ($(NETBEANS),yes) | |
631 # Only allow NETBEANS for a GUI build. | |
632 ifeq (yes, $(GUI)) | |
633 OBJ += $(OUTDIR)/netbeans.o | |
634 LIB += -lwsock32 | |
635 endif | |
636 endif | |
637 ifeq ($(DIRECTX),yes) | |
638 # Only allow DIRECTX for a GUI build. | |
639 ifeq (yes, $(GUI)) | |
640 OBJ += $(OUTDIR)/gui_dwrite.o | |
641 LIB += -ld2d1 -ldwrite | |
642 USE_STDCPLUS = yes | |
643 endif | |
644 endif | |
645 ifneq ($(XPM),no) | |
646 # Only allow XPM for a GUI build. | |
647 ifeq (yes, $(GUI)) | |
648 OBJ += $(OUTDIR)/xpm_w32.o | |
649 # You'll need libXpm.a from http://gnuwin32.sf.net | |
650 LIB += -L$(XPM)/lib -lXpm | |
651 endif | |
652 endif | |
653 | |
654 | |
655 ifdef MZSCHEME | |
656 MZSCHEME_SUFFIX = Z | |
657 endif | |
658 | |
659 ifeq ($(GUI),yes) | |
660 TARGET := gvim$(DEBUG_SUFFIX).exe | |
661 DEFINES += $(DEF_GUI) | |
662 OBJ += $(GUIOBJ) | |
663 LFLAGS += -mwindows | |
664 OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH) | |
665 else | |
666 TARGET := vim$(DEBUG_SUFFIX).exe | |
667 OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH) | |
668 endif | |
669 | |
670 ifdef GETTEXT | |
671 ifneq (yes, $(GETTEXT)) | |
672 CFLAGS += -I$(GETTEXTINCLUDE) | |
673 ifndef STATIC_GETTEXT | |
674 LIB += -L$(GETTEXTLIB) -l$(INTLLIB) | |
675 ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT)) | |
676 OBJ+=$(SAFE_GETTEXT_DLL_OBJ) | |
677 endif | |
678 else | |
679 LIB += -L$(GETTEXTLIB) -lintl | |
680 endif | |
681 endif | |
682 endif | |
683 | |
684 ifdef PERL | |
685 ifeq (no, $(DYNAMIC_PERL)) | |
686 LIB += -L$(PERLLIBS) -lperl$(PERL_VER) | |
687 endif | |
688 endif | |
689 | |
690 ifdef TCL | |
691 LIB += -L$(TCL)/lib | |
692 ifeq (yes, $(DYNAMIC_TCL)) | |
693 LIB += -ltclstub$(TCL_VER) | |
694 else | |
695 LIB += -ltcl$(TCL_VER) | |
696 endif | |
697 endif | |
698 | |
699 ifeq (yes, $(OLE)) | |
700 LIB += -loleaut32 | |
701 OBJ += $(OUTDIR)/if_ole.o | |
702 USE_STDCPLUS = yes | |
703 endif | |
704 | |
705 ifeq (yes, $(MBYTE)) | |
706 DEFINES += -DFEAT_MBYTE | |
707 endif | |
708 | |
709 ifeq (yes, $(IME)) | |
710 DEFINES += -DFEAT_MBYTE_IME | |
711 ifeq (yes, $(DYNAMIC_IME)) | |
712 DEFINES += -DDYNAMIC_IME | |
713 else | |
714 LIB += -limm32 | |
715 endif | |
716 endif | |
717 | |
718 ifdef ICONV | |
719 ifneq (yes, $(ICONV)) | |
720 LIB += -L$(ICONV) | |
721 CFLAGS += -I$(ICONV) | |
722 endif | |
723 DEFINES+=-DDYNAMIC_ICONV | |
724 endif | |
725 | |
726 ifeq (yes, $(USE_STDCPLUS)) | |
727 ifeq (yes, $(STATIC_STDCPLUS)) | |
728 LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic | |
729 else | |
730 LIB += -lstdc++ | |
731 endif | |
732 endif | |
733 | |
734 all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll | |
735 | |
736 vimrun.exe: vimrun.c | |
737 $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB) | |
738 | |
739 install.exe: dosinst.c | |
740 $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid | |
741 | |
742 uninstal.exe: uninstal.c | |
743 $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB) | |
744 | |
745 $(TARGET): $(OUTDIR) $(OBJ) | |
746 $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) | |
747 | |
748 upx: exes | |
749 upx gvim.exe | |
750 upx vim.exe | |
751 | |
752 mpress: exes | |
753 mpress gvim.exe | |
754 mpress vim.exe | |
755 | |
756 xxd/xxd.exe: xxd/xxd.c | |
757 $(MAKE) -C xxd -f Make_ming.mak CC='$(CC)' | |
758 | |
759 GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h | |
760 $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS) | |
761 | |
762 clean: | |
763 -$(DEL) $(OUTDIR)$(DIRSLASH)*.o | |
764 -$(DEL) $(OUTDIR)$(DIRSLASH)*.res | |
765 -rmdir $(OUTDIR) | |
766 -$(DEL) *.exe | |
767 -$(DEL) pathdef.c | |
768 ifdef PERL | |
769 -$(DEL) if_perl.c | |
770 endif | |
771 ifdef MZSCHEME | |
772 -$(DEL) mzscheme_base.c | |
773 endif | |
774 $(MAKE) -C GvimExt -f Make_ming.mak clean | |
775 $(MAKE) -C xxd -f Make_ming.mak clean | |
776 | |
777 ########################################################################### | |
778 INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \ | |
779 structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \ | |
780 gui.h | |
781 | |
782 $(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL) | |
7456
2c5e813e8852
commit https://github.com/vim/vim/commit/3c6f92e52ef15df4aa248ce00eacd65928044210
Christian Brabandt <cb@256bit.org>
parents:
6872
diff
changeset
|
783 $(CC) -c $(CFLAGS) $(PYTHONINC) $(PYTHON_HOME_DEF) -DDYNAMIC_PYTHON_DLL=\"$(DYNAMIC_PYTHON_DLL)\" $< -o $@ |
6326 | 784 |
785 $(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL) | |
786 $(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@ | |
787 | |
788 $(OUTDIR)/%.o : %.c $(INCL) | |
789 $(CC) -c $(CFLAGS) $< -o $@ | |
790 | |
791 $(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h | |
792 $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \ | |
793 --input-format=rc --output-format=coff -i vim.rc -o $@ | |
794 | |
795 $(OUTDIR): | |
796 $(MKDIR) $(OUTDIR) | |
797 | |
798 $(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h | |
799 $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o | |
800 | |
801 $(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h | |
802 $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o | |
803 | |
804 $(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL) | |
805 $(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o | |
806 | |
807 $(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h | |
808 $(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o | |
809 | |
810 $(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h | |
811 $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o | |
812 | |
813 # Remove -D__IID_DEFINED__ for newer versions of the w32api | |
814 $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) | |
815 $(CC) $(CFLAGS) -c -o $(OUTDIR)/if_ole.o if_ole.cpp | |
816 | |
817 $(OUTDIR)/if_ruby.o: if_ruby.c $(INCL) | |
818 ifeq (16, $(RUBY)) | |
819 $(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c | |
820 endif | |
821 | |
822 if_perl.c: if_perl.xs typemap | |
823 $(XSUBPP) -prototypes -typemap \ | |
6349 | 824 $(PERLTYPEMAP) if_perl.xs > $@ |
6326 | 825 |
826 $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC) | |
827 $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o | |
828 | |
829 $(OUTDIR)/regexp.o: regexp.c regexp_nfa.c $(INCL) | |
830 $(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o | |
831 | |
832 $(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP) | |
833 $(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o | |
834 | |
835 mzscheme_base.c: | |
836 $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base | |
837 | |
838 pathdef.c: $(INCL) | |
839 ifneq (sh.exe, $(SHELL)) | |
840 @echo creating pathdef.c | |
841 @echo '/* pathdef.c */' > pathdef.c | |
842 @echo '#include "vim.h"' >> pathdef.c | |
843 @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c | |
844 @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c | |
845 @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c | |
846 @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 | |
847 @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c | |
848 @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c | |
849 else | |
850 @echo creating pathdef.c | |
851 @echo /* pathdef.c */ > pathdef.c | |
852 @echo #include "vim.h" >> pathdef.c | |
853 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c | |
854 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c | |
855 @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c | |
856 @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 | |
857 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c | |
858 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c | |
859 endif |