blob: a56141662f86c346d388b1b49497418a70596f62 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001#
2# Makefile for VIM on Win32, using Cygnus gcc
Bram Moolenaar95b557b2012-07-06 13:40:50 +02003# Last updated by Dan Sharp. Last Change: 2012 Jun 30
Bram Moolenaar65c1b012005-01-31 19:02:28 +00004#
5# Also read INSTALLpc.txt!
Bram Moolenaar071d4272004-06-13 20:20:40 +00006#
7# This compiles Vim as a Windows application. If you want Vim to run as a
8# Cygwin application use the Makefile (just like on Unix).
9#
10# GUI no or yes: set to yes if you want the GUI version (yes)
11# PERL define to path to Perl dir to get Perl support (not defined)
12# PERL_VER define to version of Perl being used (56)
13# DYNAMIC_PERL no or yes: set to yes to load the Perl DLL dynamically (yes)
14# PYTHON define to path to Python dir to get PYTHON support (not defined)
15# PYTHON_VER define to version of Python being used (22)
16# DYNAMIC_PYTHON no or yes: use yes to load the Python DLL dynamically (yes)
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +020017# PYTHON3 define to path to Python3 dir to get PYTHON3 support (not defined)
18# PYTHON3_VER define to version of Python3 being used (22)
19# DYNAMIC_PYTHON3 no or yes: use yes to load the Python3 DLL dynamically (yes)
Bram Moolenaar071d4272004-06-13 20:20:40 +000020# TCL define to path to TCL dir to get TCL support (not defined)
21# TCL_VER define to version of TCL being used (83)
22# DYNAMIC_TCL no or yes: use yes to load the TCL DLL dynamically (yes)
23# RUBY define to path to Ruby dir to get Ruby support (not defined)
Bram Moolenaardd53a412012-11-28 16:18:29 +010024# RUBY_VER define to version of Ruby being used (16)
25# RUBY_VER_LONG same, but in format with dot. (1.6)
26# You must set RUBY_VER_LONG when changing RUBY_VER.
27# You must set RUBY_API_VER version to RUBY_VER_LONG.
28# Don't set ruby API version to RUBY_VER like 191.
Bram Moolenaar071d4272004-06-13 20:20:40 +000029# DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (yes)
Bram Moolenaar281bdce2005-01-25 21:53:18 +000030# MZSCHEME define to path to MzScheme dir to get MZSCHEME support (not defined)
31# MZSCHEME_VER define to version of MzScheme being used (209_000)
32# DYNAMIC_MZSCHEME no or yes: use yes to load the MzScheme DLLs dynamically (yes)
Bram Moolenaar65c1b012005-01-31 19:02:28 +000033# MZSCHEME_DLLS path to MzScheme DLLs (libmzgc and libmzsch), for "static" build.
Bram Moolenaar2d0860d2010-11-03 21:59:30 +010034# MZSCHEME_USE_RACKET define to use "racket" instead of "mzsch".
Bram Moolenaar0ba04292010-07-14 23:23:17 +020035# LUA define to path to Lua dir to get Lua support (not defined)
36# LUA_VER define to version of Lua being used (51)
37# DYNAMIC_LUA no or yes: use yes to load the Lua DLL dynamically (yes)
Bram Moolenaar071d4272004-06-13 20:20:40 +000038# GETTEXT no or yes: set to yes for dynamic gettext support (yes)
39# ICONV no or yes: set to yes for dynamic iconv support (yes)
40# MBYTE no or yes: set to yes to include multibyte support (yes)
41# IME no or yes: set to yes to include IME support (yes)
42# DYNAMIC_IME no or yes: set to yes to load imm32.dll dynamically (yes)
43# OLE no or yes: set to yes to make OLE gvim (no)
44# DEBUG no or yes: set to yes if you wish a DEBUGging build (no)
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000045# CPUNR No longer supported, use ARCH.
Bram Moolenaar48f80c22010-02-24 15:08:27 +010046# ARCH i386 through pentium4: select -march argument to compile with
47# (i386)
Bram Moolenaar071d4272004-06-13 20:20:40 +000048# USEDLL no or yes: set to yes to use the Runtime library DLL (no)
49# For USEDLL=yes the cygwin1.dll is required to run Vim.
Bram Moolenaar48f80c22010-02-24 15:08:27 +010050# "no" does not work with latest version of Cygwin, use
Bram Moolenaar164fca32010-07-14 13:58:07 +020051# Make_ming.mak instead. Or set CC to gcc-3 and add
52# -L/lib/w32api to EXTRA_LIBS.
Bram Moolenaar071d4272004-06-13 20:20:40 +000053# POSTSCRIPT no or yes: set to yes for PostScript printing (no)
54# FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG)
Bram Moolenaar95b557b2012-07-06 13:40:50 +020055# WINVER Lowest Win32 version to support. (0x0500)
Bram Moolenaar071d4272004-06-13 20:20:40 +000056# CSCOPE no or yes: to include cscope interface support (yes)
57# OPTIMIZE SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED)
58# NETBEANS no or yes: to include netbeans interface support (yes when GUI
59# is yes)
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000060# NBDEBUG no or yes: to include netbeans interface debugging support (no)
Bram Moolenaar071d4272004-06-13 20:20:40 +000061# XPM define to path to XPM dir to get XPM image support (not defined)
62#>>>>> choose options:
63ifndef GUI
64GUI=yes
65endif
66
67ifndef FEATURES
68FEATURES = BIG
69endif
70
71ifndef GETTEXT
72GETTEXT = yes
73endif
74
75ifndef ICONV
76ICONV = yes
77endif
78
79ifndef MBYTE
80MBYTE = yes
81endif
82
83ifndef IME
84IME = yes
85endif
86
Bram Moolenaar071d4272004-06-13 20:20:40 +000087ifndef ARCH
88ARCH = i386
89endif
90
91ifndef WINVER
Bram Moolenaar95b557b2012-07-06 13:40:50 +020092WINVER = 0x0500
Bram Moolenaar071d4272004-06-13 20:20:40 +000093endif
94
95ifndef CSCOPE
96CSCOPE = yes
97endif
98
99ifndef NETBEANS
100ifeq ($(GUI),yes)
101NETBEANS = yes
102endif
103endif
104
105ifndef OPTIMIZE
106OPTIMIZE = MAXSPEED
107endif
108
109### See feature.h for a list of optionals.
110### Any other defines can be included here.
111
112DEFINES = -DWIN32 -DHAVE_PATHDEF -DFEAT_$(FEATURES) \
113 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000114INCLUDES = -march=$(ARCH) -Iproto
Bram Moolenaar071d4272004-06-13 20:20:40 +0000115
116#>>>>> name of the compiler and linker, name of lib directory
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100117CROSS_COMPILE =
Bram Moolenaar071d4272004-06-13 20:20:40 +0000118CC = gcc
119RC = windres
120
121##############################
122# DYNAMIC_PERL=yes and no both work
123##############################
124ifdef PERL
125DEFINES += -DFEAT_PERL
126INCLUDES += -I$(PERL)/lib/CORE
127EXTRA_OBJS += $(OUTDIR)/if_perl.o
128
129ifndef DYNAMIC_PERL
130DYNAMIC_PERL = yes
131endif
132
133ifndef PERL_VER
134PERL_VER = 56
135endif
136
137ifeq (yes, $(DYNAMIC_PERL))
138DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
139else
140EXTRA_LIBS += $(PERL)/lib/CORE/perl$(PERL_VER).lib
141endif
142endif
143
144##############################
145# DYNAMIC_PYTHON=yes works.
146# DYNAMIC_PYTHON=no does not (unresolved externals on link).
147##############################
148ifdef PYTHON
149DEFINES += -DFEAT_PYTHON
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150EXTRA_OBJS += $(OUTDIR)/if_python.o
151
152ifndef DYNAMIC_PYTHON
153DYNAMIC_PYTHON = yes
154endif
155
156ifndef PYTHON_VER
157PYTHON_VER = 22
158endif
159
160ifeq (yes, $(DYNAMIC_PYTHON))
161DEFINES += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
162else
163EXTRA_LIBS += $(PYTHON)/libs/python$(PYTHON_VER).lib
164endif
165endif
166
167##############################
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200168# DYNAMIC_PYTHON3=yes works.
169# DYNAMIC_PYTHON3=no does not (unresolved externals on link).
170##############################
171ifdef PYTHON3
172DEFINES += -DFEAT_PYTHON3
173EXTRA_OBJS += $(OUTDIR)/if_python3.o
174
175ifndef DYNAMIC_PYTHON3
176DYNAMIC_PYTHON3 = yes
177endif
178
179ifndef PYTHON3_VER
180PYTHON3_VER = 31
181endif
182
183ifeq (yes, $(DYNAMIC_PYTHON3))
184DEFINES += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
185else
186EXTRA_LIBS += $(PYTHON3)/libs/python$(PYTHON3_VER).lib
187endif
188endif
189
190##############################
Bram Moolenaar071d4272004-06-13 20:20:40 +0000191# DYNAMIC_RUBY=yes works.
192# DYNAMIC_RUBY=no does not (process exits).
193##############################
194ifdef RUBY
195
196ifndef RUBY_VER
197RUBY_VER=16
198endif
199
200ifndef RUBY_VER_LONG
201RUBY_VER_LONG=1.6
202endif
203
204ifndef DYNAMIC_RUBY
205DYNAMIC_RUBY = yes
206endif
207
208ifeq ($(RUBY_VER), 16)
209ifndef RUBY_PLATFORM
210RUBY_PLATFORM = i586-mswin32
211endif
212ifndef RUBY_INSTALL_NAME
213RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
214endif
215else
216ifndef RUBY_PLATFORM
217RUBY_PLATFORM = i386-mswin32
218endif
219ifndef RUBY_INSTALL_NAME
220RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
221endif
222endif
223
Bram Moolenaardd53a412012-11-28 16:18:29 +0100224ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
225RUBY_19_OR_LATER = 1
226endif
227
Bram Moolenaar071d4272004-06-13 20:20:40 +0000228DEFINES += -DFEAT_RUBY
229INCLUDES += -I$(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
Bram Moolenaardd53a412012-11-28 16:18:29 +0100230ifdef RUBY_19_OR_LATER
231INCLUDES += -I$(RUBY)/include/ruby-$(RUBY_VER_LONG) -I$(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
232endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000233EXTRA_OBJS += $(OUTDIR)/if_ruby.o
234
235ifeq (yes, $(DYNAMIC_RUBY))
236DEFINES += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
237DEFINES += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
238else
239EXTRA_LIBS += $(RUBY)/lib/$(RUBY_INSTALL_NAME).lib
240endif
241endif
242
243##############################
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000244# DYNAMIC_MZSCHEME=yes works
245# DYNAMIC_MZSCHEME=no works too
246##############################
247ifdef MZSCHEME
248DEFINES += -DFEAT_MZSCHEME
249INCLUDES += -I$(MZSCHEME)/include
250EXTRA_OBJS += $(OUTDIR)/if_mzsch.o
251
252ifndef DYNAMIC_MZSCHEME
253DYNAMIC_MZSCHEME = yes
254endif
255
256ifndef MZSCHEME_VER
257MZSCHEME_VER = 209_000
258endif
259
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000260ifndef MZSCHEME_PRECISE_GC
261MZSCHEME_PRECISE_GC=no
262endif
263
264# for version 4.x we need to generate byte-code for Scheme base
265ifndef MZSCHEME_GENERATE_BASE
266MZSCHEME_GENERATE_BASE=no
267endif
268
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100269ifndef MZSCHEME_USE_RACKET
270MZSCHEME_MAIN_LIB=mzsch
271else
272MZSCHEME_MAIN_LIB=racket
273endif
274
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000275ifeq (yes, $(DYNAMIC_MZSCHEME))
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100276DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000277else
278ifndef MZSCHEME_DLLS
279MZSCHEME_DLLS = $(MZSCHEME)
280endif
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000281ifeq (yes,$(MZSCHEME_PRECISE_GC))
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100282MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000283else
Bram Moolenaar2d0860d2010-11-03 21:59:30 +0100284MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000285endif
286EXTRA_LIBS += -L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)/lib $(MZSCHEME_LIB)
287endif
288ifeq (yes,$(MZSCHEME_GENERATE_BASE))
289DEFINES += -DINCLUDE_MZSCHEME_BASE
290MZ_EXTRA_DEP += mzscheme_base.c
291endif
292ifeq (yes,$(MZSCHEME_PRECISE_GC))
293DEFINES += -DMZ_PRECISE_GC
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000294endif
295endif
296
297##############################
Bram Moolenaar071d4272004-06-13 20:20:40 +0000298# DYNAMIC_TCL=yes and no both work.
299##############################
300ifdef TCL
301DEFINES += -DFEAT_TCL
302INCLUDES += -I$(TCL)/include
303EXTRA_OBJS += $(OUTDIR)/if_tcl.o
304
305ifndef DYNAMIC_TCL
306DYNAMIC_TCL = yes
307endif
308
309ifndef TCL_VER
310TCL_VER = 83
311endif
312
313ifeq (yes, $(DYNAMIC_TCL))
314DEFINES += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
315EXTRA_LIBS += $(TCL)/lib/tclstub$(TCL_VER).lib
316else
317EXTRA_LIBS += $(TCL)/lib/tcl$(TCL_VER).lib
318endif
319endif
320
321##############################
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200322# DYNAMIC_LUA=yes works.
323# DYNAMIC_LUA=no does not (unresolved externals on link).
324##############################
325ifdef LUA
326DEFINES += -DFEAT_LUA
327INCLUDES += -I$(LUA)/include
328EXTRA_OBJS += $(OUTDIR)/if_lua.o
329
330ifndef DYNAMIC_LUA
331DYNAMIC_LUA = yes
332endif
333
334ifndef LUA_VER
335LUA_VER = 51
336endif
337
338ifeq (yes, $(DYNAMIC_LUA))
339DEFINES += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
340else
341EXTRA_LIBS += $(LUA)/lib/lua$(LUA_VER).lib
342endif
343endif
344
345##############################
Bram Moolenaar071d4272004-06-13 20:20:40 +0000346ifeq (yes, $(GETTEXT))
347DEFINES += -DDYNAMIC_GETTEXT
348endif
349
350##############################
351ifeq (yes, $(ICONV))
352DEFINES += -DDYNAMIC_ICONV
353endif
354
355##############################
356ifeq (yes, $(MBYTE))
357DEFINES += -DFEAT_MBYTE
358endif
359
360##############################
361ifeq (yes, $(IME))
362DEFINES += -DFEAT_MBYTE_IME
363
364ifndef DYNAMIC_IME
365DYNAMIC_IME = yes
366endif
367
368ifeq (yes, $(DYNAMIC_IME))
369DEFINES += -DDYNAMIC_IME
370else
371EXTRA_LIBS += -limm32
372endif
373endif
374
375##############################
376ifeq (yes, $(DEBUG))
377DEFINES += -DDEBUG
378INCLUDES += -g -fstack-check
379DEBUG_SUFFIX = d
380else
381
382ifeq ($(OPTIMIZE), SIZE)
383OPTFLAG = -Os
384else
385ifeq ($(OPTIMIZE), MAXSPEED)
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000386OPTFLAG = -O3 -fomit-frame-pointer -freg-struct-return
Bram Moolenaar071d4272004-06-13 20:20:40 +0000387else
388OPTFLAG = -O2
389endif
390endif
391
392# A bug in the GCC <= 3.2 optimizer can cause a crash. The
393# following option removes the problem optimization.
394OPTFLAG += -fno-strength-reduce
395
396INCLUDES += -s
397
398endif
399
400##############################
401# USEDLL=yes will build a Cygwin32 executable that relies on cygwin1.dll.
402# USEDLL=no will build a Mingw32 executable with no extra dll dependencies.
403##############################
404ifeq (yes, $(USEDLL))
405DEFINES += -D_MAX_PATH=256 -D__CYGWIN__
406else
407INCLUDES += -mno-cygwin
408endif
409
410##############################
411ifeq (yes, $(POSTSCRIPT))
412DEFINES += -DMSWINPS
413endif
414
415##############################
416ifeq (yes, $(CSCOPE))
417DEFINES += -DFEAT_CSCOPE
418EXTRA_OBJS += $(OUTDIR)/if_cscope.o
419endif
420
421##############################
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000422ifeq ($(GUI),yes)
423
424##############################
Bram Moolenaar071d4272004-06-13 20:20:40 +0000425ifeq (yes, $(NETBEANS))
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000426# Only allow NETBEANS for a GUI build.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000427DEFINES += -DFEAT_NETBEANS_INTG
Bram Moolenaar408fb622005-03-07 23:03:19 +0000428EXTRA_OBJS += $(OUTDIR)/netbeans.o
Bram Moolenaar071d4272004-06-13 20:20:40 +0000429EXTRA_LIBS += -lwsock32
430
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000431ifeq (yes, $(NBDEBUG))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000432DEFINES += -DNBDEBUG
433NBDEBUG_DEP = nbdebug.h nbdebug.c
434endif
435
436endif
437
438##############################
439ifdef XPM
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000440# Only allow XPM for a GUI build.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000441DEFINES += -DFEAT_XPM_W32
442INCLUDES += -I$(XPM)/include
443EXTRA_OBJS += $(OUTDIR)/xpm_w32.o
444EXTRA_LIBS += -L$(XPM)/lib -lXpm
445endif
446
447##############################
Bram Moolenaar071d4272004-06-13 20:20:40 +0000448EXE = gvim$(DEBUG_SUFFIX).exe
449OUTDIR = gobj$(DEBUG_SUFFIX)
450DEFINES += -DFEAT_GUI_W32 -DFEAT_CLIPBOARD
Bram Moolenaar408fb622005-03-07 23:03:19 +0000451EXTRA_OBJS += $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o
Bram Moolenaar45360022005-07-21 21:08:21 +0000452EXTRA_LIBS += -mwindows -lcomctl32 -lversion
Bram Moolenaar071d4272004-06-13 20:20:40 +0000453else
454EXE = vim$(DEBUG_SUFFIX).exe
455OUTDIR = obj$(DEBUG_SUFFIX)
456LIBS += -luser32 -lgdi32 -lcomdlg32
457endif
458
459##############################
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000460ifeq (yes, $(OLE))
461DEFINES += -DFEAT_OLE
462EXTRA_OBJS += $(OUTDIR)/if_ole.o
463EXTRA_LIBS += -loleaut32 -lstdc++
464endif
465
466##############################
Bram Moolenaar071d4272004-06-13 20:20:40 +0000467ifneq (sh.exe, $(SHELL))
468DEL = rm
Bram Moolenaar32e4e1f2005-01-16 21:57:33 +0000469MKDIR = mkdir -p
Bram Moolenaar071d4272004-06-13 20:20:40 +0000470DIRSLASH = /
471else
472DEL = del
Bram Moolenaar32e4e1f2005-01-16 21:57:33 +0000473MKDIR = mkdir
Bram Moolenaar071d4272004-06-13 20:20:40 +0000474DIRSLASH = \\
475endif
476
477#>>>>> end of choices
478###########################################################################
479
480INCL = vim.h globals.h option.h keymap.h macros.h ascii.h term.h os_win32.h \
481 structs.h version.h
482
483CFLAGS = $(OPTFLAG) $(DEFINES) $(INCLUDES)
484
485RCFLAGS = -O coff $(DEFINES)
486
487OBJ = \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200488 $(OUTDIR)/blowfish.o \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000489 $(OUTDIR)/buffer.o \
490 $(OUTDIR)/charset.o \
491 $(OUTDIR)/diff.o \
492 $(OUTDIR)/digraph.o \
493 $(OUTDIR)/edit.o \
494 $(OUTDIR)/eval.o \
495 $(OUTDIR)/ex_cmds.o \
496 $(OUTDIR)/ex_cmds2.o \
497 $(OUTDIR)/ex_docmd.o \
498 $(OUTDIR)/ex_eval.o \
499 $(OUTDIR)/ex_getln.o \
500 $(OUTDIR)/fileio.o \
501 $(OUTDIR)/fold.o \
502 $(OUTDIR)/getchar.o \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000503 $(OUTDIR)/hardcopy.o \
Bram Moolenaar76b92b22006-03-24 22:46:53 +0000504 $(OUTDIR)/hashtab.o \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000505 $(OUTDIR)/main.o \
506 $(OUTDIR)/mark.o \
507 $(OUTDIR)/memfile.o \
508 $(OUTDIR)/memline.o \
509 $(OUTDIR)/menu.o \
510 $(OUTDIR)/message.o \
511 $(OUTDIR)/misc1.o \
512 $(OUTDIR)/misc2.o \
513 $(OUTDIR)/move.o \
514 $(OUTDIR)/mbyte.o \
515 $(OUTDIR)/normal.o \
516 $(OUTDIR)/ops.o \
517 $(OUTDIR)/option.o \
518 $(OUTDIR)/os_win32.o \
519 $(OUTDIR)/os_mswin.o \
520 $(OUTDIR)/pathdef.o \
Bram Moolenaar76b92b22006-03-24 22:46:53 +0000521 $(OUTDIR)/popupmnu.o \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000522 $(OUTDIR)/quickfix.o \
523 $(OUTDIR)/regexp.o \
524 $(OUTDIR)/screen.o \
525 $(OUTDIR)/search.o \
Bram Moolenaaredac1852010-05-18 20:34:20 +0200526 $(OUTDIR)/sha256.o \
Bram Moolenaarfc735152005-03-22 22:54:12 +0000527 $(OUTDIR)/spell.o \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000528 $(OUTDIR)/syntax.o \
529 $(OUTDIR)/tag.o \
530 $(OUTDIR)/term.o \
531 $(OUTDIR)/ui.o \
532 $(OUTDIR)/undo.o \
533 $(OUTDIR)/version.o \
534 $(OUTDIR)/vimrc.o \
535 $(OUTDIR)/window.o \
536 $(EXTRA_OBJS)
537
538all: $(EXE) xxd/xxd.exe vimrun.exe install.exe uninstal.exe GvimExt/gvimext.dll
539
540# According to the Cygwin doc 1.2 FAQ, kernel32 should not be specified for
541# linking unless calling ld directly.
542# See /usr/doc/cygwin-doc-1.2/html/faq_toc.html#TOC93 for more information.
543$(EXE): $(OUTDIR) $(OBJ)
544 $(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)
545
546xxd/xxd.exe: xxd/xxd.c
Bram Moolenaar48f80c22010-02-24 15:08:27 +0100547 $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) USEDLL=$(USEDLL)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000548
549GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
Bram Moolenaar2369e352011-09-30 16:56:02 +0200550 $(MAKE) -C GvimExt -f Make_cyg.mak CROSS_COMPILE=$(CROSS_COMPILE)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000551
552vimrun.exe: vimrun.c
553 $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIBS)
554
555install.exe: dosinst.c
556 $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIBS) -luuid -lole32
557
558uninstal.exe: uninstal.c
559 $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIBS)
560
561$(OUTDIR):
Bram Moolenaar32e4e1f2005-01-16 21:57:33 +0000562 $(MKDIR) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000563
564tags:
565 command /c ctags *.c $(INCL)
566
567clean:
568 -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
569 -rmdir $(OUTDIR)
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000570 -$(DEL) $(EXE) vimrun.exe install.exe uninstal.exe
Bram Moolenaar071d4272004-06-13 20:20:40 +0000571ifdef PERL
572 -$(DEL) if_perl.c
573endif
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000574ifdef MZSCHEME
575 -$(DEL) mzscheme_base.c
576endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000577 -$(DEL) pathdef.c
578 $(MAKE) -C xxd -f Make_cyg.mak clean
Bram Moolenaar2369e352011-09-30 16:56:02 +0200579 $(MAKE) -C GvimExt -f Make_cyg.mak clean
Bram Moolenaar071d4272004-06-13 20:20:40 +0000580
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000581distclean: clean
582 -$(DEL) obj$(DIRSLASH)*.o
583 -rmdir obj
584 -$(DEL) gobj$(DIRSLASH)*.o
585 -rmdir gobj
586 -$(DEL) objd$(DIRSLASH)*.o
587 -rmdir objd
588 -$(DEL) gobjd$(DIRSLASH)*.o
589 -rmdir gobjd
590 -$(DEL) *.exe
591
Bram Moolenaar071d4272004-06-13 20:20:40 +0000592###########################################################################
593
594$(OUTDIR)/%.o : %.c $(INCL)
595 $(CC) -c $(CFLAGS) $< -o $@
596
597$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
598 $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
599
600$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
601 $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
602
603$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
604 $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
605
606$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
Bram Moolenaar61bfb9f2007-09-30 20:28:48 +0000607 $(CC) -c $(CFLAGS) if_ole.cpp -o $(OUTDIR)/if_ole.o
Bram Moolenaar071d4272004-06-13 20:20:40 +0000608
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200609$(OUTDIR)/if_python.o : if_python.c $(INCL)
610 $(CC) -c $(CFLAGS) -I$(PYTHON)/include $< -o $@
611
612$(OUTDIR)/if_python3.o : if_python3.c $(INCL)
613 $(CC) -c $(CFLAGS) -I$(PYTHON3)/include $< -o $@
614
Bram Moolenaar071d4272004-06-13 20:20:40 +0000615if_perl.c: if_perl.xs typemap
Bram Moolenaarcf3630f2005-01-08 16:04:29 +0000616 $(PERL)/bin/perl `cygpath -d $(PERL)/lib/ExtUtils/xsubpp` \
617 -prototypes -typemap \
618 `cygpath -d $(PERL)/lib/ExtUtils/typemap` if_perl.xs > $@
Bram Moolenaar071d4272004-06-13 20:20:40 +0000619
620$(OUTDIR)/if_perl.o: if_perl.c $(INCL)
621ifeq (yes, $(USEDLL))
622 $(CC) -c $(CFLAGS) -I/usr/include/mingw -D__MINGW32__ if_perl.c -o $(OUTDIR)/if_perl.o
623endif
624
625$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
626ifeq (16, $(RUBY_VER))
627 $(CC) -c $(CFLAGS) -U_WIN32 if_ruby.c -o $(OUTDIR)/if_ruby.o
628endif
629
630$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_DEP)
631 $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
632
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000633$(OUTDIR)/if_mzsch.o: if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
634 $(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
635
Bram Moolenaar071d4272004-06-13 20:20:40 +0000636$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
637 $(RC) $(RCFLAGS) vim.rc -o $(OUTDIR)/vimrc.o
638
Bram Moolenaar2d6db762009-09-11 10:49:58 +0000639mzscheme_base.c:
640 $(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
641
Bram Moolenaar071d4272004-06-13 20:20:40 +0000642pathdef.c: $(INCL)
643ifneq (sh.exe, $(SHELL))
644 @echo creating pathdef.c
645 @echo '/* pathdef.c */' > pathdef.c
646 @echo '#include "vim.h"' >> pathdef.c
647 @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
648 @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
649 @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
650 @echo 'char_u *all_lflags = (char_u *)"$(CC) -s -o $(EXE) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)";' >> pathdef.c
651 @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
652 @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
653else
654 @echo creating pathdef.c
655 @echo /* pathdef.c */ > pathdef.c
656 @echo #include "vim.h" >> pathdef.c
657 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
658 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
659 @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
660 @echo char_u *all_lflags = (char_u *)"$(CC) -s -o $(EXE) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)"; >> pathdef.c
661 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
662 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
663endif
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200664