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