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