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