blob: a27ce520894009eb870c9b8ec0c3053315021fb6 [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 Moolenaar325b7a22004-07-05 15:58:32 +0000122# c:/windows/system32 isn't a good idea, use some other dir;
123# to build you can put them in temp dir)
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000124ifndef MZSCHEME_DLLS
125MZSCHEME_DLLS=$(MZSCHEME)
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000126endif
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000127MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS)
128endif
129
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000130endif
131
Bram Moolenaar071d4272004-06-13 20:20:40 +0000132# Python support -- works with the ActiveState python 2.0 release (and others
133# too, probably)
134#
135# uncomment 'PYTHON' to make python-enabled version
136# Put the path to the python distro here. If cross compiling from Linux, you
137# will also need to convert the header files to unix instead of dos format:
138# for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
139# and also, you will need to make a mingw32 'libpython20.a' to link with:
140# cd $PYTHON/libs
141# pexports python20.dll > python20.def
142# dlltool -d python20.def -l libpython20.a
143# on my Linux box, I put the Python stuff here:
144#PYTHON=/home/ron/ActivePython-2.0.0-202/src/Core
145# on my NT box, it's here:
146#PYTHON=c:/python20
147
148ifdef PYTHON
149ifndef DYNAMIC_PYTHON
150DYNAMIC_PYTHON=yes
151endif
152
153ifndef PYTHON_VER
154PYTHON_VER=22
155endif
156
157ifeq (no,$(DYNAMIC_PYTHON))
158PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
159endif
160# my include files are in 'win32inc' on Linux, and 'include' in the standard
161# NT distro (ActiveState)
162ifeq ($(CROSS),no)
163PYTHONINC=-I $(PYTHON)/include
164else
165PYTHONINC=-I $(PYTHON)/win32inc
166endif
167endif
168
169# TCL interface:
170# TCL=[Path to TCL directory]
171# DYNAMIC_TCL=yes (to load the TCL DLL dynamically)
172# TCL_VER=[TCL version, eg 83, 84] (default is 83)
173#TCL=c:/tcl
174ifdef TCL
175ifndef DYNAMIC_TCL
176DYNAMIC_TCL=yes
177endif
178ifndef TCL_VER
179TCL_VER = 83
180endif
181TCLINC += -I$(TCL)/include
182endif
183
184
185# Ruby interface:
186# RUBY=[Path to Ruby directory]
187# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
188# RUBY_VER=[Ruby version, eg 16, 17] (default is 16)
189# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.6)
190# You must set RUBY_VER_LONG when change RUBY_VER.
191#RUBY=c:/ruby
192ifdef RUBY
193ifndef DYNAMIC_RUBY
194DYNAMIC_RUBY=yes
195endif
196# Set default value
197ifndef RUBY_VER
198RUBY_VER = 16
199endif
200ifndef RUBY_VER_LONG
201RUBY_VER_LONG = 1.6
202endif
203
204ifeq ($(RUBY_VER), 16)
205ifndef RUBY_PLATFORM
206RUBY_PLATFORM = i586-mswin32
207endif
208ifndef RUBY_INSTALL_NAME
209RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
210endif
211else
212ifndef RUBY_PLATFORM
213RUBY_PLATFORM = i386-mswin32
214endif
215ifndef RUBY_INSTALL_NAME
216RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
217endif
218endif
219
220RUBYINC =-I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
221ifeq (no, $(DYNAMIC_RUBY))
222RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
223endif
224
225endif # RUBY
226
227# See feature.h for a list of options.
228# Any other defines can be included here.
229DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
230DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
231 -DHAVE_PATHDEF -DFEAT_$(FEATURES)
232ifeq ($(CROSS),yes)
233# cross-compiler:
234CC = i586-pc-mingw32msvc-gcc
235DEL = rm
Bram Moolenaar0cf6f542005-01-16 21:59:36 +0000236MKDIR = mkdir -p
Bram Moolenaar071d4272004-06-13 20:20:40 +0000237WINDRES = i586-pc-mingw32msvc-windres
238else
239# normal (Windows) compilation:
240CC = gcc
241ifneq (sh.exe, $(SHELL))
242DEL = rm
Bram Moolenaar0cf6f542005-01-16 21:59:36 +0000243MKDIR = mkdir -p
Bram Moolenaar071d4272004-06-13 20:20:40 +0000244DIRSLASH = /
245else
246DEL = del
Bram Moolenaar0cf6f542005-01-16 21:59:36 +0000247MKDIR = mkdir
Bram Moolenaar071d4272004-06-13 20:20:40 +0000248DIRSLASH = \\
249endif
250WINDRES = windres
251endif
252
253#>>>>> end of choices
254###########################################################################
255
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000256CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
Bram Moolenaar071d4272004-06-13 20:20:40 +0000257
258ifdef GETTEXT
259DEFINES +=-DHAVE_GETTEXT -DHAVE_LOCALE_H
260GETTEXTINCLUDE = $(GETTEXT)/include
261GETTEXTLIB = $(INTLPATH)
262ifeq (yes, $(GETTEXT))
263DEFINES +=-DDYNAMIC_GETTEXT
264else
265ifdef DYNAMIC_GETTEXT
266DEFINES +=-D$(DYNAMIC_GETTEXT)
267ifdef GETTEXT_DYNAMIC
268DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
269endif
270endif
271endif
272endif
273
274ifdef PERL
275CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -L$(PERLLIBS)
276ifeq (yes, $(DYNAMIC_PERL))
277CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
278endif
279endif
280
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000281ifdef MZSCHEME
282CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\"
Bram Moolenaar281bdce2005-01-25 21:53:18 +0000283ifeq (yes, $(DYNAMIC_MZSCHEME))
284CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libmzsch$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
285endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000286endif
287
Bram Moolenaar071d4272004-06-13 20:20:40 +0000288ifdef RUBY
289CFLAGS += -DFEAT_RUBY $(RUBYINC)
290ifeq (yes, $(DYNAMIC_RUBY))
291CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
292CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
293endif
294endif
295
296ifdef PYTHON
297CFLAGS += -DFEAT_PYTHON $(PYTHONINC)
298ifeq (yes, $(DYNAMIC_PYTHON))
299CFLAGS += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
300endif
301endif
302
303ifdef TCL
304CFLAGS += -DFEAT_TCL $(TCLINC)
305ifeq (yes, $(DYNAMIC_TCL))
306CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
307endif
308endif
309
310ifeq ($(POSTSCRIPT),yes)
311DEFINES += -DMSWINPS
312endif
313
314ifeq (yes, $(OLE))
315DEFINES += -DFEAT_OLE
316endif
317
318ifeq ($(CSCOPE),yes)
319DEFINES += -DFEAT_CSCOPE
320endif
321
322ifeq ($(NETBEANS),yes)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000323# Only allow NETBEANS for a GUI build.
324ifeq (yes, $(GUI))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000325DEFINES += -DFEAT_NETBEANS_INTG
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000326
327ifeq ($(NBDEBUG), yes)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000328DEFINES += -DNBDEBUG
329NBDEBUG_INCL = nbdebug.h
330NBDEBUG_SRC = nbdebug.c
331endif
332endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000333endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000334
335ifdef XPM
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000336# Only allow XPM for a GUI build.
337ifeq (yes, $(GUI))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000338CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include
339endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000340endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000341
342ifeq ($(DEBUG),yes)
343CFLAGS += -g -fstack-check
344DEBUG_SUFFIX=d
345else
346ifeq ($(OPTIMIZE), SIZE)
347CFLAGS += -Os
348else
349ifeq ($(OPTIMIZE), MAXSPEED)
350CFLAGS += -O3
Bram Moolenaar1cd871b2004-12-19 22:46:22 +0000351CFLAGS += -fomit-frame-pointer -freg-struct-return
Bram Moolenaar071d4272004-06-13 20:20:40 +0000352else # SPEED
353CFLAGS += -O2
354endif
355endif
356CFLAGS += -s
357endif
358
359LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32
360GUIOBJ = $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/os_w32exe.o
361OBJ = \
362 $(OUTDIR)/buffer.o \
363 $(OUTDIR)/charset.o \
364 $(OUTDIR)/diff.o \
365 $(OUTDIR)/digraph.o \
366 $(OUTDIR)/edit.o \
367 $(OUTDIR)/eval.o \
368 $(OUTDIR)/ex_cmds.o \
369 $(OUTDIR)/ex_cmds2.o \
370 $(OUTDIR)/ex_docmd.o \
371 $(OUTDIR)/ex_eval.o \
372 $(OUTDIR)/ex_getln.o \
373 $(OUTDIR)/fileio.o \
374 $(OUTDIR)/fold.o \
375 $(OUTDIR)/getchar.o \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000376 $(OUTDIR)/hashtable.o \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000377 $(OUTDIR)/main.o \
378 $(OUTDIR)/mark.o \
379 $(OUTDIR)/memfile.o \
380 $(OUTDIR)/memline.o \
381 $(OUTDIR)/menu.o \
382 $(OUTDIR)/message.o \
383 $(OUTDIR)/misc1.o \
384 $(OUTDIR)/misc2.o \
385 $(OUTDIR)/move.o \
386 $(OUTDIR)/mbyte.o \
387 $(OUTDIR)/normal.o \
388 $(OUTDIR)/ops.o \
389 $(OUTDIR)/option.o \
390 $(OUTDIR)/os_win32.o \
391 $(OUTDIR)/os_mswin.o \
392 $(OUTDIR)/pathdef.o \
393 $(OUTDIR)/quickfix.o \
394 $(OUTDIR)/regexp.o \
395 $(OUTDIR)/screen.o \
396 $(OUTDIR)/search.o \
397 $(OUTDIR)/syntax.o \
398 $(OUTDIR)/tag.o \
399 $(OUTDIR)/term.o \
400 $(OUTDIR)/ui.o \
401 $(OUTDIR)/undo.o \
402 $(OUTDIR)/version.o \
403 $(OUTDIR)/vimrc.o \
404 $(OUTDIR)/window.o
405
406ifdef PERL
407OBJ += $(OUTDIR)/if_perl.o
408endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000409ifdef MZSCHEME
410OBJ += $(OUTDIR)/if_mzsch.o
411MZSCHEME_INCL = if_mzsch.h
412endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000413ifdef PYTHON
414OBJ += $(OUTDIR)/if_python.o
415endif
416ifdef RUBY
417OBJ += $(OUTDIR)/if_ruby.o
418endif
419ifdef TCL
420OBJ += $(OUTDIR)/if_tcl.o
421endif
422ifeq ($(CSCOPE),yes)
423OBJ += $(OUTDIR)/if_cscope.o
424endif
425ifeq ($(NETBEANS),yes)
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000426# Only allow NETBEANS for a GUI build.
427ifeq (yes, $(GUI))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000428OBJ += $(OUTDIR)/netbeans.o $(OUTDIR)/gui_beval.o
429LIB += -lwsock32
430endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000431endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000432ifdef XPM
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000433# Only allow XPM for a GUI build.
434ifeq (yes, $(GUI))
Bram Moolenaar071d4272004-06-13 20:20:40 +0000435OBJ += $(OUTDIR)/xpm_w32.o
436# You'll need libXpm.a from http://gnuwin32.sf.net
437LIB += -L $(XPM)/lib -lXpm
438endif
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000439endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000440
441
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000442ifdef MZSCHEME
443MZSCHEME_SUFFIX = Z
444endif
445
Bram Moolenaar071d4272004-06-13 20:20:40 +0000446ifeq ($(GUI),yes)
447TARGET := gvim$(DEBUG_SUFFIX).exe
448DEFINES += $(DEF_GUI)
449OBJ += $(GUIOBJ)
450LFLAGS += -mwindows
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000451OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000452else
453TARGET := vim$(DEBUG_SUFFIX).exe
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000454OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000455endif
456
457ifdef GETTEXT
458ifneq (yes, $(GETTEXT))
459CFLAGS += -I$(GETTEXTINCLUDE)
460ifndef STATIC_GETTEXT
461LIB += -L$(GETTEXTLIB) -l$(INTLLIB)
462ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT))
463OBJ+=$(SAFE_GETTEXT_DLL_OBJ)
464endif
465else
466LIB += -L$(GETTEXTLIB) -lintl
467endif
468endif
469endif
470
471ifdef PERL
472ifeq (no, $(DYNAMIC_PERL))
473LIB += -lperl$(PERL_VER)
474endif
475endif
476
477ifdef TCL
478LIB += -L$(TCL)/lib
479ifeq (yes, $(DYNAMIC_TCL))
480LIB += -ltclstub$(TCL_VER)
481else
482LIB += -ltcl$(TCL_VER)
483endif
484endif
485
486ifeq (yes, $(OLE))
487LIB += -loleaut32 -lstdc++
488OBJ += $(OUTDIR)/if_ole.o
489endif
490
491ifeq (yes, $(MBYTE))
492DEFINES += -DFEAT_MBYTE
493endif
494
495ifeq (yes, $(IME))
496DEFINES += -DFEAT_MBYTE_IME
497ifeq (yes, $(DYNAMIC_IME))
498DEFINES += -DDYNAMIC_IME
499else
500LIB += -limm32
501endif
502endif
503
504ifdef ICONV
505ifneq (yes, $(ICONV))
506LIB += -L$(ICONV)
507CFLAGS += -I$(ICONV)
508endif
509DEFINES+=-DDYNAMIC_ICONV
510endif
511
512all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
513
514vimrun.exe: vimrun.c
515 $(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB)
516
517install.exe: dosinst.c
518 $(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
519
520uninstal.exe: uninstal.c
521 $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
522
523$(TARGET): $(OUTDIR) $(OBJ)
Bram Moolenaarc0197e22004-09-13 20:26:32 +0000524 $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(RUBYLIB)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000525
526upx: exes
527 upx gvim.exe
528 upx vim.exe
529
530xxd/xxd.exe: xxd/xxd.c
531 $(MAKE) -C xxd -f Make_cyg.mak
532
533GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
534 $(MAKE) -C GvimExt -f Make_ming.mak
535
536clean:
537 -$(DEL) $(OUTDIR)$(DIRSLASH)*.o
538 -$(DEL) $(OUTDIR)$(DIRSLASH)*.res
539 -rmdir $(OUTDIR)
540 -$(DEL) *.exe
541 -$(DEL) pathdef.c
542ifdef PERL
543 -$(DEL) if_perl.c
544endif
545 $(MAKE) -C GvimExt -f Make_ming.mak clean
546 $(MAKE) -C xxd -f Make_cyg.mak clean
547
548###########################################################################
549INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
550 structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \
551 gui.h
552
553$(OUTDIR)/%.o : %.c $(INCL)
554 $(CC) -c $(CFLAGS) $< -o $@
555
556$(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h
557 $(WINDRES) $(DEFINES) vim.rc $(OUTDIR)/vimres.res
558
559$(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res
560 $(WINDRES) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
561
562$(OUTDIR):
Bram Moolenaar0cf6f542005-01-16 21:59:36 +0000563 $(MKDIR) $(OUTDIR)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000564
565$(OUTDIR)/ex_docmd.o: ex_docmd.c $(INCL) ex_cmds.h
566 $(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
567
568$(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
569 $(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
570
571$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
572 $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
573
574$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
575 $(CC) $(CFLAGS) -D__IID_DEFINED__ -c -o $(OUTDIR)/if_ole.o if_ole.cpp
576
577$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
578ifeq (16, $(RUBY))
579 $(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
580endif
581
582if_perl.c: if_perl.xs typemap
583 perl $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
584 $(PERLLIB)/ExtUtils/typemap if_perl.xs > $@
585
586$(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
587 $(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
588
589pathdef.c: $(INCL)
590ifneq (sh.exe, $(SHELL))
591 @echo creating pathdef.c
592 @echo '/* pathdef.c */' > pathdef.c
593 @echo '#include "vim.h"' >> pathdef.c
594 @echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
595 @echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
596 @echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
Bram Moolenaara40c5002005-01-09 21:16:21 +0000597 @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 +0000598 @echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
599 @echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
600else
601 @echo creating pathdef.c
602 @echo /* pathdef.c */ > pathdef.c
603 @echo #include "vim.h" >> pathdef.c
604 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
605 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
606 @echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
Bram Moolenaara40c5002005-01-09 21:16:21 +0000607 @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 +0000608 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
609 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
610endif