blob: c3ddf00f62d7f4791e22b0186d7571411fb70220 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001#
2# Makefile for Vim.
3# Compiler: Borland C++ 5.0 and later 32-bit compiler
4# Targets: Dos16 or Win32 (Windows NT and Windows 95) (with/without GUI)
5#
6# Contributed by Ben Singer.
7# Updated 4/1997 by Ron Aaron
8# 6/1997 - added support for 16 bit DOS
9# Note: this has been tested, and works, for BC5. Your mileage may vary.
10# Has been reported NOT to work with BC 4.52. Maybe it can be fixed?
11# 10/1997 - ron - fixed bugs w/ BC 5.02
12# 8/1998 - ron - updated with new targets, fixed some stuff
13# 3/2000 - Bram: Made it work with BC 5.5 free command line compiler,
14# cleaned up variables.
15# 6/2001 - Dan - Added support for compiling Python and TCL
16# 7/2001 - Dan - Added support for compiling Ruby
17#
18# It builds on Windows 95 and NT-Intel, producing the same binary in either
19# case. To build using Microsoft Visual C++, use Make_mvc.mak.
20#
21# This should work with the free Borland command line compiler, version 5.5.
22# You need at least sp1 (service pack 1). With sp2 it compiles faster.
23# Use a command like this:
24# <path>\bin\make /f Make_bc5.mak BOR=<path>
25#
26
27# let the make utility do the hard work:
28.AUTODEPEND
29.CACHEAUTODEPEND
30
31# VARIABLES:
32# name value (default)
33#
34# BOR path to root of Borland C install (c:\bc5)
35# LINK name of the linker ($(BOR)\bin\ilink if OSTYPE is DOS16,
36# $(BOR)\bin\ilink32 otherwise)
37# GUI no or yes: set to yes if you want the GUI version (yes)
Bram Moolenaar0ba04292010-07-14 23:23:17 +020038# LUA define to path to Lua dir to get Lua support (not defined)
39# LUA_VER define to version of Lua being used (51)
40# DYNAMIC_LUA no or yes: set to yes to load the Lua DLL dynamically (no)
Bram Moolenaar071d4272004-06-13 20:20:40 +000041# PERL define to path to Perl dir to get Perl support (not defined)
42# PERL_VER define to version of Perl being used (56)
43# DYNAMIC_PERL no or yes: set to yes to load the Perl DLL dynamically (no)
44# PYTHON define to path to Python dir to get PYTHON support (not defined)
45# PYTHON_VER define to version of Python being used (22)
46# DYNAMIC_PYTHON no or yes: use yes to load the Python DLL dynamically (no)
47# TCL define to path to TCL dir to get TCL support (not defined)
48# TCL_VER define to version of TCL being used (83)
49# DYNAMIC_TCL no or yes: use yes to load the TCL DLL dynamically (no)
50# RUBY define to path to Ruby dir to get Ruby support (not defined)
51# NOTE: You may have to remove the defines for uid_t and gid_t
52# from the Ruby config.h header file.
53# RUBY_VER define to version of Ruby being used (16)
54# NOTE: compilation on WinNT/2K/XP requires
55# at least version 1.6.5 of Ruby. Earlier versions
56# of Ruby will cause a compile error on these systems.
Bram Moolenaar910f66f2006-04-05 20:41:53 +000057# RUBY_VER_LONG same, but in format with dot. (1.6)
Bram Moolenaar071d4272004-06-13 20:20:40 +000058# DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (no)
59# MBYTE no or yes: set to yes for multi-byte support (yes)
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000060# NOTE: multi-byte support is broken in the Borland libraries,
61# not everything will work properly! Esp. handling multi-byte
62# file names.
Bram Moolenaar071d4272004-06-13 20:20:40 +000063# IME no or yes: set to yes for multi-byte IME support (yes)
64# DYNAMIC_IME no or yes: set to yes to load imm32.dll dynamically (yes)
65# GETTEXT no or yes: set to yes for multi-language support (yes)
66# ICONV no or yes: set to yes for dynamic iconv support (yes)
67# OLE no or yes: set to yes to make OLE gvim (no)
68# OSTYPE DOS16 or WIN32 (WIN32)
69# DEBUG no or yes: set to yes if you wish a DEBUGging build (no)
70# CODEGUARD no or yes: set to yes if you want to use CODEGUARD (no)
71# CPUNR 1 through 6: select -CPU argument to compile with (3)
72# 3 for 386, 4 for 486, 5 for pentium, 6 for pentium pro.
73# USEDLL no or yes: set to yes to use the Runtime library DLL (no)
74# For USEDLL=yes the cc3250.dll is required to run Vim.
75# VIMDLL no or yes: create vim32.dll, and stub (g)vim.exe (no)
76# ALIGN 1, 2 or 4: Alignment to use (4 for Win32, 2 for DOS16)
77# FASTCALL no or yes: set to yes to use register-based function protocol (yes)
78# OPTIMIZE SPACE, SPEED, or MAXSPEED: type of optimization (MAXSPEED)
79# POSTSCRIPT no or yes: set to yes for PostScript printing
80# FEATURES TINY, SMALL, NORMAL, BIG or HUGE
81# (BIG for WIN32, SMALL for DOS16)
82# WINVER 0x0400 or 0x0500: minimum Win32 version to support (0x0400)
83# CSCOPE no or yes: include support for Cscope interface (yes)
84# NETBEANS no or yes: include support for Netbeans interface (yes if GUI
85# is yes)
Bram Moolenaarc9b4b052006-04-30 18:54:39 +000086# NBDEBUG no or yes: include support for debugging Netbeans interface (no)
Bram Moolenaar071d4272004-06-13 20:20:40 +000087# XPM define to path to XPM dir to get support for loading XPM images.
88
89### BOR: root of the BC installation
90!if ("$(BOR)"=="")
91BOR = c:\bc5
92!endif
93
94### LINK: Name of the linker: tlink or ilink32 (this is below, depends on
95# $(OSTYPE)
96
97### GUI: yes for GUI version, no for console version
98!if ("$(GUI)"=="")
99GUI = yes
100!endif
101
102### MBYTE: yes for multibyte support, no to disable it.
103!if ("$(MBYTE)"=="")
104MBYTE = yes
105!endif
106
107### IME: yes for multibyte support, no to disable it.
108!if ("$(IME)"=="")
109IME = yes
110!endif
111!if ("$(DYNAMIC_IME)"=="")
112DYNAMIC_IME = yes
113!endif
114
115### GETTEXT: yes for multilanguage support, no to disable it.
116!if ("$(GETTEXT)"=="")
117GETTEXT = yes
118!endif
119
120### ICONV: yes to enable dynamic-iconv support, no to disable it
121!if ("$(ICONV)"=="")
122ICONV = yes
123!endif
124
125### CSCOPE: yes to enable Cscope support, no to disable it
126!if ("$(CSCOPE)"=="")
127CSCOPE = yes
128!endif
129
130### NETBEANS: yes to enable NetBeans interface support, no to disable it
131!if ("$(NETBEANS)"=="") && ("$(GUI)"=="yes")
132NETBEANS = yes
133!endif
134
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200135### LUA: uncomment this line if you want lua support in vim
136# LUA=c:\lua
137
Bram Moolenaar071d4272004-06-13 20:20:40 +0000138### PERL: uncomment this line if you want perl support in vim
139# PERL=c:\perl
140
141### PYTHON: uncomment this line if you want python support in vim
142# PYTHON=c:\python22
143
144### RUBY: uncomment this line if you want ruby support in vim
145# RUBY=c:\ruby
146
147### TCL: uncomment this line if you want tcl support in vim
148# TCL=c:\tcl
149
150### OLE: no for normal gvim, yes for OLE-capable gvim (only works with GUI)
151#OLE = yes
152
153### OSTYPE: DOS16 for Windows 3.1 version, WIN32 for Windows 95/98/NT/2000
154# version
155!if ("$(OSTYPE)"=="")
156OSTYPE = WIN32
157!endif
158
159### DEBUG: Uncomment to make an executable for debugging
160# DEBUG = yes
161!if ("$(DEBUG)"=="yes")
162DEBUG_FLAG = -v
163!endif
164
165### CODEGUARD: Uncomment to use the CODEGUARD stuff (BC 5.0 or later):
166# CODEGUARD = yes
167!if ("$(CODEGUARD)"=="yes")
168CODEGUARD_FLAG = -vG
169!endif
170
171### CPUNR: set your target processor (3 to 6)
172!if ("$(CPUNR)" == "i386") || ("$(CPUNR)" == "3")
173CPUNR = 3
174!elif ("$(CPUNR)" == "i486") || ("$(CPUNR)" == "4")
175CPUNR = 4
176!elif ("$(CPUNR)" == "i586") || ("$(CPUNR)" == "5")
177CPUNR = 5
178!elif ("$(CPUNR)" == "i686") || ("$(CPUNR)" == "6")
179CPUNR = 6
180!else
181CPUNR = 3
182!endif
183
184### Comment out to use precompiled headers (faster, but uses lots of disk!)
185HEADERS = -H -H=vim.csm -Hc
186
187### USEDLL: no for statically linked version of run-time, yes for DLL runtime
188!if ("$(USEDLL)"=="")
189USEDLL = no
190!endif
191
192### VIMDLL: yes for a DLL version of VIM (NOT RECOMMENDED), no otherwise
193#VIMDLL = yes
194
195### ALIGN: alignment you desire: (1,2 or 4: s/b 4 for Win32, 2 for DOS)
196!if ("$(ALIGN)"=="")
197!if ($(OSTYPE)==DOS16)
198ALIGN = 2
199!else
200ALIGN = 4
201!endif
202!endif
203
204### FASTCALL: yes to use FASTCALL calling convention (RECOMMENDED!), no otherwise
205# Incompatible when calling external functions (like MSVC-compiled DLLs), so
206# don't use FASTCALL when linking with external libs.
207!if ("$(FASTCALL)"=="") && \
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200208 ("$(LUA)"=="") && \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000209 ("$(PYTHON)"=="") && \
210 ("$(PERL)"=="") && \
211 ("$(TCL)"=="") && \
212 ("$(RUBY)"=="") && \
213 ("$(ICONV)"!="yes") && \
214 ("$(IME)"!="yes") && \
215 ("$(MBYTE)"!="yes") && \
216 ("$(XPM)"=="")
217FASTCALL = yes
218!endif
219
220### OPTIMIZE: SPEED to optimize for speed, SPACE otherwise (SPEED RECOMMENDED)
221!if ("$(OPTIMIZE)"=="")
222OPTIMIZE = MAXSPEED
223!endif
224
225### FEATURES: TINY, SMALL, NORMAL, BIG or HUGE (BIG for WIN32, SMALL for DOS16)
226!if ("$(FEATURES)"=="")
227! if ($(OSTYPE)==DOS16)
228FEATURES = SMALL
229! else
230FEATURES = BIG
231! endif
232!endif
233
234### POSTSCRIPT: uncomment this line if you want PostScript printing
235#POSTSCRIPT = yes
236
237###
238# If you have a fixed directory for $VIM or $VIMRUNTIME, other than the normal
239# default, use these lines.
240#VIMRCLOC = somewhere
241#VIMRUNTIMEDIR = somewhere
242
243### Set the default $(WINVER) to make it work with Bcc 5.5.
244!ifndef WINVER
245WINVER = 0x0400
246!endif
247
248#
249# Sanity checks for the above options:
250#
251
252!if ($(OSTYPE)==DOS16)
253!if (($(CPUNR)+0)>4)
254!error CPUNR Must be less than or equal to 4 for DOS16
255!endif
256
257!if (($(ALIGN)+0)>2)
258!error ALIGN Must be less than or equal to 2 for DOS16
259!endif
260
261!else # not DOS16
262!if (($(CPUNR)+0)<3)
263!error CPUNR Must be greater or equal to 3 for WIN32
264!endif
265!endif
266
267!if ($(OSTYPE)!=WIN32) && ($(OSTYPE)!=DOS16)
268!error Check the OSTYPE variable again: $(OSTYPE) is not supported!
269!endif
270
271#
272# Optimizations: change as desired (RECOMMENDATION: Don't change!):
273#
274!if ("$(DEBUG)"=="yes")
275OPT = -Od -N
276!else
277!if ("$(OPTIMIZE)"=="SPACE")
278OPT = -O1 -f- -d
279!elif ("$(OPTIMIZE)"=="MAXSPEED")
280OPT = -O2 -f- -d -Ocavi -O
281!else
282OPT = -O2 -f- -d -Oc -O
283!endif
284!if ("$(FASTCALL)"=="yes")
285OPT = $(OPT) -pr
286!endif
287!if ("$(CODEGUARD)"!="yes")
288OPT = $(OPT) -vi-
289!endif
290!endif
291!if ($(OSTYPE)==DOS16)
292!undef GUI
293!undef VIMDLL
294!undef USEDLL
295!endif
296# shouldn't have to change:
297LIB = $(BOR)\lib
298INCLUDE = $(BOR)\include;.;proto
299DEFINES = -DFEAT_$(FEATURES) -DWIN32 -DHAVE_PATHDEF \
300 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
301
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200302!ifdef LUA
303INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_LUA
304INCLUDE = $(LUA)\include;$(INCLUDE)
305! ifndef LUA_VER
306LUA_VER = 51
307! endif
308! if ("$(DYNAMIC_LUA)" == "yes")
309INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
310LUA_LIB_FLAG = /nodefaultlib:
311! endif
312!endif
313
Bram Moolenaar071d4272004-06-13 20:20:40 +0000314!ifdef PERL
315INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_PERL
316INCLUDE = $(PERL)\lib\core;$(INCLUDE)
317! ifndef PERL_VER
318PERL_VER = 56
319! endif
320! if ("$(DYNAMIC_PERL)" == "yes")
321! if ($(PERL_VER) > 55)
322INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
323PERL_LIB_FLAG = /nodefaultlib:
324! else
325! message "Cannot dynamically load Perl versions less than 5.6. Loading statically..."
326! endif
327! endif
328!endif
329
330!ifdef PYTHON
331INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_PYTHON
332INCLUDE = $(PYTHON)\include;$(INCLUDE)
333!ifndef PYTHON_VER
334PYTHON_VER = 22
335!endif
336!if "$(DYNAMIC_PYTHON)" == "yes"
337INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
338PYTHON_LIB_FLAG = /nodefaultlib:
339!endif
340!endif
341
342!ifdef RUBY
343!ifndef RUBY_VER
344RUBY_VER = 16
345!endif
346!ifndef RUBY_VER_LONG
347RUBY_VER_LONG = 1.6
348!endif
349
350!if "$(RUBY_VER)" == "16"
351!ifndef RUBY_PLATFORM
352RUBY_PLATFORM = i586-mswin32
353!endif
354!ifndef RUBY_INSTALL_NAME
355RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
356!endif
357!else
358!ifndef RUBY_PLATFORM
359RUBY_PLATFORM = i386-mswin32
360!endif
361!ifndef RUBY_INSTALL_NAME
362RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
363!endif
364!endif
365
366INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_RUBY
367INCLUDE = $(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM);$(INCLUDE)
368
369!if "$(DYNAMIC_RUBY)" == "yes"
370INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
371INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_RUBY_VER=$(RUBY_VER)
372RUBY_LIB_FLAG = /nodefaultlib:
373!endif
374!endif
375
376!ifdef TCL
377INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_TCL
378INCLUDE = $(TCL)\include;$(INCLUDE)
379!ifndef TCL_VER
380TCL_VER = 83
381!endif
382TCL_LIB = $(TCL)\lib\tcl$(TCL_VER).lib
383TCL_LIB_FLAG =
384!if "$(DYNAMIC_TCL)" == "yes"
385INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
386TCL_LIB = tclstub$(TCL_VER)-bor.lib
387TCL_LIB_FLAG =
388!endif
389!endif
390#
391# DO NOT change below:
392#
393CPUARG = -$(CPUNR)
394ALIGNARG = -a$(ALIGN)
395#
396!if ("$(DEBUG)"=="yes")
397DEFINES=$(DEFINES) -DDEBUG
398!endif
399#
400!if ("$(OLE)"=="yes")
401DEFINES = $(DEFINES) -DFEAT_OLE
402!endif
403#
404!if ("$(MBYTE)"=="yes")
405MBDEFINES = $(MBDEFINES) -DFEAT_MBYTE
406!endif
407!if ("$(IME)"=="yes")
408MBDEFINES = $(MBDEFINES) -DFEAT_MBYTE_IME
409!if ("$(DYNAMIC_IME)" == "yes")
410MBDEFINES = $(MBDEFINES) -DDYNAMIC_IME
411!endif
412!endif
413!if ("$(ICONV)"=="yes")
414MBDEFINES = $(MBDEFINES) -DDYNAMIC_ICONV
415!endif
416!if ("$(GETTEXT)"=="yes")
417MBDEFINES = $(MBDEFINES) -DDYNAMIC_GETTEXT
418!endif
419
420!if ("$(CSCOPE)"=="yes")
421DEFINES = $(DEFINES) -DFEAT_CSCOPE
422!endif
423
Bram Moolenaar071d4272004-06-13 20:20:40 +0000424!if ("$(GUI)"=="yes")
425DEFINES = $(DEFINES) -DFEAT_GUI_W32 -DFEAT_CLIPBOARD
426!if ("$(DEBUG)"=="yes")
427TARGET = gvimd.exe
428!else
429TARGET = gvim.exe
430!endif
431!if ("$(VIMDLL)"=="yes")
432EXETYPE=-WD
433DEFINES = $(DEFINES) -DVIMDLL
434!else
435EXETYPE=-W
436!endif
437STARTUPOBJ = c0w32.obj
438LINK2 = -aa
439RESFILE = vim.res
440!else
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000441!undef NETBEANS
442!undef XPM
443!undef VIMDLL
Bram Moolenaar071d4272004-06-13 20:20:40 +0000444!if ("$(DEBUG)"=="yes")
445TARGET = vimd.exe
446!else
447# for now, anyway: VIMDLL is only for the GUI version
Bram Moolenaar071d4272004-06-13 20:20:40 +0000448TARGET = vim.exe
449!endif
450!if ($(OSTYPE)==DOS16)
451DEFINES= -DFEAT_$(FEATURES) -DMSDOS
452EXETYPE=-ml
453STARTUPOBJ = c0l.obj
454LINK2 =
455!else
456EXETYPE=-WC
457STARTUPOBJ = c0x32.obj
458LINK2 = -ap -OS -o -P
459!endif
460RESFILE = vim.res
461!endif
462
Bram Moolenaarcfbc5ee2004-07-02 15:38:35 +0000463!if ("$(NETBEANS)"=="yes")
464DEFINES = $(DEFINES) -DFEAT_NETBEANS_INTG
465!if ("$(NBDEBUG)"=="yes")
466DEFINES = $(DEFINES) -DNBDEBUG
467NBDEBUG_DEP = nbdebug.h nbdebug.c
468!endif
469!endif
470
471!ifdef XPM
472!if ("$(GUI)"=="yes")
473DEFINES = $(DEFINES) -DFEAT_XPM_W32
474INCLUDE = $(XPM)\include;$(INCLUDE)
475!endif
476!endif
477
Bram Moolenaar071d4272004-06-13 20:20:40 +0000478!if ("$(USEDLL)"=="yes")
479DEFINES = $(DEFINES) -D_RTLDLL
480!endif
481
482!if ("$(DEBUG)"=="yes")
483OBJDIR = $(OSTYPE)\objdbg
484!else
485!if ("$(GUI)"=="yes")
486!if ("$(OLE)"=="yes")
487OBJDIR = $(OSTYPE)\oleobj
488!else
489OBJDIR = $(OSTYPE)\gobj
490!endif
491!else
492OBJDIR = $(OSTYPE)\obj
493!endif
494!endif
495
496!if ("$(POSTSCRIPT)"=="yes")
497DEFINES = $(DEFINES) -DMSWINPS
498!endif
499
500##### BASE COMPILER/TOOLS RULES #####
501MAKE = $(BOR)\bin\make
502CFLAGS = -w-aus -w-par -w-pch -w-ngu -w-csu -I$(INCLUDE)
503!if ($(OSTYPE)==DOS16)
504BRC =
505!if ("$(LINK)"=="")
506LINK = $(BOR)\BIN\TLink
507!endif
508CC = $(BOR)\BIN\Bcc
509LFLAGS = -Tde -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
510LFLAGSDLL =
511CFLAGS = $(CFLAGS) -H- $(HEADERS)
512!else
513BRC = $(BOR)\BIN\brc32
514!if ("$(LINK)"=="")
515LINK = $(BOR)\BIN\ILink32
516!endif
517CC = $(BOR)\BIN\Bcc32
518LFLAGS = -OS -Tpe -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
519LFLAGSDLL = -Tpd -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
520CFLAGS = $(CFLAGS) -d -RT- -k- -Oi $(HEADERS) -f-
521!endif
522
523CC1 = -c
524CC2 = -o
525CCARG = +$(OBJDIR)\bcc.cfg
526
527# implicit rules:
528
529# Without the following, the implicit rule in BUILTINS.MAK is picked up
530# for a rule for .c.obj rather than the local implicit rule
531.SUFFIXES
532.SUFFIXES .c .obj
533.path.c = .
534
535{.}.c{$(OBJDIR)}.obj:
536 $(CC) $(CCARG) $(CC1) -n$(OBJDIR)\ {$< }
537
538.cpp.obj:
539 $(CC) $(CCARG) $(CC1) $(CC2)$@ $*.cpp
540
541!if ($(OSTYPE)==DOS16)
542!else # win32:
543vimmain = \
544 $(OBJDIR)\os_w32exe.obj
545!if ("$(VIMDLL)"=="yes")
546vimwinmain = \
547 $(OBJDIR)\os_w32dll.obj
548!else
549vimwinmain = \
550 $(OBJDIR)\os_w32exe.obj
551!endif
552!endif
553
554vimobj = \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200555 $(OBJDIR)\blowfish.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000556 $(OBJDIR)\buffer.obj \
557 $(OBJDIR)\charset.obj \
558 $(OBJDIR)\diff.obj \
559 $(OBJDIR)\digraph.obj \
560 $(OBJDIR)\edit.obj \
561 $(OBJDIR)\eval.obj \
562 $(OBJDIR)\ex_cmds.obj \
563 $(OBJDIR)\ex_cmds2.obj \
564 $(OBJDIR)\ex_docmd.obj \
565 $(OBJDIR)\ex_eval.obj \
566 $(OBJDIR)\ex_getln.obj \
567 $(OBJDIR)\fileio.obj \
568 $(OBJDIR)\fold.obj \
569 $(OBJDIR)\getchar.obj \
Bram Moolenaar58d98232005-07-23 22:25:46 +0000570 $(OBJDIR)\hardcopy.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000571 $(OBJDIR)\hashtab.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000572 $(OBJDIR)\main.obj \
573 $(OBJDIR)\mark.obj \
574 $(OBJDIR)\memfile.obj \
575 $(OBJDIR)\memline.obj \
576 $(OBJDIR)\menu.obj \
577 $(OBJDIR)\message.obj \
578 $(OBJDIR)\misc1.obj \
579 $(OBJDIR)\misc2.obj \
580 $(OBJDIR)\move.obj \
581 $(OBJDIR)\mbyte.obj \
582 $(OBJDIR)\normal.obj \
583 $(OBJDIR)\ops.obj \
584 $(OBJDIR)\option.obj \
Bram Moolenaarc01140a2006-03-24 22:21:52 +0000585 $(OBJDIR)\popupmnu.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000586 $(OBJDIR)\quickfix.obj \
587 $(OBJDIR)\regexp.obj \
588 $(OBJDIR)\screen.obj \
589 $(OBJDIR)\search.obj \
Bram Moolenaar40e6a712010-05-16 22:32:54 +0200590 $(OBJDIR)\sha256.obj \
Bram Moolenaarfc735152005-03-22 22:54:12 +0000591 $(OBJDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000592 $(OBJDIR)\syntax.obj \
593 $(OBJDIR)\tag.obj \
594 $(OBJDIR)\term.obj \
595 $(OBJDIR)\ui.obj \
596 $(OBJDIR)\undo.obj \
597 $(OBJDIR)\version.obj \
598 $(OBJDIR)\window.obj \
599 $(OBJDIR)\pathdef.obj
600
601!if ("$(OLE)"=="yes")
602vimobj = $(vimobj) \
603 $(OBJDIR)\if_ole.obj
604!endif
605
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200606!ifdef LUA
607vimobj = $(vimobj) \
608 $(OBJDIR)\if_lua.obj
609!endif
610
Bram Moolenaar071d4272004-06-13 20:20:40 +0000611!ifdef PERL
612vimobj = $(vimobj) \
613 $(OBJDIR)\if_perl.obj
614!endif
615
616!ifdef PYTHON
617vimobj = $(vimobj) \
618 $(OBJDIR)\if_python.obj
619!endif
620
621!ifdef RUBY
622vimobj = $(vimobj) \
623 $(OBJDIR)\if_ruby.obj
624!endif
625
626!ifdef TCL
627vimobj = $(vimobj) \
628 $(OBJDIR)\if_tcl.obj
629!endif
630
631!if ("$(CSCOPE)"=="yes")
632vimobj = $(vimobj) \
633 $(OBJDIR)\if_cscope.obj
634!endif
635
636!if ("$(NETBEANS)"=="yes")
637vimobj = $(vimobj) \
Bram Moolenaar408fb622005-03-07 23:03:19 +0000638 $(OBJDIR)\netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000639!endif
640
641!ifdef XPM
642vimobj = $(vimobj) \
643 $(OBJDIR)\xpm_w32.obj
644!endif
645
646!if ("$(VIMDLL)"=="yes")
647vimdllobj = $(vimobj)
648!if ("$(DEBUG)"=="yes")
649DLLTARGET = vim32d.dll
650!else
651DLLTARGET = vim32.dll
652!endif
653!else
654DLLTARGET = joebob
655!endif
656
657!if ("$(GUI)"=="yes")
658vimobj = $(vimobj) \
659 $(vimwinmain) \
660 $(OBJDIR)\gui.obj \
Bram Moolenaar408fb622005-03-07 23:03:19 +0000661 $(OBJDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000662 $(OBJDIR)\gui_w32.obj
663!endif
664
665!if ($(OSTYPE)==WIN32)
666vimobj = $(vimobj) \
667 $(OBJDIR)\os_win32.obj $(OBJDIR)\os_mswin.obj
668!elif ($(OSTYPE)==DOS16)
669vimobj = $(vimobj) \
670 $(OBJDIR)\os_msdos.obj
671!endif
672# Blab what we are going to do:
673MSG = Compiling $(OSTYPE) $(TARGET) $(OLETARGET), with:
674!if ("$(GUI)"=="yes")
675MSG = $(MSG) GUI
676!endif
677!if ("$(OLE)"=="yes")
678MSG = $(MSG) OLE
679!endif
680!if ("$(USEDLL)"=="yes")
681MSG = $(MSG) USEDLL
682!endif
683!if ("$(VIMDLL)"=="yes")
684MSG = $(MSG) VIMDLL
685!endif
686!if ("$(FASTCALL)"=="yes")
687MSG = $(MSG) FASTCALL
688!endif
689!if ("$(MBYTE)"=="yes")
690MSG = $(MSG) MBYTE
691!endif
692!if ("$(IME)"=="yes")
693MSG = $(MSG) IME
694! if "$(DYNAMIC_IME)" == "yes"
695MSG = $(MSG)(dynamic)
696! endif
697!endif
698!if ("$(GETTEXT)"=="yes")
699MSG = $(MSG) GETTEXT
700!endif
701!if ("$(ICONV)"=="yes")
702MSG = $(MSG) ICONV
703!endif
704!if ("$(DEBUG)"=="yes")
705MSG = $(MSG) DEBUG
706!endif
707!if ("$(CODEGUARD)"=="yes")
708MSG = $(MSG) CODEGUARD
709!endif
710!if ("$(CSCOPE)"=="yes")
711MSG = $(MSG) CSCOPE
712!endif
713!if ("$(NETBEANS)"=="yes")
714MSG = $(MSG) NETBEANS
715!endif
716!ifdef XPM
717MSG = $(MSG) XPM
718!endif
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200719!ifdef LUA
720MSG = $(MSG) LUA
721! if "$(DYNAMIC_LUA)" == "yes"
722MSG = $(MSG)(dynamic)
723! endif
724!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000725!ifdef PERL
726MSG = $(MSG) PERL
727! if "$(DYNAMIC_PERL)" == "yes"
728MSG = $(MSG)(dynamic)
729! endif
730!endif
731!ifdef PYTHON
732MSG = $(MSG) PYTHON
733! if "$(DYNAMIC_PYTHON)" == "yes"
734MSG = $(MSG)(dynamic)
735! endif
736!endif
737!ifdef RUBY
738MSG = $(MSG) RUBY
739! if "$(DYNAMIC_RUBY)" == "yes"
740MSG = $(MSG)(dynamic)
741! endif
742!endif
743!ifdef TCL
744MSG = $(MSG) TCL
745! if "$(DYNAMIC_TCL)" == "yes"
746MSG = $(MSG)(dynamic)
747! endif
748!endif
749MSG = $(MSG) cpu=$(CPUARG)
750MSG = $(MSG) Align=$(ALIGNARG)
751
752!message $(MSG)
753
754!if ($(OSTYPE)==DOS16)
755TARGETS = $(TARGET)
756!else
757!if ("$(VIMDLL)"=="yes")
758TARGETS = $(DLLTARGET)
759!endif
760TARGETS = $(TARGETS) $(TARGET)
761!endif
762
763# Targets:
764all: vim vimrun.exe install.exe xxd uninstal.exe GvimExt/gvimext.dll
765
766vim: $(OSTYPE) $(OBJDIR) $(OBJDIR)\bcc.cfg $(TARGETS)
767 @if exist $(OBJDIR)\version.obj del $(OBJDIR)\version.obj
768 @if exist auto\pathdef.c del auto\pathdef.c
769
770$(OSTYPE):
771 -@md $(OSTYPE)
772
773$(OBJDIR):
774 -@md $(OBJDIR)
775
776xxd:
777 @cd xxd
778 $(MAKE) /f Make_bc5.mak BOR="$(BOR)" BCC="$(CC)"
779 @cd ..
780
781GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
782 cd GvimExt
783 $(MAKE) /f Make_bc5.mak USEDLL=$(USEDLL) BOR=$(BOR)
784 cd ..
785
786install.exe: dosinst.c $(OBJDIR)\bcc.cfg
787!if ($(OSTYPE)==WIN32)
788 $(CC) $(CCARG) -WC -DWIN32 -einstall dosinst.c
789!else
790 $(CC) $(CCARG) -WC -einstall dosinst.c
791!endif
792
793uninstal.exe: uninstal.c $(OBJDIR)\bcc.cfg
794!if ($(OSTYPE)==WIN32)
795 $(CC) $(CCARG) -WC -DWIN32 -O2 -euninstal uninstal.c
796!else
797 $(CC) $(CCARG) -WC -O2 -euninstal uninstal.c
798!endif
799
800clean:
801!if "$(OS)" == "Windows_NT"
802 # For Windows NT/2000, doesn't work on Windows 95/98...
803 # $(COMSPEC) needed to ensure rmdir.exe is not run
804 -@$(COMSPEC) /C rmdir /Q /S $(OBJDIR)
805!else
806 # For Windows 95/98, doesn't work on Windows NT/2000...
807 -@deltree /y $(OBJDIR)
808!endif
809 -@del *.res
810 -@del vim32*.dll
811 -@del vim32*.lib
812 -@del *vim*.exe
813 -@del *install*.exe
814 -@del *.csm
815 -@del *.map
816 -@del *.ilc
817 -@del *.ild
818 -@del *.ilf
819 -@del *.ils
820 -@del *.tds
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200821!ifdef LUA
822 -@del lua.lib
823!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000824!ifdef PERL
825 -@del perl.lib
826!endif
827!ifdef PYTHON
828 -@del python.lib
829!endif
830!ifdef RUBY
831 -@del ruby.lib
832!endif
833!ifdef TCL
834 -@del tcl.lib
835!endif
836!ifdef XPM
837 -@del xpm.lib
838!endif
839 cd xxd
840 $(MAKE) /f Make_bc5.mak BOR="$(BOR)" clean
841 cd ..
842 cd GvimExt
843 $(MAKE) /f Make_bc5.mak BOR="$(BOR)" clean
844 cd ..
845
846$(DLLTARGET): $(OBJDIR) $(vimdllobj)
847 $(LINK) @&&|
848 $(LFLAGSDLL) +
849 c0d32.obj +
850 $(vimdllobj)
851 $<,$*
852!if ("$(CODEGUARD)"=="yes")
853 cg32.lib+
854!endif
855# $(OSTYPE)==WIN32 causes os_mswin.c compilation. FEAT_SHORTCUT in it needs OLE
856!if ("$(OLE)"=="yes" || $(OSTYPE)==WIN32)
857 ole2w32.lib +
858!endif
859!if ($(OSTYPE)==WIN32)
860 import32.lib+
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200861!ifdef LUA
862 $(LUA_LIB_FLAG)lua.lib+
863!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000864!ifdef PERL
865 $(PERL_LIB_FLAG)perl.lib+
866!endif
867!ifdef PYTHON
868 $(PYTHON_LIB_FLAG)python.lib+
869!endif
870!ifdef RUBY
871 $(RUBY_LIB_FLAG)ruby.lib+
872!endif
873!ifdef TCL
874 $(TCL_LIB_FLAG)tcl.lib+
875!endif
876!ifdef XPM
877 xpm.lib+
878!endif
879!if ("$(USEDLL)"=="yes")
880 cw32i.lib
881!else
882 cw32.lib
883!endif
884 vim.def
885!else
886 cl.lib
887!endif
888|
889
890!if ("$(VIMDLL)"=="yes")
891$(TARGET): $(OBJDIR) $(DLLTARGET) $(vimmain) $(OBJDIR)\$(RESFILE)
892!else
893$(TARGET): $(OBJDIR) $(vimobj) $(OBJDIR)\$(RESFILE)
894!endif
895 $(LINK) @&&|
896 $(LFLAGS) +
897 $(STARTUPOBJ) +
898!if ("$(VIMDLL)"=="yes")
899 $(vimmain)
900!else
901 $(vimobj)
902!endif
903 $<,$*
904!if ($(OSTYPE)==WIN32)
905!if ("$(CODEGUARD)"=="yes")
906 cg32.lib+
907!endif
908# $(OSTYPE)==WIN32 causes os_mswin.c compilation. FEAT_SHORTCUT in it needs OLE
909!if ("$(OLE)"=="yes" || $(OSTYPE)==WIN32)
910 ole2w32.lib +
911!endif
912 import32.lib+
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200913!ifdef LUA
914 $(LUA_LIB_FLAG)lua.lib+
915!endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000916!ifdef PERL
917 $(PERL_LIB_FLAG)perl.lib+
918!endif
919!ifdef PYTHON
920 $(PYTHON_LIB_FLAG)python.lib+
921!endif
922!ifdef RUBY
923 $(RUBY_LIB_FLAG)ruby.lib+
924!endif
925!ifdef TCL
926 $(TCL_LIB_FLAG)tcl.lib+
927!endif
928!ifdef XPM
929 xpm.lib+
930!endif
931!if ("$(USEDLL)"=="yes")
932 cw32i.lib
933!else
934 cw32.lib
935!endif
936
937 $(OBJDIR)\$(RESFILE)
938!else
939 emu.lib + cl.lib
940!endif
941|
942
943test:
944 cd testdir
945 $(MAKE) /NOLOGO -f Make_dos.mak win32
946 cd ..
947
948$(OBJDIR)\ex_docmd.obj: ex_docmd.c ex_cmds.h
949
950$(OBJDIR)\ex_eval.obj: ex_eval.c ex_cmds.h
951
952$(OBJDIR)\if_ole.obj: if_ole.cpp
953
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200954$(OBJDIR)\if_lua.obj: if_lua.c lua.lib
955 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_lua.c
956
Bram Moolenaar071d4272004-06-13 20:20:40 +0000957$(OBJDIR)\if_perl.obj: if_perl.c perl.lib
958 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_perl.c
959
960if_perl.c: if_perl.xs typemap
961 $(PERL)\bin\perl.exe $(PERL)\lib\ExtUtils\xsubpp -prototypes -typemap \
962 $(PERL)\lib\ExtUtils\typemap if_perl.xs > $@
963
964$(OBJDIR)\if_python.obj: if_python.c python.lib
965 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_python.c
966
967$(OBJDIR)\if_ruby.obj: if_ruby.c ruby.lib
968 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_ruby.c
969
970$(OBJDIR)\if_tcl.obj: if_tcl.c tcl.lib
971 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_tcl.c
972
973$(OBJDIR)\xpm_w32.obj: xpm_w32.c xpm.lib
974 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc xpm_w32.c
975
976$(OBJDIR)\netbeans.obj: netbeans.c $(NBDEBUG_DEP)
977 $(CC) $(CCARG) $(CC1) $(CC2)$@ netbeans.c
978
979$(OBJDIR)\vim.res: vim.rc version.h tools.bmp tearoff.bmp \
980 vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
981 $(BRC) -fo$(OBJDIR)\vim.res -i $(BOR)\include -w32 -r vim.rc @&&|
982 $(DEFINES)
983|
984
985$(OBJDIR)\pathdef.obj: auto\pathdef.c
986 $(CC) $(CCARG) $(CC1) $(CC2)$@ auto\pathdef.c
987
988
989# Need to escape both quotes and backslashes in $INTERP_DEFINES
990INTERP_DEFINES_ESC_BKS=$(INTERP_DEFINES:\=\\)
991INTERP_DEFINES_ESC=$(INTERP_DEFINES_ESC_BKS:"=\")
992
993# Note: the silly /*"*/ below are there to trick make into accepting
994# the # character as something other than a comment without messing up
995# the preprocessor directive.
996auto\pathdef.c::
997 -@md auto
998 @echo creating auto/pathdef.c
999 @copy /y &&|
1000/* pathdef.c */
1001/*"*/#include "vim.h"/*"*/
1002
1003char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)";
1004char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)";
1005char_u *all_cflags = (char_u *)"$(CC:\=\\) $(CFLAGS:\=\\) $(DEFINES) $(MBDEFINES) $(INTERP_DEFINES_ESC) $(OPT) $(EXETYPE) $(CPUARG) $(ALIGNARG) $(DEBUG_FLAG) $(CODEGUARD_FLAG)";
1006char_u *all_lflags = (char_u *)"$(LINK:\=\\) $(LFLAGS:\=\\)";
1007char_u *compiled_user = (char_u *)"$(USERNAME)";
1008char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";
1009| auto\pathdef.c
1010
Bram Moolenaar0ba04292010-07-14 23:23:17 +02001011lua.lib: $(LUA)\lib\lua$(LUA_VER).lib
1012 coff2omf $(LUA)\lib\lua$(LUA_VER).lib $@
1013
Bram Moolenaar071d4272004-06-13 20:20:40 +00001014perl.lib: $(PERL)\lib\CORE\perl$(PERL_VER).lib
1015 coff2omf $(PERL)\lib\CORE\perl$(PERL_VER).lib $@
1016
1017python.lib: $(PYTHON)\libs\python$(PYTHON_VER).lib
1018 coff2omf $(PYTHON)\libs\python$(PYTHON_VER).lib $@
1019
1020ruby.lib: $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
1021 coff2omf $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib $@
1022
1023# For some reason, the coff2omf method doesn't work on libXpm.lib, so
1024# we have to manually generate an import library straight from the DLL.
1025xpm.lib: $(XPM)\lib\libXpm.lib
1026 implib -a $@ $(XPM)\bin\libXpm.dll
1027
1028tcl.lib: $(TCL_LIB)
1029!if ("$(DYNAMIC_TCL)" == "yes")
1030 copy $(TCL_LIB) $@
1031!else
1032 coff2omf $(TCL_LIB) $@
1033!endif
1034
1035!if ("$(DYNAMIC_TCL)" == "yes")
1036tclstub$(TCL_VER)-bor.lib:
1037 -@IF NOT EXIST $@ ECHO You must download tclstub$(TCL_VER)-bor.lib separately and\
1038 place it in the src directory in order to compile a dynamic TCL-enabled\
1039 (g)vim with the Borland compiler. You can get the tclstub$(TCL_VER)-bor.lib file\
1040 at http://mywebpage.netscape.com/sharppeople/vim/tclstub$(TCL_VER)-bor.lib
1041!endif
1042
1043# vimrun.exe:
1044vimrun.exe: vimrun.c
1045!if ("$(USEDLL)"=="yes")
1046 $(CC) -WC -O1 -I$(INCLUDE) -L$(LIB) -D_RTLDLL vimrun.c cw32mti.lib
1047!else
1048 $(CC) -WC -O1 -I$(INCLUDE) -L$(LIB) vimrun.c
1049!endif
1050
1051# The dependency on $(OBJDIR) is to have bcc.cfg generated each time.
1052$(OBJDIR)\bcc.cfg: Make_bc5.mak $(OBJDIR)
1053 copy /y &&|
1054 $(CFLAGS)
1055 -L$(LIB)
1056 $(DEFINES)
1057 $(MBDEFINES)
1058 $(INTERP_DEFINES)
1059 $(EXETYPE)
1060 $(DEBUG_FLAG)
1061 $(OPT)
1062 $(CODEGUARD_FLAG)
1063 $(CPUARG)
1064 $(ALIGNARG)
1065| $@
1066
1067# vi:set sts=4 sw=4: