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