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