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