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