blob: 195d79f9c185e86f3a562c02447edebd5a0b45fe [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 \
Bram Moolenaar383f9bc2005-01-19 22:18:32 +0000549 $(OBJDIR)\hashtable.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000550 $(OBJDIR)\main.obj \
551 $(OBJDIR)\mark.obj \
552 $(OBJDIR)\memfile.obj \
553 $(OBJDIR)\memline.obj \
554 $(OBJDIR)\menu.obj \
555 $(OBJDIR)\message.obj \
556 $(OBJDIR)\misc1.obj \
557 $(OBJDIR)\misc2.obj \
558 $(OBJDIR)\move.obj \
559 $(OBJDIR)\mbyte.obj \
560 $(OBJDIR)\normal.obj \
561 $(OBJDIR)\ops.obj \
562 $(OBJDIR)\option.obj \
563 $(OBJDIR)\quickfix.obj \
564 $(OBJDIR)\regexp.obj \
565 $(OBJDIR)\screen.obj \
566 $(OBJDIR)\search.obj \
Bram Moolenaarfc735152005-03-22 22:54:12 +0000567 $(OBJDIR)\spell.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000568 $(OBJDIR)\syntax.obj \
569 $(OBJDIR)\tag.obj \
570 $(OBJDIR)\term.obj \
571 $(OBJDIR)\ui.obj \
572 $(OBJDIR)\undo.obj \
573 $(OBJDIR)\version.obj \
574 $(OBJDIR)\window.obj \
575 $(OBJDIR)\pathdef.obj
576
577!if ("$(OLE)"=="yes")
578vimobj = $(vimobj) \
579 $(OBJDIR)\if_ole.obj
580!endif
581
582!ifdef PERL
583vimobj = $(vimobj) \
584 $(OBJDIR)\if_perl.obj
585!endif
586
587!ifdef PYTHON
588vimobj = $(vimobj) \
589 $(OBJDIR)\if_python.obj
590!endif
591
592!ifdef RUBY
593vimobj = $(vimobj) \
594 $(OBJDIR)\if_ruby.obj
595!endif
596
597!ifdef TCL
598vimobj = $(vimobj) \
599 $(OBJDIR)\if_tcl.obj
600!endif
601
602!if ("$(CSCOPE)"=="yes")
603vimobj = $(vimobj) \
604 $(OBJDIR)\if_cscope.obj
605!endif
606
607!if ("$(NETBEANS)"=="yes")
608vimobj = $(vimobj) \
Bram Moolenaar408fb622005-03-07 23:03:19 +0000609 $(OBJDIR)\netbeans.obj
Bram Moolenaar071d4272004-06-13 20:20:40 +0000610!endif
611
612!ifdef XPM
613vimobj = $(vimobj) \
614 $(OBJDIR)\xpm_w32.obj
615!endif
616
617!if ("$(VIMDLL)"=="yes")
618vimdllobj = $(vimobj)
619!if ("$(DEBUG)"=="yes")
620DLLTARGET = vim32d.dll
621!else
622DLLTARGET = vim32.dll
623!endif
624!else
625DLLTARGET = joebob
626!endif
627
628!if ("$(GUI)"=="yes")
629vimobj = $(vimobj) \
630 $(vimwinmain) \
631 $(OBJDIR)\gui.obj \
Bram Moolenaar408fb622005-03-07 23:03:19 +0000632 $(OBJDIR)\gui_beval.obj \
Bram Moolenaar071d4272004-06-13 20:20:40 +0000633 $(OBJDIR)\gui_w32.obj
634!endif
635
636!if ($(OSTYPE)==WIN32)
637vimobj = $(vimobj) \
638 $(OBJDIR)\os_win32.obj $(OBJDIR)\os_mswin.obj
639!elif ($(OSTYPE)==DOS16)
640vimobj = $(vimobj) \
641 $(OBJDIR)\os_msdos.obj
642!endif
643# Blab what we are going to do:
644MSG = Compiling $(OSTYPE) $(TARGET) $(OLETARGET), with:
645!if ("$(GUI)"=="yes")
646MSG = $(MSG) GUI
647!endif
648!if ("$(OLE)"=="yes")
649MSG = $(MSG) OLE
650!endif
651!if ("$(USEDLL)"=="yes")
652MSG = $(MSG) USEDLL
653!endif
654!if ("$(VIMDLL)"=="yes")
655MSG = $(MSG) VIMDLL
656!endif
657!if ("$(FASTCALL)"=="yes")
658MSG = $(MSG) FASTCALL
659!endif
660!if ("$(MBYTE)"=="yes")
661MSG = $(MSG) MBYTE
662!endif
663!if ("$(IME)"=="yes")
664MSG = $(MSG) IME
665! if "$(DYNAMIC_IME)" == "yes"
666MSG = $(MSG)(dynamic)
667! endif
668!endif
669!if ("$(GETTEXT)"=="yes")
670MSG = $(MSG) GETTEXT
671!endif
672!if ("$(ICONV)"=="yes")
673MSG = $(MSG) ICONV
674!endif
675!if ("$(DEBUG)"=="yes")
676MSG = $(MSG) DEBUG
677!endif
678!if ("$(CODEGUARD)"=="yes")
679MSG = $(MSG) CODEGUARD
680!endif
681!if ("$(CSCOPE)"=="yes")
682MSG = $(MSG) CSCOPE
683!endif
684!if ("$(NETBEANS)"=="yes")
685MSG = $(MSG) NETBEANS
686!endif
687!ifdef XPM
688MSG = $(MSG) XPM
689!endif
690!ifdef PERL
691MSG = $(MSG) PERL
692! if "$(DYNAMIC_PERL)" == "yes"
693MSG = $(MSG)(dynamic)
694! endif
695!endif
696!ifdef PYTHON
697MSG = $(MSG) PYTHON
698! if "$(DYNAMIC_PYTHON)" == "yes"
699MSG = $(MSG)(dynamic)
700! endif
701!endif
702!ifdef RUBY
703MSG = $(MSG) RUBY
704! if "$(DYNAMIC_RUBY)" == "yes"
705MSG = $(MSG)(dynamic)
706! endif
707!endif
708!ifdef TCL
709MSG = $(MSG) TCL
710! if "$(DYNAMIC_TCL)" == "yes"
711MSG = $(MSG)(dynamic)
712! endif
713!endif
714MSG = $(MSG) cpu=$(CPUARG)
715MSG = $(MSG) Align=$(ALIGNARG)
716
717!message $(MSG)
718
719!if ($(OSTYPE)==DOS16)
720TARGETS = $(TARGET)
721!else
722!if ("$(VIMDLL)"=="yes")
723TARGETS = $(DLLTARGET)
724!endif
725TARGETS = $(TARGETS) $(TARGET)
726!endif
727
728# Targets:
729all: vim vimrun.exe install.exe xxd uninstal.exe GvimExt/gvimext.dll
730
731vim: $(OSTYPE) $(OBJDIR) $(OBJDIR)\bcc.cfg $(TARGETS)
732 @if exist $(OBJDIR)\version.obj del $(OBJDIR)\version.obj
733 @if exist auto\pathdef.c del auto\pathdef.c
734
735$(OSTYPE):
736 -@md $(OSTYPE)
737
738$(OBJDIR):
739 -@md $(OBJDIR)
740
741xxd:
742 @cd xxd
743 $(MAKE) /f Make_bc5.mak BOR="$(BOR)" BCC="$(CC)"
744 @cd ..
745
746GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
747 cd GvimExt
748 $(MAKE) /f Make_bc5.mak USEDLL=$(USEDLL) BOR=$(BOR)
749 cd ..
750
751install.exe: dosinst.c $(OBJDIR)\bcc.cfg
752!if ($(OSTYPE)==WIN32)
753 $(CC) $(CCARG) -WC -DWIN32 -einstall dosinst.c
754!else
755 $(CC) $(CCARG) -WC -einstall dosinst.c
756!endif
757
758uninstal.exe: uninstal.c $(OBJDIR)\bcc.cfg
759!if ($(OSTYPE)==WIN32)
760 $(CC) $(CCARG) -WC -DWIN32 -O2 -euninstal uninstal.c
761!else
762 $(CC) $(CCARG) -WC -O2 -euninstal uninstal.c
763!endif
764
765clean:
766!if "$(OS)" == "Windows_NT"
767 # For Windows NT/2000, doesn't work on Windows 95/98...
768 # $(COMSPEC) needed to ensure rmdir.exe is not run
769 -@$(COMSPEC) /C rmdir /Q /S $(OBJDIR)
770!else
771 # For Windows 95/98, doesn't work on Windows NT/2000...
772 -@deltree /y $(OBJDIR)
773!endif
774 -@del *.res
775 -@del vim32*.dll
776 -@del vim32*.lib
777 -@del *vim*.exe
778 -@del *install*.exe
779 -@del *.csm
780 -@del *.map
781 -@del *.ilc
782 -@del *.ild
783 -@del *.ilf
784 -@del *.ils
785 -@del *.tds
786!ifdef PERL
787 -@del perl.lib
788!endif
789!ifdef PYTHON
790 -@del python.lib
791!endif
792!ifdef RUBY
793 -@del ruby.lib
794!endif
795!ifdef TCL
796 -@del tcl.lib
797!endif
798!ifdef XPM
799 -@del xpm.lib
800!endif
801 cd xxd
802 $(MAKE) /f Make_bc5.mak BOR="$(BOR)" clean
803 cd ..
804 cd GvimExt
805 $(MAKE) /f Make_bc5.mak BOR="$(BOR)" clean
806 cd ..
807
808$(DLLTARGET): $(OBJDIR) $(vimdllobj)
809 $(LINK) @&&|
810 $(LFLAGSDLL) +
811 c0d32.obj +
812 $(vimdllobj)
813 $<,$*
814!if ("$(CODEGUARD)"=="yes")
815 cg32.lib+
816!endif
817# $(OSTYPE)==WIN32 causes os_mswin.c compilation. FEAT_SHORTCUT in it needs OLE
818!if ("$(OLE)"=="yes" || $(OSTYPE)==WIN32)
819 ole2w32.lib +
820!endif
821!if ($(OSTYPE)==WIN32)
822 import32.lib+
823!ifdef PERL
824 $(PERL_LIB_FLAG)perl.lib+
825!endif
826!ifdef PYTHON
827 $(PYTHON_LIB_FLAG)python.lib+
828!endif
829!ifdef RUBY
830 $(RUBY_LIB_FLAG)ruby.lib+
831!endif
832!ifdef TCL
833 $(TCL_LIB_FLAG)tcl.lib+
834!endif
835!ifdef XPM
836 xpm.lib+
837!endif
838!if ("$(USEDLL)"=="yes")
839 cw32i.lib
840!else
841 cw32.lib
842!endif
843 vim.def
844!else
845 cl.lib
846!endif
847|
848
849!if ("$(VIMDLL)"=="yes")
850$(TARGET): $(OBJDIR) $(DLLTARGET) $(vimmain) $(OBJDIR)\$(RESFILE)
851!else
852$(TARGET): $(OBJDIR) $(vimobj) $(OBJDIR)\$(RESFILE)
853!endif
854 $(LINK) @&&|
855 $(LFLAGS) +
856 $(STARTUPOBJ) +
857!if ("$(VIMDLL)"=="yes")
858 $(vimmain)
859!else
860 $(vimobj)
861!endif
862 $<,$*
863!if ($(OSTYPE)==WIN32)
864!if ("$(CODEGUARD)"=="yes")
865 cg32.lib+
866!endif
867# $(OSTYPE)==WIN32 causes os_mswin.c compilation. FEAT_SHORTCUT in it needs OLE
868!if ("$(OLE)"=="yes" || $(OSTYPE)==WIN32)
869 ole2w32.lib +
870!endif
871 import32.lib+
872!ifdef PERL
873 $(PERL_LIB_FLAG)perl.lib+
874!endif
875!ifdef PYTHON
876 $(PYTHON_LIB_FLAG)python.lib+
877!endif
878!ifdef RUBY
879 $(RUBY_LIB_FLAG)ruby.lib+
880!endif
881!ifdef TCL
882 $(TCL_LIB_FLAG)tcl.lib+
883!endif
884!ifdef XPM
885 xpm.lib+
886!endif
887!if ("$(USEDLL)"=="yes")
888 cw32i.lib
889!else
890 cw32.lib
891!endif
892
893 $(OBJDIR)\$(RESFILE)
894!else
895 emu.lib + cl.lib
896!endif
897|
898
899test:
900 cd testdir
901 $(MAKE) /NOLOGO -f Make_dos.mak win32
902 cd ..
903
904$(OBJDIR)\ex_docmd.obj: ex_docmd.c ex_cmds.h
905
906$(OBJDIR)\ex_eval.obj: ex_eval.c ex_cmds.h
907
908$(OBJDIR)\if_ole.obj: if_ole.cpp
909
910$(OBJDIR)\if_perl.obj: if_perl.c perl.lib
911 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_perl.c
912
913if_perl.c: if_perl.xs typemap
914 $(PERL)\bin\perl.exe $(PERL)\lib\ExtUtils\xsubpp -prototypes -typemap \
915 $(PERL)\lib\ExtUtils\typemap if_perl.xs > $@
916
917$(OBJDIR)\if_python.obj: if_python.c python.lib
918 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_python.c
919
920$(OBJDIR)\if_ruby.obj: if_ruby.c ruby.lib
921 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_ruby.c
922
923$(OBJDIR)\if_tcl.obj: if_tcl.c tcl.lib
924 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_tcl.c
925
926$(OBJDIR)\xpm_w32.obj: xpm_w32.c xpm.lib
927 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc xpm_w32.c
928
929$(OBJDIR)\netbeans.obj: netbeans.c $(NBDEBUG_DEP)
930 $(CC) $(CCARG) $(CC1) $(CC2)$@ netbeans.c
931
932$(OBJDIR)\vim.res: vim.rc version.h tools.bmp tearoff.bmp \
933 vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
934 $(BRC) -fo$(OBJDIR)\vim.res -i $(BOR)\include -w32 -r vim.rc @&&|
935 $(DEFINES)
936|
937
938$(OBJDIR)\pathdef.obj: auto\pathdef.c
939 $(CC) $(CCARG) $(CC1) $(CC2)$@ auto\pathdef.c
940
941
942# Need to escape both quotes and backslashes in $INTERP_DEFINES
943INTERP_DEFINES_ESC_BKS=$(INTERP_DEFINES:\=\\)
944INTERP_DEFINES_ESC=$(INTERP_DEFINES_ESC_BKS:"=\")
945
946# Note: the silly /*"*/ below are there to trick make into accepting
947# the # character as something other than a comment without messing up
948# the preprocessor directive.
949auto\pathdef.c::
950 -@md auto
951 @echo creating auto/pathdef.c
952 @copy /y &&|
953/* pathdef.c */
954/*"*/#include "vim.h"/*"*/
955
956char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)";
957char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)";
958char_u *all_cflags = (char_u *)"$(CC:\=\\) $(CFLAGS:\=\\) $(DEFINES) $(MBDEFINES) $(INTERP_DEFINES_ESC) $(OPT) $(EXETYPE) $(CPUARG) $(ALIGNARG) $(DEBUG_FLAG) $(CODEGUARD_FLAG)";
959char_u *all_lflags = (char_u *)"$(LINK:\=\\) $(LFLAGS:\=\\)";
960char_u *compiled_user = (char_u *)"$(USERNAME)";
961char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";
962| auto\pathdef.c
963
964perl.lib: $(PERL)\lib\CORE\perl$(PERL_VER).lib
965 coff2omf $(PERL)\lib\CORE\perl$(PERL_VER).lib $@
966
967python.lib: $(PYTHON)\libs\python$(PYTHON_VER).lib
968 coff2omf $(PYTHON)\libs\python$(PYTHON_VER).lib $@
969
970ruby.lib: $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
971 coff2omf $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib $@
972
973# For some reason, the coff2omf method doesn't work on libXpm.lib, so
974# we have to manually generate an import library straight from the DLL.
975xpm.lib: $(XPM)\lib\libXpm.lib
976 implib -a $@ $(XPM)\bin\libXpm.dll
977
978tcl.lib: $(TCL_LIB)
979!if ("$(DYNAMIC_TCL)" == "yes")
980 copy $(TCL_LIB) $@
981!else
982 coff2omf $(TCL_LIB) $@
983!endif
984
985!if ("$(DYNAMIC_TCL)" == "yes")
986tclstub$(TCL_VER)-bor.lib:
987 -@IF NOT EXIST $@ ECHO You must download tclstub$(TCL_VER)-bor.lib separately and\
988 place it in the src directory in order to compile a dynamic TCL-enabled\
989 (g)vim with the Borland compiler. You can get the tclstub$(TCL_VER)-bor.lib file\
990 at http://mywebpage.netscape.com/sharppeople/vim/tclstub$(TCL_VER)-bor.lib
991!endif
992
993# vimrun.exe:
994vimrun.exe: vimrun.c
995!if ("$(USEDLL)"=="yes")
996 $(CC) -WC -O1 -I$(INCLUDE) -L$(LIB) -D_RTLDLL vimrun.c cw32mti.lib
997!else
998 $(CC) -WC -O1 -I$(INCLUDE) -L$(LIB) vimrun.c
999!endif
1000
1001# The dependency on $(OBJDIR) is to have bcc.cfg generated each time.
1002$(OBJDIR)\bcc.cfg: Make_bc5.mak $(OBJDIR)
1003 copy /y &&|
1004 $(CFLAGS)
1005 -L$(LIB)
1006 $(DEFINES)
1007 $(MBDEFINES)
1008 $(INTERP_DEFINES)
1009 $(EXETYPE)
1010 $(DEBUG_FLAG)
1011 $(OPT)
1012 $(CODEGUARD_FLAG)
1013 $(CPUARG)
1014 $(ALIGNARG)
1015| $@
1016
1017# vi:set sts=4 sw=4: