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