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