Merged from the latest developing branch.
[MacVim/KaoriYa.git] / src / Make_bc5.mak
bloba1d92bdd3a813d7d5a5bb6f7b2e03e5d3a008bf6
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)
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
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.
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>
27 # let the make utility do the hard work:
28 .AUTODEPEND
29 .CACHEAUTODEPEND
31 # VARIABLES:
32 # name value (default)
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 # RUBY_VER_LONG same, but in format with dot. (1.6)
55 # 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)
57 # NOTE: multi-byte support is broken in the Borland libraries,
58 # not everything will work properly! Esp. handling multi-byte
59 # file names.
60 # 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)
83 # NBDEBUG no or yes: include support for debugging Netbeans interface (no)
84 # XPM define to path to XPM dir to get support for loading XPM images.
86 ### BOR: root of the BC installation
87 !if ("$(BOR)"=="")
88 BOR = c:\bc5
89 !endif
91 ### LINK: Name of the linker: tlink or ilink32 (this is below, depends on
92 # $(OSTYPE)
94 ### GUI: yes for GUI version, no for console version
95 !if ("$(GUI)"=="")
96 GUI = yes
97 !endif
99 ### MBYTE: yes for multibyte support, no to disable it.
100 !if ("$(MBYTE)"=="")
101 MBYTE = yes
102 !endif
104 ### IME: yes for multibyte support, no to disable it.
105 !if ("$(IME)"=="")
106 IME = yes
107 !endif
108 !if ("$(DYNAMIC_IME)"=="")
109 DYNAMIC_IME = yes
110 !endif
112 ### GETTEXT: yes for multilanguage support, no to disable it.
113 !if ("$(GETTEXT)"=="")
114 GETTEXT = yes
115 !endif
117 ### ICONV: yes to enable dynamic-iconv support, no to disable it
118 !if ("$(ICONV)"=="")
119 ICONV = yes
120 !endif
122 ### CSCOPE: yes to enable Cscope support, no to disable it
123 !if ("$(CSCOPE)"=="")
124 CSCOPE = yes
125 !endif
127 ### NETBEANS: yes to enable NetBeans interface support, no to disable it
128 !if ("$(NETBEANS)"=="") && ("$(GUI)"=="yes")
129 NETBEANS = yes
130 !endif
132 ### PERL: uncomment this line if you want perl support in vim
133 # PERL=c:\perl
135 ### PYTHON: uncomment this line if you want python support in vim
136 # PYTHON=c:\python22
138 ### RUBY: uncomment this line if you want ruby support in vim
139 # RUBY=c:\ruby
141 ### TCL: uncomment this line if you want tcl support in vim
142 # TCL=c:\tcl
144 ### OLE: no for normal gvim, yes for OLE-capable gvim (only works with GUI)
145 #OLE = yes
147 ### OSTYPE: DOS16 for Windows 3.1 version, WIN32 for Windows 95/98/NT/2000
148 # version
149 !if ("$(OSTYPE)"=="")
150 OSTYPE = WIN32
151 !endif
153 ### DEBUG: Uncomment to make an executable for debugging
154 # DEBUG = yes
155 !if ("$(DEBUG)"=="yes")
156 DEBUG_FLAG = -v
157 !endif
159 ### CODEGUARD: Uncomment to use the CODEGUARD stuff (BC 5.0 or later):
160 # CODEGUARD = yes
161 !if ("$(CODEGUARD)"=="yes")
162 CODEGUARD_FLAG = -vG
163 !endif
165 ### CPUNR: set your target processor (3 to 6)
166 !if ("$(CPUNR)" == "i386") || ("$(CPUNR)" == "3")
167 CPUNR = 3
168 !elif ("$(CPUNR)" == "i486") || ("$(CPUNR)" == "4")
169 CPUNR = 4
170 !elif ("$(CPUNR)" == "i586") || ("$(CPUNR)" == "5")
171 CPUNR = 5
172 !elif ("$(CPUNR)" == "i686") || ("$(CPUNR)" == "6")
173 CPUNR = 6
174 !else
175 CPUNR = 3
176 !endif
178 ### Comment out to use precompiled headers (faster, but uses lots of disk!)
179 HEADERS = -H -H=vim.csm -Hc
181 ### USEDLL: no for statically linked version of run-time, yes for DLL runtime
182 !if ("$(USEDLL)"=="")
183 USEDLL = no
184 !endif
186 ### VIMDLL: yes for a DLL version of VIM (NOT RECOMMENDED), no otherwise
187 #VIMDLL = yes
189 ### ALIGN: alignment you desire: (1,2 or 4: s/b 4 for Win32, 2 for DOS)
190 !if ("$(ALIGN)"=="")
191 !if ($(OSTYPE)==DOS16)
192 ALIGN = 2
193 !else
194 ALIGN = 4
195 !endif
196 !endif
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)"=="")
210 FASTCALL = yes
211 !endif
213 ### OPTIMIZE: SPEED to optimize for speed, SPACE otherwise (SPEED RECOMMENDED)
214 !if ("$(OPTIMIZE)"=="")
215 OPTIMIZE = MAXSPEED
216 !endif
218 ### FEATURES: TINY, SMALL, NORMAL, BIG or HUGE (BIG for WIN32, SMALL for DOS16)
219 !if ("$(FEATURES)"=="")
220 ! if ($(OSTYPE)==DOS16)
221 FEATURES = SMALL
222 ! else
223 FEATURES = BIG
224 ! endif
225 !endif
227 ### POSTSCRIPT: uncomment this line if you want PostScript printing
228 #POSTSCRIPT = yes
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
236 ### Set the default $(WINVER) to make it work with Bcc 5.5.
237 !ifndef WINVER
238 WINVER = 0x0400
239 !endif
242 # Sanity checks for the above options:
245 !if ($(OSTYPE)==DOS16)
246 !if (($(CPUNR)+0)>4)
247 !error CPUNR Must be less than or equal to 4 for DOS16
248 !endif
250 !if (($(ALIGN)+0)>2)
251 !error ALIGN Must be less than or equal to 2 for DOS16
252 !endif
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
260 !if ($(OSTYPE)!=WIN32) && ($(OSTYPE)!=DOS16)
261 !error Check the OSTYPE variable again: $(OSTYPE) is not supported!
262 !endif
265 # Optimizations: change as desired (RECOMMENDATION: Don't change!):
267 !if ("$(DEBUG)"=="yes")
268 OPT = -Od -N
269 !else
270 !if ("$(OPTIMIZE)"=="SPACE")
271 OPT = -O1 -f- -d
272 !elif ("$(OPTIMIZE)"=="MAXSPEED")
273 OPT = -O2 -f- -d -Ocavi -O
274 !else
275 OPT = -O2 -f- -d -Oc -O
276 !endif
277 !if ("$(FASTCALL)"=="yes")
278 OPT = $(OPT) -pr
279 !endif
280 !if ("$(CODEGUARD)"!="yes")
281 OPT = $(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:
290 LIB = $(BOR)\lib
291 INCLUDE = $(BOR)\include;.;proto
292 DEFINES = -DFEAT_$(FEATURES) -DWIN32 -DHAVE_PATHDEF \
293 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
295 !ifdef PERL
296 INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_PERL
297 INCLUDE = $(PERL)\lib\core;$(INCLUDE)
298 ! ifndef PERL_VER
299 PERL_VER = 56
300 ! endif
301 ! if ("$(DYNAMIC_PERL)" == "yes")
302 ! if ($(PERL_VER) > 55)
303 INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
304 PERL_LIB_FLAG = /nodefaultlib:
305 ! else
306 ! message "Cannot dynamically load Perl versions less than 5.6. Loading statically..."
307 ! endif
308 ! endif
309 !endif
311 !ifdef PYTHON
312 INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_PYTHON
313 INCLUDE = $(PYTHON)\include;$(INCLUDE)
314 !ifndef PYTHON_VER
315 PYTHON_VER = 22
316 !endif
317 !if "$(DYNAMIC_PYTHON)" == "yes"
318 INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
319 PYTHON_LIB_FLAG = /nodefaultlib:
320 !endif
321 !endif
323 !ifdef RUBY
324 !ifndef RUBY_VER
325 RUBY_VER = 16
326 !endif
327 !ifndef RUBY_VER_LONG
328 RUBY_VER_LONG = 1.6
329 !endif
331 !if "$(RUBY_VER)" == "16"
332 !ifndef RUBY_PLATFORM
333 RUBY_PLATFORM = i586-mswin32
334 !endif
335 !ifndef RUBY_INSTALL_NAME
336 RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER)
337 !endif
338 !else
339 !ifndef RUBY_PLATFORM
340 RUBY_PLATFORM = i386-mswin32
341 !endif
342 !ifndef RUBY_INSTALL_NAME
343 RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER)
344 !endif
345 !endif
347 INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_RUBY
348 INCLUDE = $(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM);$(INCLUDE)
350 !if "$(DYNAMIC_RUBY)" == "yes"
351 INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
352 INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_RUBY_VER=$(RUBY_VER)
353 RUBY_LIB_FLAG = /nodefaultlib:
354 !endif
355 !endif
357 !ifdef TCL
358 INTERP_DEFINES = $(INTERP_DEFINES) -DFEAT_TCL
359 INCLUDE = $(TCL)\include;$(INCLUDE)
360 !ifndef TCL_VER
361 TCL_VER = 83
362 !endif
363 TCL_LIB = $(TCL)\lib\tcl$(TCL_VER).lib
364 TCL_LIB_FLAG =
365 !if "$(DYNAMIC_TCL)" == "yes"
366 INTERP_DEFINES = $(INTERP_DEFINES) -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
367 TCL_LIB = tclstub$(TCL_VER)-bor.lib
368 TCL_LIB_FLAG =
369 !endif
370 !endif
372 # DO NOT change below:
374 CPUARG = -$(CPUNR)
375 ALIGNARG = -a$(ALIGN)
377 !if ("$(DEBUG)"=="yes")
378 DEFINES=$(DEFINES) -DDEBUG
379 !endif
381 !if ("$(OLE)"=="yes")
382 DEFINES = $(DEFINES) -DFEAT_OLE
383 !endif
385 !if ("$(MBYTE)"=="yes")
386 MBDEFINES = $(MBDEFINES) -DFEAT_MBYTE
387 !endif
388 !if ("$(IME)"=="yes")
389 MBDEFINES = $(MBDEFINES) -DFEAT_MBYTE_IME
390 !if ("$(DYNAMIC_IME)" == "yes")
391 MBDEFINES = $(MBDEFINES) -DDYNAMIC_IME
392 !endif
393 !endif
394 !if ("$(ICONV)"=="yes")
395 MBDEFINES = $(MBDEFINES) -DDYNAMIC_ICONV
396 !endif
397 !if ("$(GETTEXT)"=="yes")
398 MBDEFINES = $(MBDEFINES) -DDYNAMIC_GETTEXT
399 !endif
401 !if ("$(CSCOPE)"=="yes")
402 DEFINES = $(DEFINES) -DFEAT_CSCOPE
403 !endif
405 !if ("$(GUI)"=="yes")
406 DEFINES = $(DEFINES) -DFEAT_GUI_W32 -DFEAT_CLIPBOARD
407 !if ("$(DEBUG)"=="yes")
408 TARGET = gvimd.exe
409 !else
410 TARGET = gvim.exe
411 !endif
412 !if ("$(VIMDLL)"=="yes")
413 EXETYPE=-WD
414 DEFINES = $(DEFINES) -DVIMDLL
415 !else
416 EXETYPE=-W
417 !endif
418 STARTUPOBJ = c0w32.obj
419 LINK2 = -aa
420 RESFILE = vim.res
421 !else
422 !undef NETBEANS
423 !undef XPM
424 !undef VIMDLL
425 !if ("$(DEBUG)"=="yes")
426 TARGET = vimd.exe
427 !else
428 # for now, anyway: VIMDLL is only for the GUI version
429 TARGET = vim.exe
430 !endif
431 !if ($(OSTYPE)==DOS16)
432 DEFINES= -DFEAT_$(FEATURES) -DMSDOS
433 EXETYPE=-ml
434 STARTUPOBJ = c0l.obj
435 LINK2 =
436 !else
437 EXETYPE=-WC
438 STARTUPOBJ = c0x32.obj
439 LINK2 = -ap -OS -o -P
440 !endif
441 RESFILE = vim.res
442 !endif
444 !if ("$(NETBEANS)"=="yes")
445 DEFINES = $(DEFINES) -DFEAT_NETBEANS_INTG
446 !if ("$(NBDEBUG)"=="yes")
447 DEFINES = $(DEFINES) -DNBDEBUG
448 NBDEBUG_DEP = nbdebug.h nbdebug.c
449 !endif
450 !endif
452 !ifdef XPM
453 !if ("$(GUI)"=="yes")
454 DEFINES = $(DEFINES) -DFEAT_XPM_W32
455 INCLUDE = $(XPM)\include;$(INCLUDE)
456 !endif
457 !endif
459 !if ("$(USEDLL)"=="yes")
460 DEFINES = $(DEFINES) -D_RTLDLL
461 !endif
463 !if ("$(DEBUG)"=="yes")
464 OBJDIR = $(OSTYPE)\objdbg
465 !else
466 !if ("$(GUI)"=="yes")
467 !if ("$(OLE)"=="yes")
468 OBJDIR = $(OSTYPE)\oleobj
469 !else
470 OBJDIR = $(OSTYPE)\gobj
471 !endif
472 !else
473 OBJDIR = $(OSTYPE)\obj
474 !endif
475 !endif
477 !if ("$(POSTSCRIPT)"=="yes")
478 DEFINES = $(DEFINES) -DMSWINPS
479 !endif
481 ##### BASE COMPILER/TOOLS RULES #####
482 MAKE = $(BOR)\bin\make
483 CFLAGS = -w-aus -w-par -w-pch -w-ngu -w-csu -I$(INCLUDE)
484 !if ($(OSTYPE)==DOS16)
485 BRC =
486 !if ("$(LINK)"=="")
487 LINK = $(BOR)\BIN\TLink
488 !endif
489 CC = $(BOR)\BIN\Bcc
490 LFLAGS = -Tde -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
491 LFLAGSDLL =
492 CFLAGS = $(CFLAGS) -H- $(HEADERS)
493 !else
494 BRC = $(BOR)\BIN\brc32
495 !if ("$(LINK)"=="")
496 LINK = $(BOR)\BIN\ILink32
497 !endif
498 CC = $(BOR)\BIN\Bcc32
499 LFLAGS = -OS -Tpe -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
500 LFLAGSDLL = -Tpd -c -m -L$(LIB) $(DEBUG_FLAG) $(LINK2)
501 CFLAGS = $(CFLAGS) -d -RT- -k- -Oi $(HEADERS) -f-
502 !endif
504 CC1 = -c
505 CC2 = -o
506 CCARG = +$(OBJDIR)\bcc.cfg
508 # implicit rules:
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 = .
516 {.}.c{$(OBJDIR)}.obj:
517 $(CC) $(CCARG) $(CC1) -n$(OBJDIR)\ {$< }
519 .cpp.obj:
520 $(CC) $(CCARG) $(CC1) $(CC2)$@ $*.cpp
522 !if ($(OSTYPE)==DOS16)
523 !else # win32:
524 vimmain = \
525 $(OBJDIR)\os_w32exe.obj
526 !if ("$(VIMDLL)"=="yes")
527 vimwinmain = \
528 $(OBJDIR)\os_w32dll.obj
529 !else
530 vimwinmain = \
531 $(OBJDIR)\os_w32exe.obj
532 !endif
533 !endif
535 vimobj = \
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 \
550 $(OBJDIR)\hardcopy.obj \
551 $(OBJDIR)\hashtab.obj \
552 $(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 \
565 $(OBJDIR)\popupmnu.obj \
566 $(OBJDIR)\quickfix.obj \
567 $(OBJDIR)\regexp.obj \
568 $(OBJDIR)\screen.obj \
569 $(OBJDIR)\search.obj \
570 $(OBJDIR)\spell.obj \
571 $(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
580 !if ("$(OLE)"=="yes")
581 vimobj = $(vimobj) \
582 $(OBJDIR)\if_ole.obj
583 !endif
585 !ifdef PERL
586 vimobj = $(vimobj) \
587 $(OBJDIR)\if_perl.obj
588 !endif
590 !ifdef PYTHON
591 vimobj = $(vimobj) \
592 $(OBJDIR)\if_python.obj
593 !endif
595 !ifdef RUBY
596 vimobj = $(vimobj) \
597 $(OBJDIR)\if_ruby.obj
598 !endif
600 !ifdef TCL
601 vimobj = $(vimobj) \
602 $(OBJDIR)\if_tcl.obj
603 !endif
605 !if ("$(CSCOPE)"=="yes")
606 vimobj = $(vimobj) \
607 $(OBJDIR)\if_cscope.obj
608 !endif
610 !if ("$(NETBEANS)"=="yes")
611 vimobj = $(vimobj) \
612 $(OBJDIR)\netbeans.obj
613 !endif
615 !ifdef XPM
616 vimobj = $(vimobj) \
617 $(OBJDIR)\xpm_w32.obj
618 !endif
620 !if ("$(VIMDLL)"=="yes")
621 vimdllobj = $(vimobj)
622 !if ("$(DEBUG)"=="yes")
623 DLLTARGET = vim32d.dll
624 !else
625 DLLTARGET = vim32.dll
626 !endif
627 !else
628 DLLTARGET = joebob
629 !endif
631 !if ("$(GUI)"=="yes")
632 vimobj = $(vimobj) \
633 $(vimwinmain) \
634 $(OBJDIR)\gui.obj \
635 $(OBJDIR)\gui_beval.obj \
636 $(OBJDIR)\gui_w32.obj
637 !endif
639 !if ($(OSTYPE)==WIN32)
640 vimobj = $(vimobj) \
641 $(OBJDIR)\os_win32.obj $(OBJDIR)\os_mswin.obj
642 !elif ($(OSTYPE)==DOS16)
643 vimobj = $(vimobj) \
644 $(OBJDIR)\os_msdos.obj
645 !endif
646 # Blab what we are going to do:
647 MSG = Compiling $(OSTYPE) $(TARGET) $(OLETARGET), with:
648 !if ("$(GUI)"=="yes")
649 MSG = $(MSG) GUI
650 !endif
651 !if ("$(OLE)"=="yes")
652 MSG = $(MSG) OLE
653 !endif
654 !if ("$(USEDLL)"=="yes")
655 MSG = $(MSG) USEDLL
656 !endif
657 !if ("$(VIMDLL)"=="yes")
658 MSG = $(MSG) VIMDLL
659 !endif
660 !if ("$(FASTCALL)"=="yes")
661 MSG = $(MSG) FASTCALL
662 !endif
663 !if ("$(MBYTE)"=="yes")
664 MSG = $(MSG) MBYTE
665 !endif
666 !if ("$(IME)"=="yes")
667 MSG = $(MSG) IME
668 ! if "$(DYNAMIC_IME)" == "yes"
669 MSG = $(MSG)(dynamic)
670 ! endif
671 !endif
672 !if ("$(GETTEXT)"=="yes")
673 MSG = $(MSG) GETTEXT
674 !endif
675 !if ("$(ICONV)"=="yes")
676 MSG = $(MSG) ICONV
677 !endif
678 !if ("$(DEBUG)"=="yes")
679 MSG = $(MSG) DEBUG
680 !endif
681 !if ("$(CODEGUARD)"=="yes")
682 MSG = $(MSG) CODEGUARD
683 !endif
684 !if ("$(CSCOPE)"=="yes")
685 MSG = $(MSG) CSCOPE
686 !endif
687 !if ("$(NETBEANS)"=="yes")
688 MSG = $(MSG) NETBEANS
689 !endif
690 !ifdef XPM
691 MSG = $(MSG) XPM
692 !endif
693 !ifdef PERL
694 MSG = $(MSG) PERL
695 ! if "$(DYNAMIC_PERL)" == "yes"
696 MSG = $(MSG)(dynamic)
697 ! endif
698 !endif
699 !ifdef PYTHON
700 MSG = $(MSG) PYTHON
701 ! if "$(DYNAMIC_PYTHON)" == "yes"
702 MSG = $(MSG)(dynamic)
703 ! endif
704 !endif
705 !ifdef RUBY
706 MSG = $(MSG) RUBY
707 ! if "$(DYNAMIC_RUBY)" == "yes"
708 MSG = $(MSG)(dynamic)
709 ! endif
710 !endif
711 !ifdef TCL
712 MSG = $(MSG) TCL
713 ! if "$(DYNAMIC_TCL)" == "yes"
714 MSG = $(MSG)(dynamic)
715 ! endif
716 !endif
717 MSG = $(MSG) cpu=$(CPUARG)
718 MSG = $(MSG) Align=$(ALIGNARG)
720 !message $(MSG)
722 !if ($(OSTYPE)==DOS16)
723 TARGETS = $(TARGET)
724 !else
725 !if ("$(VIMDLL)"=="yes")
726 TARGETS = $(DLLTARGET)
727 !endif
728 TARGETS = $(TARGETS) $(TARGET)
729 !endif
731 # Targets:
732 all: vim vimrun.exe install.exe xxd uninstal.exe GvimExt/gvimext.dll
734 vim: $(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
738 $(OSTYPE):
739 -@md $(OSTYPE)
741 $(OBJDIR):
742 -@md $(OBJDIR)
744 xxd:
745 @cd xxd
746 $(MAKE) /f Make_bc5.mak BOR="$(BOR)" BCC="$(CC)"
747 @cd ..
749 GvimExt/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 ..
754 install.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
761 uninstal.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
768 clean:
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 ..
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
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
896 $(OBJDIR)\$(RESFILE)
897 !else
898 emu.lib + cl.lib
899 !endif
902 test:
903 cd testdir
904 $(MAKE) /NOLOGO -f Make_dos.mak win32
905 cd ..
907 $(OBJDIR)\ex_docmd.obj: ex_docmd.c ex_cmds.h
909 $(OBJDIR)\ex_eval.obj: ex_eval.c ex_cmds.h
911 $(OBJDIR)\if_ole.obj: if_ole.cpp
913 $(OBJDIR)\if_perl.obj: if_perl.c perl.lib
914 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_perl.c
916 if_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 > $@
920 $(OBJDIR)\if_python.obj: if_python.c python.lib
921 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_python.c
923 $(OBJDIR)\if_ruby.obj: if_ruby.c ruby.lib
924 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_ruby.c
926 $(OBJDIR)\if_tcl.obj: if_tcl.c tcl.lib
927 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc if_tcl.c
929 $(OBJDIR)\xpm_w32.obj: xpm_w32.c xpm.lib
930 $(CC) $(CCARG) $(CC1) $(CC2)$@ -pc xpm_w32.c
932 $(OBJDIR)\netbeans.obj: netbeans.c $(NBDEBUG_DEP)
933 $(CC) $(CCARG) $(CC1) $(CC2)$@ netbeans.c
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)
941 $(OBJDIR)\pathdef.obj: auto\pathdef.c
942 $(CC) $(CCARG) $(CC1) $(CC2)$@ auto\pathdef.c
945 # Need to escape both quotes and backslashes in $INTERP_DEFINES
946 INTERP_DEFINES_ESC_BKS=$(INTERP_DEFINES:\=\\)
947 INTERP_DEFINES_ESC=$(INTERP_DEFINES_ESC_BKS:"=\")
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.
952 auto\pathdef.c::
953 -@md auto
954 @echo creating auto/pathdef.c
955 @copy /y &&|
956 /* pathdef.c */
957 /*"*/#include "vim.h"/*"*/
959 char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)";
960 char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)";
961 char_u *all_cflags = (char_u *)"$(CC:\=\\) $(CFLAGS:\=\\) $(DEFINES) $(MBDEFINES) $(INTERP_DEFINES_ESC) $(OPT) $(EXETYPE) $(CPUARG) $(ALIGNARG) $(DEBUG_FLAG) $(CODEGUARD_FLAG)";
962 char_u *all_lflags = (char_u *)"$(LINK:\=\\) $(LFLAGS:\=\\)";
963 char_u *compiled_user = (char_u *)"$(USERNAME)";
964 char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";
965 | auto\pathdef.c
967 perl.lib: $(PERL)\lib\CORE\perl$(PERL_VER).lib
968 coff2omf $(PERL)\lib\CORE\perl$(PERL_VER).lib $@
970 python.lib: $(PYTHON)\libs\python$(PYTHON_VER).lib
971 coff2omf $(PYTHON)\libs\python$(PYTHON_VER).lib $@
973 ruby.lib: $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib
974 coff2omf $(RUBY)\lib\$(RUBY_INSTALL_NAME).lib $@
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.
978 xpm.lib: $(XPM)\lib\libXpm.lib
979 implib -a $@ $(XPM)\bin\libXpm.dll
981 tcl.lib: $(TCL_LIB)
982 !if ("$(DYNAMIC_TCL)" == "yes")
983 copy $(TCL_LIB) $@
984 !else
985 coff2omf $(TCL_LIB) $@
986 !endif
988 !if ("$(DYNAMIC_TCL)" == "yes")
989 tclstub$(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
996 # vimrun.exe:
997 vimrun.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
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 | $@
1020 # vi:set sts=4 sw=4: