blob: 1633b6586c5686c9432ee0db27952986b5d34622 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001# Makefile for VIM on Win32, using 'EGCS/mingw32 1.1.2'.
2# Info at http://www.mingw.org
3# Also requires 'GNU make 3.77', which you can get through a link
4# to 'JanJaap's page from the above page.
5# Get missing libraries from http://gnuwin32.sf.net.
6#
7# Tested on Win32 NT 4 and Win95.
8#
9# To make everything, just 'make -f Make_ming.mak'
10# To make just e.g. gvim.exe, 'make -f Make_ming.mak gvim.exe'
11# After a run, you can 'make -f Make_ming.mak clean' to clean up
12#
13# NOTE: Sometimes 'GNU Make' will stop after building vimrun.exe -- I think
14# it's just run out of memory or something. Run again, and it will continue
15# with 'xxd'.
16#
17# "make upx" makes *compressed* versions of the GUI and console EXEs, using the
18# excellent UPX compressor:
19# http://upx.sourceforge.net/
20#
21# Maintained by Ron Aaron <ronaharon@yahoo.com>
22# updated 2003 Jan 20
23
24#>>>>> choose options:
25# set to yes for a debug build
26DEBUG=no
27# set to SIZE for size, SPEED for speed, MAXSPEED for maximium optimization
28OPTIMIZE=MAXSPEED
29# set to yes to make gvim, no for vim
30GUI=yes
31# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
32# set to TINY to make minimal version (few features)
33FEATURES=BIG
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000034# set to one of i386, i486, i586, i686 as the minimum target processor
Bram Moolenaar071d4272004-06-13 20:20:40 +000035ARCH=i386
36# set to yes to cross-compile from unix; no=native Windows
37CROSS=no
38# set to path to iconv.h and libiconv.a to enable using 'iconv.dll'
39#ICONV="."
40ICONV=yes
41GETTEXT=yes
42# set to yes to include multibyte support
43MBYTE=yes
44# set to yes to include IME support
45IME=yes
46DYNAMIC_IME=yes
47# set to yes to enable writing a postscript file with :hardcopy
48POSTSCRIPT=no
49# set to yes to enable OLE support
50OLE=no
51# Set the default $(WINVER) to make it work with pre-Win2k
52WINVER = 0x0400
53# Set to yes to enable Cscope support
54CSCOPE=yes
55# Set to yes to enable Netbeans support
56NETBEANS=$(GUI)
57
58
59# If the user doesn't want gettext, undefine it.
60ifeq (no, $(GETTEXT))
61GETTEXT=
62endif
63# Added by E.F. Amatria <eferna1@platea.ptic.mec.es> 2001 Feb 23
64# Uncomment the first line and one of the following three if you want Native Language
65# Support. You'll need gnu_gettext.win32, a MINGW32 Windows PORT of gettext by
66# Franco Bez <franco.bez@gmx.de>. It may be found at
67# http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
68# Tested with mingw32 with GCC-2.95.2 on Win98
69# Updated 2001 Jun 9
70#GETTEXT=c:/gettext.win32.msvcrt
71#STATIC_GETTEXT=USE_STATIC_GETTEXT
72#DYNAMIC_GETTEXT=USE_GETTEXT_DLL
73#DYNAMIC_GETTEXT=USE_SAFE_GETTEXT_DLL
74SAFE_GETTEXT_DLL_OBJ = $(GETTEXT)/src/safe_gettext_dll/safe_gettext_dll.o
75# Alternatively, if you uncomment the two following lines, you get a "safe" version
76# without linking the safe_gettext_dll.o object file.
77#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
78#GETTEXT_DYNAMIC=gnu_gettext.dll
79INTLPATH=$(GETTEXT)/lib/mingw32
80INTLLIB=gnu_gettext
81
82# If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext
83# or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/
84# uncomment the following, but I can't build a static versión with them, ?-(|
85#GETTEXT=c:/gettext-0.10.37-20010430
86#STATIC_GETTEXT=USE_STATIC_GETTEXT
87#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
88#INTLPATH=$(GETTEXT)/lib
89#INTLLIB=intl
90
91# uncomment 'PERL' if you want a perl-enabled version
92#PERL=C:/perl
93ifdef PERL
94ifndef PERL_VER
95PERL_VER=56
96endif
97ifndef DYNAMIC_PERL
98DYNAMIC_PERL=yes
99endif
100# on Linux, for cross-compile, it's here:
101#PERLLIB=/home/ron/ActivePerl/lib
102# on NT, it's here:
103PERLLIB=$(PERL)/lib
104PERLLIBS=$(PERLLIB)/Core
105endif
106
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000107# uncomment 'MZSCHEME' if you want a MzScheme-enabled version
108#MZSCHEME=d:/plt
109ifdef MZSCHEME
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000110ifndef DYNAMIC_MZSCHEME
111DYNAMIC_MZSCHEME=yes
112endif
113
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000114ifndef MZSCHEME_VER
115MZSCHEME_VER=205_000
116endif
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000117
118ifeq (no,$(DYNAMIC_MZSCHEME))
119MZSCHEME_LIB = -lmzsch$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
120# the modern MinGW can dynamically link to dlls directly.
121# point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000122ifndef MZSCHEME_DLLS
123MZSCHEME_DLLS=$(MZSCHEME)
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000124endif
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000125MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS)
126endif
127
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000128endif
129
Bram Moolenaar071d4272004-06-13 20:20:40 +0000130# Python support -- works with the ActiveState python 2.0 release (and others
131# too, probably)
132#
133# uncomment 'PYTHON' to make python-enabled version
134# Put the path to the python distro here. If cross compiling from Linux, you
135# will also need to convert the header files to unix instead of dos format:
136# for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
137# and also, you will need to make a mingw32 'libpython20.a' to link with:
138# cd $PYTHON/libs
139# pexports python20.dll > python20.def
140# dlltool -d python20.def -l libpython20.a
141# on my Linux box, I put the Python stuff here:
142#PYTHON=/home/ron/ActivePython-2.0.0-202/src/Core
143# on my NT box, it's here:
144#PYTHON=c:/python20
145
146ifdef PYTHON
147ifndef DYNAMIC_PYTHON
148DYNAMIC_PYTHON=yes
149endif
150
151ifndef PYTHON_VER
152PYTHON_VER=22
153endif
154
155ifeq (no,$(DYNAMIC_PYTHON))
156PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
157endif
158# my include files are in 'win32inc' on Linux, and 'include' in the standard
159# NT distro (ActiveState)
160ifeq ($(CROSS),no)
161PYTHONINC=-I $(PYTHON)/include
162else
163PYTHONINC=-I $(PYTHON)/win32inc
164endif
165endif
166
167# TCL interface:
168# TCL=[Path to TCL directory]
169# DYNAMIC_TCL=yes (to load the TCL DLL dynamically)
170# TCL_VER=[TCL version, eg 83, 84] (default is 83)
171#TCL=c:/tcl
172ifdef TCL
173ifndef DYNAMIC_TCL
174DYNAMIC_TCL=yes
175endif
176ifndef TCL_VER
177TCL_VER = 83
178endif
179TCLINC += -I$(TCL)/include
180endif
181
182
183# Ruby interface:
184# RUBY=[Path to Ruby directory]
185# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
186# RUBY_VER=[Ruby version, eg 16, 17] (default is 16)
187# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.6)
188# You must set RUBY_VER_LONG when change RUBY_VER.
189#RUBY=c:/ruby
190ifdef RUBY
191ifndef DYNAMIC_RUBY
192DYNAMIC_RUBY=yes
193endif
194# Set default value
195ifndef RUBY_VER
196RUBY_VER = 16
197endif
198ifndef RUBY_VER_LONG
199RUBY_VER_LONG = 1.6
200endif
201
202ifeq ($(RUBY_VER), 16)
203ifndef RUBY_PLATFORM
204RUBY_PLATFORM = i586-mswin32
205endif
206ifndef RUBY_INSTALL_NAME
207RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
208endif
209else
210ifndef RUBY_PLATFORM
211RUBY_PLATFORM = i386-mswin32
212endif
213ifndef RUBY_INSTALL_NAME
214RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
215endif
216endif
217
218RUBYINC =-I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
219ifeq (no, $(DYNAMIC_RUBY))
220RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
221endif
222
223endif # RUBY
224
225# See feature.h for a list of options.
226# Any other defines can be included here.
227DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
228DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
229 -DHAVE_PATHDEF -DFEAT_$(FEATURES)
230ifeq ($(CROSS),yes)
231# cross-compiler:
232CC = i586-pc-mingw32msvc-gcc
233DEL = rm
Bram Moolenaar0cf6f542005-01-16 21:59:36 +0000234MKDIR = mkdir -p
Bram Moolenaar071d4272004-06-13 20:20:40 +0000235WINDRES = i586-pc-mingw32msvc-windres
236else
237# normal (Windows) compilation:
238CC = gcc
239ifneq (sh.exe, $(SHELL))
240DEL = rm
Bram Moolenaar0cf6f542005-01-16 21:59:36 +0000241MKDIR = mkdir -p
Bram Moolenaar071d4272004-06-13 20:20:40 +0000242DIRSLASH = /
243else
244DEL = del
Bram Moolenaar0cf6f542005-01-16 21:59:36 +0000245MKDIR = mkdir
Bram Moolenaar071d4272004-06-13 20:20:40 +0000246DIRSLASH = \\
247endif
248WINDRES = windres
249endif
250
251#>>>>> end of choices
252###########################################################################
253
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000254CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
Bram Moolenaar071d4272004-06-13 20:20:40 +0000255
256ifdef GETTEXT
Bram Moolenaar8cd06ca2005-02-28 22:44:58 +0000257DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
Bram Moolenaar071d4272004-06-13 20:20:40 +0000258GETTEXTINCLUDE = $(GETTEXT)/include
259GETTEXTLIB = $(INTLPATH)
260ifeq (yes, $(GETTEXT))
Bram Moolenaar8cd06ca2005-02-28 22:44:58 +0000261DEFINES += -DDYNAMIC_GETTEXT
Bram Moolenaar071d4272004-06-13 20:20:40 +0000262else
263ifdef DYNAMIC_GETTEXT
Bram Moolenaar8cd06ca2005-02-28 22:44:58 +0000264DEFINES += -D$(DYNAMIC_GETTEXT)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000265ifdef GETTEXT_DYNAMIC
266DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
267endif
268endif
269endif
270endif
271
272ifdef PERL
273CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -L$(PERLLIBS)
274ifeq (yes, $(DYNAMIC_PERL))
275CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
276endif
277endif
278
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000279ifdef MZSCHEME
280CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\"
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000281ifeq (yes, $(DYNAMIC_MZSCHEME))
282CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
283endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000284endif
285
Bram Moolenaar071d4272004-06-13 20:20:40 +0000286ifdef RUBY
287CFLAGS += -DFEAT_RUBY $(RUBYINC)
288ifeq (yes, $(DYNAMIC_RUBY))
289CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
290CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
291endif
292endif
293
294ifdef PYTHON
295CFLAGS += -DFEAT_PYTHON $(PYTHONINC)
296ifeq (yes, $(DYNAMIC_PYTHON))
297CFLAGS += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
298endif
299endif
300
301ifdef TCL
302CFLAGS += -DFEAT_TCL $(TCLINC)
303ifeq (yes, $(DYNAMIC_TCL))
304CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
305endif
306endif
307
308ifeq ($(POSTSCRIPT),yes)
309DEFINES += -DMSWINPS
310endif
311
312ifeq (yes, $(OLE))
313DEFINES += -DFEAT_OLE
314endif
315
316ifeq ($(CSCOPE),yes)
317DEFINES += -DFEAT_CSCOPE
318endif
319
320ifeq ($(NETBEANS),yes)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000321# Only allow NETBEANS for a GUI build.
322ifeq (yes, $(GUI))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000323DEFINES += -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000324
325ifeq ($(NBDEBUG), yes)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000326DEFINES += -DNBDEBUG
327NBDEBUG_INCL = nbdebug.h
328NBDEBUG_SRC = nbdebug.c
329endif
330endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000331endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000332
333ifdef XPM
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000334# Only allow XPM for a GUI build.
335ifeq (yes, $(GUI))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000336CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include
337endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000338endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000339
340ifeq ($(DEBUG),yes)
341CFLAGS += -g -fstack-check
342DEBUG_SUFFIX=d
343else
344ifeq ($(OPTIMIZE), SIZE)
345CFLAGS += -Os
346else
347ifeq ($(OPTIMIZE), MAXSPEED)
348CFLAGS += -O3
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000349CFLAGS += -fomit-frame-pointer -freg-struct-return
Bram Moolenaar071d4272004-06-13 20:20:40 +0000350else # SPEED
351CFLAGS += -O2
352endif
353endif
354CFLAGS += -s
355endif
356
357LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32
Bram Moolenaar44ecf652005-03-07 23:09:59 +0000358GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o
Bram Moolenaar071d4272004-06-13 20:20:40 +0000359OBJ = \
360 $(OUTDIR)/buffer.o \
361 $(OUTDIR)/charset.o \
362 $(OUTDIR)/diff.o \
363 $(OUTDIR)/digraph.o \
364 $(OUTDIR)/edit.o \
365 $(OUTDIR)/eval.o \
366 $(OUTDIR)/ex_cmds.o \
367 $(OUTDIR)/ex_cmds2.o \
368 $(OUTDIR)/ex_docmd.o \
369 $(OUTDIR)/ex_eval.o \
370 $(OUTDIR)/ex_getln.o \
371 $(OUTDIR)/fileio.o \
372 $(OUTDIR)/fold.o \
373 $(OUTDIR)/getchar.o \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000374 $(OUTDIR)/hashtable.o \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000375 $(OUTDIR)/main.o \
376 $(OUTDIR)/mark.o \
377 $(OUTDIR)/memfile.o \
378 $(OUTDIR)/memline.o \
379 $(OUTDIR)/menu.o \
380 $(OUTDIR)/message.o \
381 $(OUTDIR)/misc1.o \
382 $(OUTDIR)/misc2.o \
383 $(OUTDIR)/move.o \
384 $(OUTDIR)/mbyte.o \
385 $(OUTDIR)/normal.o \
386 $(OUTDIR)/ops.o \
387 $(OUTDIR)/option.o \
388 $(OUTDIR)/os_win32.o \
389 $(OUTDIR)/os_mswin.o \
390 $(OUTDIR)/pathdef.o \
391 $(OUTDIR)/quickfix.o \
392 $(OUTDIR)/regexp.o \
393 $(OUTDIR)/screen.o \
394 $(OUTDIR)/search.o \
395 $(OUTDIR)/syntax.o \
396 $(OUTDIR)/tag.o \
397 $(OUTDIR)/term.o \
398 $(OUTDIR)/ui.o \
399 $(OUTDIR)/undo.o \
400 $(OUTDIR)/version.o \
401 $(OUTDIR)/vimrc.o \
402 $(OUTDIR)/window.o
403
404ifdef PERL
405OBJ += $(OUTDIR)/if_perl.o
406endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000407ifdef MZSCHEME
408OBJ += $(OUTDIR)/if_mzsch.o
409MZSCHEME_INCL = if_mzsch.h
410endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000411ifdef PYTHON
412OBJ += $(OUTDIR)/if_python.o
413endif
414ifdef RUBY
415OBJ += $(OUTDIR)/if_ruby.o
416endif
417ifdef TCL
418OBJ += $(OUTDIR)/if_tcl.o
419endif
420ifeq ($(CSCOPE),yes)
421OBJ += $(OUTDIR)/if_cscope.o
422endif
423ifeq ($(NETBEANS),yes)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000424# Only allow NETBEANS for a GUI build.
425ifeq (yes, $(GUI))
Bram Moolenaar44ecf652005-03-07 23:09:59 +0000426OBJ += $(OUTDIR)/netbeans.o
Bram Moolenaar071d4272004-06-13 20:20:40 +0000427LIB += -lwsock32
428endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000429endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000430ifdef XPM
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000431# Only allow XPM for a GUI build.
432ifeq (yes, $(GUI))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000433OBJ += $(OUTDIR)/xpm_w32.o
434# You'll need libXpm.a from http://gnuwin32.sf.net
435LIB += -L $(XPM)/lib -lXpm
436endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000437endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000438
439
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000440ifdef MZSCHEME
441MZSCHEME_SUFFIX = Z
442endif
443
Bram Moolenaar071d4272004-06-13 20:20:40 +0000444ifeq ($(GUI),yes)
445TARGET := gvim$(DEBUG_SUFFIX).exe
446DEFINES += $(DEF_GUI)
447OBJ += $(GUIOBJ)
448LFLAGS += -mwindows
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000449OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000450else
451TARGET := vim$(DEBUG_SUFFIX).exe
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000452OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000453endif
454
455ifdef GETTEXT
456ifneq (yes, $(GETTEXT))
457CFLAGS += -I$(GETTEXTINCLUDE)
458ifndef STATIC_GETTEXT
459LIB += -L$(GETTEXTLIB) -l$(INTLLIB)
460ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT))
461OBJ+=$(SAFE_GETTEXT_DLL_OBJ)
462endif
463else
464LIB += -L$(GETTEXTLIB) -lintl
465endif
466endif
467endif
468
469ifdef PERL
470ifeq (no, $(DYNAMIC_PERL))
471LIB += -lperl$(PERL_VER)
472endif
473endif
474
475ifdef TCL
476LIB += -L$(TCL)/lib
477ifeq (yes, $(DYNAMIC_TCL))
478LIB += -ltclstub$(TCL_VER)
479else
480LIB += -ltcl$(TCL_VER)
481endif
482endif
483
484ifeq (yes, $(OLE))
485LIB += -loleaut32 -lstdc++
486OBJ += $(OUTDIR)/if_ole.o
487endif
488
489ifeq (yes, $(MBYTE))
490DEFINES += -DFEAT_MBYTE
491endif
492
493ifeq (yes, $(IME))
494DEFINES += -DFEAT_MBYTE_IME
495ifeq (yes, $(DYNAMIC_IME))
496DEFINES += -DDYNAMIC_IME
497else
498LIB += -limm32
499endif
500endif
501
502ifdef ICONV
503ifneq (yes, $(ICONV))
504LIB += -L$(ICONV)
505CFLAGS += -I$(ICONV)
506endif
507DEFINES+=-DDYNAMIC_ICONV
508endif
509
510all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
511
512vimrun.exe: vimrun.c
513 $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB)
514
515install.exe: dosinst.c
516 $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
517
518uninstal.exe: uninstal.c
519 $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
520
521$(TARGET): $(OUTDIR) $(OBJ)
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000522 $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(RUBYLIB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000523
524upx: exes
525 upx gvim.exe
526 upx vim.exe
527
528xxd/xxd.exe: xxd/xxd.c
529 $(MAKE) -C xxd -f Make_cyg.mak
530
531GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
532 $(MAKE) -C GvimExt -f Make_ming.mak
533
534clean:
535 -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
536 -$(DEL) $(OUTDIR)$(DIRSLASH)*.res
537 -rmdir $(OUTDIR)
538 -$(DEL) *.exe
539 -$(DEL) pathdef.c
540ifdef PERL
541 -$(DEL) if_perl.c
542endif
543 $(MAKE) -C GvimExt -f Make_ming.mak clean
544 $(MAKE) -C xxd -f Make_cyg.mak clean
545
546###########################################################################
547INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
548 structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \
549 gui.h
550
551$(OUTDIR)/%.o : %.c $(INCL)
552 $(CC) -c $(CFLAGS) $< -o $@
553
554$(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h
555 $(WINDRES) $(DEFINES) vim.rc $(OUTDIR)/vimres.res
556
557$(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res
558 $(WINDRES) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
559
560$(OUTDIR):
Bram Moolenaar0cf6f542005-01-16 21:59:36 +0000561 $(MKDIR) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000562
563$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
564 $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
565
566$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
567 $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
568
569$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
570 $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
571
572$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
573 $(CC) $(CFLAGS) -D__IID_DEFINED__ -c -o $(OUTDIR)/if_ole.o if_ole.cpp
574
575$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
576ifeq (16, $(RUBY))
577 $(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
578endif
579
580if_perl.c: if_perl.xs typemap
581 perl $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
582 $(PERLLIB)/ExtUtils/typemap if_perl.xs > $@
583
584$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
585 $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
586
587pathdef.c: $(INCL)
588ifneq (sh.exe, $(SHELL))
589 @echo creating pathdef.c
590 @echo '/* pathdef.c */' > pathdef.c
591 @echo '#include "vim.h"' >> pathdef.c
592 @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
593 @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
594 @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
Bram Moolenaara40c5002005-01-09 21:16:21 +0000595 @echo 'char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(RUBYLIB)";' >> pathdef.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000596 @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
597 @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
598else
599 @echo creating pathdef.c
600 @echo /* pathdef.c */ > pathdef.c
601 @echo #include "vim.h" >> pathdef.c
602 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
603 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
604 @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
Bram Moolenaara40c5002005-01-09 21:16:21 +0000605 @echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(RUBYLIB)"; >> pathdef.c
Bram Moolenaar071d4272004-06-13 20:20:40 +0000606 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
607 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
608endif