blob: 8ee77b63c1082fb052695af0be325a0eff202890 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001# Makefile for Vim on Win32 (Windows NT and Windows 95), using the
2# Microsoft Visual C++ 2.x and MSVC 4.x compilers (or newer).
3# It builds on Windows 95 and all four NT platforms: i386, Alpha, MIPS, and
4# PowerPC. The NT/i386 binary and the Windows 95 binary are identical.
5#
6# This makefile can build the console, GUI, OLE-enable, Perl-enabled and
7# Python-enabled versions of vim for Win32 platforms.
8#
9# When compiling different versions, do "nmake clean" first!
10#
11# The basic command line to build vim is:
12# nmake -f Make_mvc.mak
13# This will build the console version of vim with no additional interfaces.
14# To add interfaces, define any of the following:
15# GUI interface: GUI=yes (default is no)
16# OLE interface: OLE=yes (usually with GUI=yes)
17# Multibyte support: MBYTE=yes
18# IME support: IME=yes (requires GUI=yes)
19# DYNAMIC_IME=[yes or no] (to load the imm32.dll dynamically, default
20# is yes)
21# Global IME support: GIME=yes (requires GUI=yes)
22# Perl interface:
23# PERL=[Path to Perl directory]
24# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
25# PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc] (default is 56)
26# Python interface:
27# PYTHON=[Path to Python directory]
28# DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
29# PYTHON_VER=[Python version, eg 15, 20] (default is 22)
30# Ruby interface:
31# RUBY=[Path to Ruby directory]
32# DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
33# RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
34# RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
35# You must set RUBY_VER_LONG when change RUBY_VER.
36# Tcl interface:
37# TCL=[Path to Tcl directory]
38# DYNAMIC_TCL=yes (to load the Tcl DLL dynamically)
39# TCL_VER=[Tcl version, e.g. 80, 83] (default is 83)
40# TCL_VER_LONG=[Tcl version, eg 8.3] (default is 8.3)
41# You must set TCL_VER_LONG when you set TCL_VER.
42# Debug version: DEBUG=yes
43# Mapfile: MAP=[no, yes or lines] (default is yes)
44# no: Don't write a mapfile.
45# yes: Write a normal mapfile.
46# lines: Write a mapfile with line numbers (only for VC6 and later)
47# SNiFF+ interface: SNIFF=yes
48# Cscope support: CSCOPE=yes
49# Iconv library support (always dynamically loaded):
50# ICONV=[yes or no] (default is yes)
51# Intl library support (always dynamically loaded):
52# GETTEXT=[yes or no] (default is yes)
53# See http://sourceforge.net/projects/gettext/
54# PostScript printing: POSTSCRIPT=yes (default is no)
55# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, or HUGE] (default is BIG)
56# Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
57# Processor Version: CPUNR=[i386, i486, i586, i686] (default is i386)
58# Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
59# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
60# XPM Image Support: XPM=[path to XPM directory]
61#
62# You can combine any of these interfaces
63#
64# Example: To build the non-debug, GUI version with Perl interface:
65# nmake -f Make_mvc.mak GUI=yes PERL=C:\Perl
66#
67# To build using Borland C++, use Make_bc3.mak or Make_bc5.mak.
68#
69# DEBUG with Make_mvc.mak and Make_dvc.mak:
70# This makefile gives a fineness of control which is not supported in
71# Visual C++ configuration files. Therefore, debugging requires a bit of
72# extra work.
73# Make_dvc.mak is a Visual C++ project to access that support.
74# To use Make_dvc.mak:
75# 1) Build Vim with Make_mvc.mak.
76# Use a "DEBUG=yes" argument to build Vim with debug support.
77# E.g. the following builds gvimd.exe:
78# nmake -f Make_mvc.mak debug=yes gui=yes
79# 2) Use MS Devstudio and set it up to allow that file to be debugged:
80# i) Pass Make_dvc.mak to the IDE.
81# Use the "open workspace" menu entry to load Make_dvc.mak.
82# Alternatively, from the command line:
83# msdev /nologo Make_dvc.mak
84# Note: Make_dvc.mak is in VC4.0 format. Later VC versions see
85# this and offer to convert it to their own format. Accept that.
86# It creates a file called Make_dvc.dsw which can then be used
87# for further operations. E.g.
88# msdev /nologo Make_dvc.dsw
89# ii) Set the built executable for debugging:
90# a) Alt+F7/Debug takes you to the Debug dialog.
91# b) Fill "Executable for debug session". e.g. gvimd.exe
92# c) Fill "Program arguments". e.g. -R dosinst.c
93# d) Complete the dialog
94# 3) You can now debug the executable you built with Make_mvc.mak
95#
96# Note: Make_dvc.mak builds vimrun.exe, because it must build something
97# to be a valid makefile..
98
99### See feature.h for a list of optionals.
100# If you want to build some optional features without modifying the source,
101# you can set DEFINES on the command line, e.g.,
102# nmake -f makefile.mvc "DEFINES=-DEMACS_TAGS"
103
104# Build on both Windows NT and Windows 95
105
106TARGETOS = BOTH
107
108# Select one of eight object code directories, depends on GUI, OLE and DEBUG.
109# If you change something else, do "make clean" first!
110!if "$(GUI)" == "yes"
111OBJDIR = .\ObjG
112!else
113OBJDIR = .\ObjC
114!endif
115!if "$(OLE)" == "yes"
116OBJDIR = $(OBJDIR)O
117!endif
118!if "$(DEBUG)" == "yes"
119OBJDIR = $(OBJDIR)d
120!endif
121
122# ntwin32.mak requires that CPU be set appropriately
123
124!ifdef PROCESSOR_ARCHITECTURE
125# We're on Windows NT or using VC 6
126CPU = $(PROCESSOR_ARCHITECTURE)
127! if "$(CPU)" == "x86"
128CPU = i386
129! endif
130!else # !PROCESSOR_ARCHITECTURE
131# We're on Windows 95
132CPU = i386
133!endif # !PROCESSOR_ARCHITECTURE
134
135
136# Build a retail version by default
137
138!if "$(DEBUG)" != "yes"
139NODEBUG = 1
140!else
141MAKEFLAGS_GVIMEXT = DEBUG=yes
142!endif
143
144
145# Build a multithreaded version for the Windows 95 dead keys hack
146# Commented out because it doesn't work.
147# MULTITHREADED = 1
148
149
150# Get all sorts of useful, standard macros from the SDK. (Note that
151# MSVC 2.2 does not install <ntwin32.mak> in the \msvc20\include
152# directory, but you can find it in \msvc20\include on the CD-ROM.
153# You may also need <win32.mak> from the same place.)
154
155!include <ntwin32.mak>
156
157
158#>>>>> path of the compiler and linker; name of include and lib directories
159# PATH = c:\msvc20\bin;$(PATH)
160# INCLUDE = c:\msvc20\include
161# LIB = c:\msvc20\lib
162
163!ifndef CTAGS
164CTAGS = ctags
165!endif
166
167!if "$(SNIFF)" == "yes"
168# SNIFF - Include support for SNiFF+.
169SNIFF_INCL = if_sniff.h
170SNIFF_OBJ = $(OBJDIR)/if_sniff.obj
171SNIFF_LIB = shell32.lib
172SNIFF_DEFS = -DFEAT_SNIFF
173# The SNiFF integration needs multithreaded libraries!
174MULTITHREADED = yes
175!endif
176
177!ifndef CSCOPE
178CSCOPE = yes
179!endif
180
181!if "$(CSCOPE)" == "yes"
182# CSCOPE - Include support for Cscope
183CSCOPE_INCL = if_cscope.h
184CSCOPE_OBJ = $(OBJDIR)/if_cscope.obj
185CSCOPE_DEFS = -DFEAT_CSCOPE
186!endif
187
188!ifndef NETBEANS
189NETBEANS = $(GUI)
190!endif
191
192!if "$(NETBEANS)" == "yes"
193# NETBEANS - Include support for Netbeans integration
194NETBEANS_PRO = proto/netbeans.pro
195NETBEANS_OBJ = $(OBJDIR)/netbeans.obj $(OBJDIR)/gui_beval.obj
196NETBEANS_DEFS = -DFEAT_NETBEANS_INTG
197!if "$(DEBUG)" == "yes"
198NBDEBUG_DEFS = -DNBDEBUG
199NBDEBUG_INCL = nbdebug.h
200NBDEBUG_SRC = nbdebug.c
201!endif
202NETBEANS_LIB = WSock32.lib
203!endif
204
205!ifdef XPM
206# XPM - Include support for XPM signs
207# you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself
208XPM_OBJ = $(OBJDIR)/xpm_w32.obj
209XPM_DEFS = -DFEAT_XPM_W32
210XPM_LIB = $(XPM)\lib\libXpm.lib
211XPM_INC = -I $(XPM)\include
212!endif
213
214!if defined(USE_MSVCRT)
215CVARS = $(cvarsdll)
216!elseif defined(MULTITHREADED)
217CVARS = $(cvarsmt)
218!else
219CVARS = $(cvars)
220!endif
221
222# need advapi32.lib for GetUserName()
223# need shell32.lib for ExtractIcon()
224# gdi32.lib and comdlg32.lib for printing support
225# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
226CON_LIB = advapi32.lib shell32.lib gdi32.lib comdlg32.lib ole32.lib uuid.lib
227!if "$(VC6)" == "yes"
228CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
229!endif
230
231### Set the default $(WINVER) to make it work with VC++7.0 (VS.NET)
232# When set to 0x0500 ":browse" stops working.
233!ifndef WINVER
234WINVER = 0x0400
235!endif
236
237# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
238# default, use these lines.
239#VIMRCLOC = somewhere
240#VIMRUNTIMEDIR = somewhere
241
242CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
243 $(SNIFF_DEFS) $(CSCOPE_DEFS) $(NETBEANS_DEFS) \
244 $(NBDEBUG_DEFS) $(XPM_DEFS) \
245 $(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
246
247#>>>>> end of choices
248###########################################################################
249
250!ifdef OS
251OS_TYPE = winnt
252DEL_TREE = rmdir /s /q
253!else
254OS_TYPE = win95
255DEL_TREE = deltree /y
256!endif
257
258INTDIR=$(OBJDIR)
259OUTDIR=$(OBJDIR)
260
261# Convert processor ID to MVC-compatible number
262!if "$(CPUNR)" == "i386"
263CPUARG = /G3
264!elseif "$(CPUNR)" == "i486"
265CPUARG = /G4
266!elseif "$(CPUNR)" == "i586"
267CPUARG = /G5
268!elseif "$(CPUNR)" == "i686"
269CPUARG = /G6
270!else
271CPUARG =
272!endif
273
274!ifdef NODEBUG
275VIM = vim
276!if "$(OPTIMIZE)" == "SPACE"
277OPTFLAG = /O1
278!elseif "$(OPTIMIZE)" == "SPEED"
279OPTFLAG = /O2
280!else # MAXSPEED
281OPTFLAG = /Ox
282!endif
283CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG /Zi $(CPUARG)
284RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
285PDB = /Fd$(OUTDIR)/
286LINK_PDB = /PDB:$(OUTDIR)/
287! ifdef USE_MSVCRT
288CFLAGS = $(CFLAGS) -MD
289LIBC = msvcrt.lib
290! elseif defined(MULTITHREADED)
291LIBC = libcmt.lib
292! else
293LIBC = libc.lib
294! endif
295!else # DEBUG
296VIM = vimd
297# MSVC 4.1
298PDB = /Fd$(OUTDIR)/
299LINK_PDB = /PDB:$(OUTDIR)/
300# MSVC 2.2
301# PDB = /Fd$(OUTDIR)/vim.pdb
302# LINK_PDB = /PDB:$(OUTDIR)/vim.pdb
303CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Zi /Od
304RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
305# The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
306! if "$(_NMAKE_VER)" == ""
307LIBC =
308! else
309LIBC = /fixed:no
310! endif
311
312! ifndef USE_MSVCRT
313LIBC = $(LIBC) libcd.lib
314! else
315CFLAGS = $(CFLAGS) -MDd
316LIBC = $(LIBC) msvcrtd.lib
317! endif
318!endif # DEBUG
319
320INCL = vim.h os_win32.h ascii.h feature.h globals.h keymap.h macros.h \
321 proto.h option.h structs.h term.h $(SNIFF_INCL) $(CSCOPE_INCL) \
322 $(NBDEBUG_INCL)
323
324OBJ = \
325 $(OUTDIR)\buffer.obj \
326 $(OUTDIR)\charset.obj \
327 $(OUTDIR)\diff.obj \
328 $(OUTDIR)\digraph.obj \
329 $(OUTDIR)\edit.obj \
330 $(OUTDIR)\eval.obj \
331 $(OUTDIR)\ex_cmds.obj \
332 $(OUTDIR)\ex_cmds2.obj \
333 $(OUTDIR)\ex_docmd.obj \
334 $(OUTDIR)\ex_eval.obj \
335 $(OUTDIR)\ex_getln.obj \
336 $(OUTDIR)\fileio.obj \
337 $(OUTDIR)\fold.obj \
338 $(OUTDIR)\getchar.obj \
339 $(OUTDIR)\main.obj \
340 $(OUTDIR)\mark.obj \
341 $(OUTDIR)\mbyte.obj \
342 $(OUTDIR)\memfile.obj \
343 $(OUTDIR)\memline.obj \
344 $(OUTDIR)\menu.obj \
345 $(OUTDIR)\message.obj \
346 $(OUTDIR)\misc1.obj \
347 $(OUTDIR)\misc2.obj \
348 $(OUTDIR)\move.obj \
349 $(OUTDIR)\normal.obj \
350 $(OUTDIR)\ops.obj \
351 $(OUTDIR)\option.obj \
352 $(OUTDIR)\os_mswin.obj \
353 $(OUTDIR)\os_win32.obj \
354 $(OUTDIR)\pathdef.obj \
355 $(OUTDIR)\quickfix.obj \
356 $(OUTDIR)\regexp.obj \
357 $(OUTDIR)\screen.obj \
358 $(OUTDIR)\search.obj \
359 $(OUTDIR)\syntax.obj \
360 $(OUTDIR)\tag.obj \
361 $(OUTDIR)\term.obj \
362 $(OUTDIR)\ui.obj \
363 $(OUTDIR)\undo.obj \
364 $(OUTDIR)\window.obj \
365 $(OUTDIR)\vim.res
366
367!if "$(OLE)" == "yes"
368CFLAGS = $(CFLAGS) -DFEAT_OLE
369RCFLAGS = $(RCFLAGS) -DFEAT_OLE
370OLE_OBJ = $(OUTDIR)\if_ole.obj
371OLE_IDL = if_ole.idl
372OLE_LIB = oleaut32.lib
373!endif
374
375!if "$(IME)" == "yes"
376CFLAGS = $(CFLAGS) -DFEAT_MBYTE_IME
377!ifndef DYNAMIC_IME
378DYNAMIC_IME = yes
379!endif
380!if "$(DYNAMIC_IME)" == "yes"
381CFLAGS = $(CFLAGS) -DDYNAMIC_IME
382!else
383IME_LIB = imm32.lib
384!endif
385!endif
386
387!if "$(GIME)" == "yes"
388CFLAGS = $(CFLAGS) -DGLOBAL_IME
389OBJ = $(OBJ) $(OUTDIR)\dimm_i.obj $(OUTDIR)\glbl_ime.obj
390MBYTE = yes
391!endif
392
393!if "$(MBYTE)" == "yes"
394CFLAGS = $(CFLAGS) -DFEAT_MBYTE
395!endif
396
397!if "$(GUI)" == "yes"
398SUBSYSTEM = windows
399CFLAGS = $(CFLAGS) -DFEAT_GUI_W32
400RCFLAGS = $(RCFLAGS) -DFEAT_GUI_W32
401VIM = g$(VIM)
402GUI_INCL = \
403 gui.h \
404 regexp.h \
405 ascii.h \
406 ex_cmds.h \
407 farsi.h \
408 feature.h \
409 globals.h \
410 keymap.h \
411 macros.h \
412 option.h \
413 os_dos.h \
414 os_win32.h
415GUI_OBJ = \
416 $(OUTDIR)\gui.obj \
417 $(OUTDIR)\gui_w32.obj \
418 $(OUTDIR)\os_w32exe.obj
419GUI_LIB = \
420 oldnames.lib kernel32.lib gdi32.lib $(IME_LIB) \
421 winspool.lib comctl32.lib advapi32.lib shell32.lib \
422 /machine:$(CPU) /nodefaultlib
423!else
424SUBSYSTEM = console
425!endif
426
427# iconv.dll library (dynamically loaded)
428!ifndef ICONV
429ICONV = yes
430!endif
431!if "$(ICONV)" == "yes"
432CFLAGS = $(CFLAGS) -DDYNAMIC_ICONV
433!endif
434
435# libintl.dll library
436!ifndef GETTEXT
437GETTEXT = yes
438!endif
439!if "$(GETTEXT)" == "yes"
440CFLAGS = $(CFLAGS) -DDYNAMIC_GETTEXT
441!endif
442
443# TCL interface
444!ifdef TCL
445!ifndef TCL_VER
446TCL_VER = 83
447TCL_VER_LONG = 8.3
448!endif
449!message Tcl requested (version $(TCL_VER)) - root dir is "$(TCL)"
450!if "$(DYNAMIC_TCL)" == "yes"
451!message Tcl DLL will be loaded dynamically
452TCL_DLL = tcl$(TCL_VER).dll
453CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
454TCL_OBJ = $(OUTDIR)\if_tcl.obj
455TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
456TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
457!else
458CFLAGS = $(CFLAGS) -DFEAT_TCL
459TCL_OBJ = $(OUTDIR)\if_tcl.obj
460TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
461TCL_LIB = $(TCL)\lib\tcl$(TCL_VER)vc.lib
462!endif
463!endif
464
465# PYTHON interface
466!ifdef PYTHON
467!ifndef PYTHON_VER
468PYTHON_VER = 22
469!endif
470!message Python requested (version $(PYTHON_VER)) - root dir is "$(PYTHON)"
471!if "$(DYNAMIC_PYTHON)" == "yes"
472!message Python DLL will be loaded dynamically
473!endif
474CFLAGS = $(CFLAGS) -DFEAT_PYTHON
475PYTHON_OBJ = $(OUTDIR)\if_python.obj
476PYTHON_INC = /I "$(PYTHON)\Include" /I "$(PYTHON)\PC"
477!if "$(DYNAMIC_PYTHON)" == "yes"
478CFLAGS = $(CFLAGS) -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
479PYTHON_LIB = /nodefaultlib:python$(PYTHON_VER).lib
480!else
481PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
482!endif
483!endif
484
485# Perl interface
486!ifdef PERL
487!ifndef PERL_VER
488PERL_VER = 56
489!endif
490!message Perl requested (version $(PERL_VER)) - root dir is "$(PERL)"
491!if "$(DYNAMIC_PERL)" == "yes"
492!if $(PERL_VER) >= 56
493!message Perl DLL will be loaded dynamically
494!else
495!message Dynamic loading is not supported for Perl versions earlier than 5.6.0
496!message Reverting to static loading...
497!undef DYNAMIC_PERL
498!endif
499!endif
500
501# Is Perl installed in architecture-specific directories?
502!if exist($(PERL)\Bin\MSWin32-x86)
503PERL_ARCH = \MSWin32-x86
504!endif
505
506PERL_INCDIR = $(PERL)\Lib$(PERL_ARCH)\Core
507
508# Version-dependent stuff
509!if $(PERL_VER) == 55
510PERL_LIB = $(PERL_INCDIR)\perl.lib
511!else
512PERL_DLL = perl$(PERL_VER).dll
513PERL_LIB = $(PERL_INCDIR)\perl$(PERL_VER).lib
514!endif
515
516CFLAGS = $(CFLAGS) -DFEAT_PERL
517
518# Do we want to load Perl dynamically?
519!if "$(DYNAMIC_PERL)" == "yes"
520CFLAGS = $(CFLAGS) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"$(PERL_DLL)\"
521!undef PERL_LIB
522!endif
523
524PERL_EXE = $(PERL)\Bin$(PERL_ARCH)\perl
525PERL_INC = /I $(PERL_INCDIR)
526PERL_OBJ = $(OUTDIR)\if_perl.obj $(OUTDIR)\if_perlsfio.obj
527XSUBPP = $(PERL)\lib\ExtUtils\xsubpp
528XSUBPP_TYPEMAP = $(PERL)\lib\ExtUtils\typemap
529
530!endif
531
532#
533# Support Ruby interface
534#
535!ifdef RUBY
536# Set default value
537!ifndef RUBY_VER
538RUBY_VER = 18
539!endif
540!ifndef RUBY_VER_LONG
541RUBY_VER_LONG = 1.8
542!endif
543
544!if $(RUBY_VER) >= 18
545!ifndef RUBY_PLATFORM
546RUBY_PLATFORM = i386-mswin32
547!endif
548!ifndef RUBY_INSTALL_NAME
549RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
550!endif
551!else
552!ifndef RUBY_PLATFORM
553RUBY_PLATFORM = i586-mswin32
554!endif
555!ifndef RUBY_INSTALL_NAME
556RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
557!endif
558!endif # $(RUBY_VER) >= 18
559
560!message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)"
561CFLAGS = $(CFLAGS) -DFEAT_RUBY
562RUBY_OBJ = $(OUTDIR)\if_ruby.obj
563RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)"
564RUBY_LIB = $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
565# Do we want to load Ruby dynamically?
566!if "$(DYNAMIC_RUBY)" == "yes"
567!message Ruby DLL will be loaded dynamically
568CFLAGS = $(CFLAGS) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\" -DDYNAMIC_RUBY_VER=$(RUBY_VER)
569!undef RUBY_LIB
570!endif
571!endif # RUBY
572
573#
574# Support PostScript printing
575#
576!if "$(POSTSCRIPT)" == "yes"
577CFLAGS = $(CFLAGS) -DMSWINPS
578!endif # POSTSCRIPT
579
580#
581# FEATURES: TINY, SMALL, NORMAL, BIG or HUGE
582#
583!if "$(FEATURES)"==""
584FEATURES = BIG
585!endif
586CFLAGS = $(CFLAGS) -DFEAT_$(FEATURES)
587
588#
589# End extra featuare include
590#
591!message
592
593conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
594
595!IF "$(MAP)" == "yes"
596# "/map" is for debugging
597conflags = $(conflags) /map
598!ELSEIF "$(MAP)" == "lines"
599# "/mapinfo:lines" is for debugging, only works for VC6 and later
600conflags = $(conflags) /map /mapinfo:lines
601!ENDIF
602
603LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
604LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
605 $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) $(TCL_LIB) \
606 $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
607
608all: $(VIM) vimrun.exe install.exe uninstal.exe xxd/xxd.exe GvimExt/gvimext.dll
609
610$(VIM): $(OUTDIR) $(OBJ) $(GUI_OBJ) $(OLE_OBJ) $(OLE_IDL) $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) version.c version.h
611 $(CC) $(CFLAGS) version.c /Fo$(OUTDIR)/version.obj $(PDB)
612 $(link) $(LINKARGS1) -out:$*.exe $(OBJ) $(GUI_OBJ) $(OLE_OBJ) \
613 $(PERL_OBJ) $(PYTHON_OBJ) $(RUBY_OBJ) $(TCL_OBJ) $(SNIFF_OBJ) \
614 $(CSCOPE_OBJ) $(NETBEANS_OBJ) $(XPM_OBJ) \
615 $(OUTDIR)\version.obj $(LINKARGS2)
616
617$(VIM).exe: $(VIM)
618
619$(OUTDIR):
620 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
621
622install.exe: dosinst.c
623 $(CC) /nologo -DNDEBUG -DWIN32 dosinst.c kernel32.lib shell32.lib ole32.lib advapi32.lib uuid.lib
624 - if exist install.exe del install.exe
625 ren dosinst.exe install.exe
626
627uninstal.exe: uninstal.c
628 $(CC) /nologo -DNDEBUG -DWIN32 uninstal.c shell32.lib advapi32.lib
629
630vimrun.exe: vimrun.c
631 $(CC) /nologo -DNDEBUG vimrun.c
632
633xxd/xxd.exe: xxd/xxd.c
634 cd xxd
635 $(MAKE) /NOLOGO -f Make_mvc.mak
636 cd ..
637
638GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
639 cd GvimExt
640 $(MAKE) /NOLOGO -f Makefile $(MAKEFLAGS_GVIMEXT)
641 cd ..
642
643
644tags: notags
645 $(CTAGS) *.c *.cpp *.h if_perl.xs proto\*.pro
646
647notags:
648 - if exist tags del tags
649
650clean:
651 - $(DEL_TREE) $(OUTDIR) auto
652 - if exist *.obj del *.obj
653 - if exist $(VIM).exe del $(VIM).exe
654 - if exist $(VIM).ilk del $(VIM).ilk
655 - if exist $(VIM).pdb del $(VIM).pdb
656 - if exist $(VIM).map del $(VIM).map
657 - if exist $(VIM).ncb del $(VIM).ncb
658 - if exist vimrun.exe del vimrun.exe
659 - if exist install.exe del install.exe
660 - if exist uninstal.exe del uninstal.exe
661 - if exist if_perl.c del if_perl.c
662 - if exist dimm.h del dimm.h
663 - if exist dimm_i.c del dimm_i.c
664 - if exist dimm.tlb del dimm.tlb
665 - if exist dosinst.exe del dosinst.exe
666 cd xxd
667 $(MAKE) /NOLOGO -f Make_mvc.mak clean
668 cd ..
669 cd GvimExt
670 $(MAKE) /NOLOGO -f Makefile clean
671 cd ..
672 cd GvimExt
673 $(MAKE) /NOLOGO -f Makefile clean
674 cd ..
675 - if exist testdir\*.out del testdir\*.out
676
677test:
678 cd testdir
679 $(MAKE) /NOLOGO -f Make_dos.mak win32
680 cd ..
681
682###########################################################################
683
684# Create a default rule for transforming .c files to .obj files in $(OUTDIR)
685# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
686!IF "$(_NMAKE_VER)" == ""
687.c{$(OUTDIR)/}.obj:
688!ELSE
689.c{$(OUTDIR)/}.obj::
690!ENDIF
691 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
692
693# Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
694# Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
695!IF "$(_NMAKE_VER)" == ""
696.cpp{$(OUTDIR)/}.obj:
697!ELSE
698.cpp{$(OUTDIR)/}.obj::
699!ENDIF
700 $(CC) $(CFLAGS) /Fo$(OUTDIR)/ $(PDB) $<
701
702$(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
703
704$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
705
706$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
707
708$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
709
710$(OUTDIR)/edit.obj: $(OUTDIR) edit.c $(INCL)
711
712$(OUTDIR)/eval.obj: $(OUTDIR) eval.c $(INCL)
713
714$(OUTDIR)/ex_cmds.obj: $(OUTDIR) ex_cmds.c $(INCL)
715
716$(OUTDIR)/ex_cmds2.obj: $(OUTDIR) ex_cmds2.c $(INCL)
717
718$(OUTDIR)/ex_docmd.obj: $(OUTDIR) ex_docmd.c $(INCL) ex_cmds.h
719
720$(OUTDIR)/ex_eval.obj: $(OUTDIR) ex_eval.c $(INCL) ex_cmds.h
721
722$(OUTDIR)/ex_getln.obj: $(OUTDIR) ex_getln.c $(INCL)
723
724$(OUTDIR)/fileio.obj: $(OUTDIR) fileio.c $(INCL)
725
726$(OUTDIR)/fold.obj: $(OUTDIR) fold.c $(INCL)
727
728$(OUTDIR)/getchar.obj: $(OUTDIR) getchar.c $(INCL)
729
730$(OUTDIR)/gui.obj: $(OUTDIR) gui.c $(INCL) $(GUI_INCL)
731
732$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
733
734$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
735
736if_perl.c : if_perl.xs typemap
737 $(PERL_EXE) $(XSUBPP) -prototypes -typemap $(XSUBPP_TYPEMAP) -typemap typemap if_perl.xs > if_perl.c
738
739$(OUTDIR)/if_perl.obj: $(OUTDIR) if_perl.c $(INCL)
740 $(CC) $(CFLAGS) $(PERL_INC) if_perl.c /Fo$(OUTDIR)/if_perl.obj $(PDB)
741
742$(OUTDIR)/if_perlsfio.obj: $(OUTDIR) if_perlsfio.c $(INCL)
743 $(CC) $(CFLAGS) $(PERL_INC) if_perlsfio.c /Fo$(OUTDIR)/if_perlsfio.obj $(PDB)
744
745$(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL)
746 $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c /Fo$(OUTDIR)/if_python.obj $(PDB)
747
748$(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h
749
750$(OUTDIR)/if_ruby.obj: $(OUTDIR) if_ruby.c $(INCL)
751 $(CC) $(CFLAGS) $(RUBY_INC) if_ruby.c /Fo$(OUTDIR)/if_ruby.obj $(PDB)
752
753$(OUTDIR)/if_sniff.obj: $(OUTDIR) if_sniff.c $(INCL)
754 $(CC) $(CFLAGS) if_sniff.c /Fo$(OUTDIR)/if_sniff.obj $(PDB)
755
756$(OUTDIR)/if_tcl.obj: $(OUTDIR) if_tcl.c $(INCL)
757 $(CC) $(CFLAGS) $(TCL_INC) if_tcl.c /Fo$(OUTDIR)/if_tcl.obj $(PDB)
758
759$(OUTDIR)/main.obj: $(OUTDIR) main.c $(INCL)
760
761$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
762
763$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
764
765$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
766
767$(OUTDIR)/menu.obj: $(OUTDIR) menu.c $(INCL)
768
769$(OUTDIR)/message.obj: $(OUTDIR) message.c $(INCL)
770
771$(OUTDIR)/misc1.obj: $(OUTDIR) misc1.c $(INCL)
772
773$(OUTDIR)/misc2.obj: $(OUTDIR) misc2.c $(INCL)
774
775$(OUTDIR)/move.obj: $(OUTDIR) move.c $(INCL)
776
777$(OUTDIR)/mbyte.obj: $(OUTDIR) mbyte.c $(INCL)
778
779$(OUTDIR)/netbeans.obj: $(OUTDIR) netbeans.c $(NBDEBUG_SRC) $(INCL)
780
781$(OUTDIR)/normal.obj: $(OUTDIR) normal.c $(INCL)
782
783$(OUTDIR)/option.obj: $(OUTDIR) option.c $(INCL)
784
785$(OUTDIR)/ops.obj: $(OUTDIR) ops.c $(INCL)
786
787$(OUTDIR)/os_mswin.obj: $(OUTDIR) os_mswin.c $(INCL)
788
789$(OUTDIR)/os_win32.obj: $(OUTDIR) os_win32.c $(INCL) os_win32.h
790
791$(OUTDIR)/os_w32exe.obj: $(OUTDIR) os_w32exe.c $(INCL)
792
793$(OUTDIR)/pathdef.obj: $(OUTDIR) auto/pathdef.c $(INCL)
794 $(CC) $(CFLAGS) auto/pathdef.c /Fo$(OUTDIR)/pathdef.obj $(PDB)
795
796$(OUTDIR)/quickfix.obj: $(OUTDIR) quickfix.c $(INCL)
797
798$(OUTDIR)/regexp.obj: $(OUTDIR) regexp.c $(INCL)
799
800$(OUTDIR)/screen.obj: $(OUTDIR) screen.c $(INCL)
801
802$(OUTDIR)/search.obj: $(OUTDIR) search.c $(INCL)
803
804$(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL)
805
806$(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL)
807
808$(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL)
809
810$(OUTDIR)/ui.obj: $(OUTDIR) ui.c $(INCL)
811
812$(OUTDIR)/undo.obj: $(OUTDIR) undo.c $(INCL)
813
814$(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
815
816$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
817 $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c /Fo$(OUTDIR)/xpm_w32.obj $(PDB)
818
819$(OUTDIR)/vim.res: $(OUTDIR) vim.rc version.h tools.bmp tearoff.bmp vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
820 $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
821
822iid_ole.c if_ole.h vim.tlb: if_ole.idl $(INTDIR) $(OUTDIR)
823 midl /nologo /proxy nul /iid iid_ole.c /tlb vim.tlb /header if_ole.h if_ole.idl
824
825dimm.h dimm_i.c: dimm.idl
826 midl /nologo /proxy nul dimm.idl
827
828$(OUTDIR)/dimm_i.obj: $(OUTDIR) dimm_i.c $(INCL)
829
830$(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL)
831
832auto/pathdef.c: auto
833 @echo creating auto/pathdef.c
834 @echo /* pathdef.c */ > auto\pathdef.c
835 @echo #include "vim.h" >> auto\pathdef.c
836 @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> auto\pathdef.c
837 @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> auto\pathdef.c
838 @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(CFLAGS)"; >> auto\pathdef.c
839 @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> auto\pathdef.c
840 @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> auto\pathdef.c
841 @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> auto\pathdef.c
842
843auto:
844 if not exist auto/nul mkdir auto
845
846# End Custom Build
847proto.h: \
848 proto/buffer.pro \
849 proto/charset.pro \
850 proto/diff.pro \
851 proto/digraph.pro \
852 proto/edit.pro \
853 proto/eval.pro \
854 proto/ex_cmds.pro \
855 proto/ex_cmds2.pro \
856 proto/ex_docmd.pro \
857 proto/ex_eval.pro \
858 proto/ex_getln.pro \
859 proto/fileio.pro \
860 proto/getchar.pro \
861 proto/main.pro \
862 proto/mark.pro \
863 proto/memfile.pro \
864 proto/memline.pro \
865 proto/menu.pro \
866 proto/message.pro \
867 proto/misc1.pro \
868 proto/misc2.pro \
869 proto/move.pro \
870 proto/mbyte.pro \
871 proto/normal.pro \
872 proto/ops.pro \
873 proto/option.pro \
874 proto/os_mswin.pro \
875 proto/os_win32.pro \
876 proto/quickfix.pro \
877 proto/regexp.pro \
878 proto/screen.pro \
879 proto/search.pro \
880 proto/syntax.pro \
881 proto/tag.pro \
882 proto/term.pro \
883 proto/ui.pro \
884 proto/undo.pro \
885 proto/window.pro \
886 $(NETBEANS_PRO)
887
888# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0: