⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile.bor

📁 VIM文本编辑器
💻 BOR
字号:
#
# Makefile for Vim.
# Compiler: Borland C++ 5.0 and later 32-bit compiler
#  Targets: Dos16 or Win32 (Windows NT and Windows 95) (with/without GUI)
#
# Contributed by Ben Singer.
# Updated 4/1997 by Ron Aaron
#	6/1997 - added support for 16 bit DOS
#	Note: this has been tested, and works, for BC5.  Your mileage may vary.
#	Has been reported NOT to work with BC 4.52.  Maybe it can be fixed?
#	10/1997 - ron - fixed bugs w/ BC 5.02
#	8/1998 - ron - updated with new targets, fixed some stuff
#
# It builds on Windows 95 and NT-Intel, producing the same binary in either
# case.  To build using Microsoft Visual C++, use Makefile.w32.
#

# let the make utility do the hard work:
.AUTODEPEND
.CACHEAUTODEPEND
#
# VARIABLES LIST:
#
#   BOR	    -	path to root of Borland C install, typ: \BC5
#   DEBUG   -	define if you wish a DEBUGging build
#   CODEGUARD -	define (for BORLAND only) if you want to use CODEGUARD
#   GUI	    -	define if you want the GUI version
#   CPU	    -	one of 1 through 6 - select CPU to compile for
#   USEDLL  -	use the Runtime library DLL
#   VIMDLL  -	create vim32.dll, and stub (g)vim.exe
#   ALIGN   -	Alignment to use (1,2,4)
#   FASTCALL -	Use register-based function protocol
#   OS	    -	DOS16 or WIN32
#
# Change this to point to the root of *your* BC installation:
BOR = c:\bc5
#
# PERL STUFF
# 'USEDLL' doesn't seem to work with perl, don't know why.
# if the following line is uncommented, you will have perl support in vim:
# PERL=perl.exe
PERLLIB=c:\perl\lib
#
# OS Target - can be DOS16 or WIN32
OS = WIN32
#
# Uncomment to make an executable for debugging:
#DEBUG = -v
#
# Comment out to make a console-mode only version:
GUI = 1
#
# Uncomment to make an OLE-capable version:
#OLE = 1
#
# Uncomment to use the CODEGUARD stuff (BC 5.0 or later):
#CODEGUARD = -vG
#
# Uncomment to use FASTCALL calling convention (RECOMMENDED!)
FASTCALL = 1
#
# Optimize for space or speed? (SPEED RECOMMENDED)
OPTIMIZE = SPEED
#
# Change as appropriate for your target processor (3 to 6):
CPU = 3
#
# Comment out to use precompiled headers (faster, but uses lots of disk!)
HEADERS = -H -H=vim.csm -Hc
#
# Comment out to use statically linked version of run-time:
USEDLL = 1
#
# Uncomment to make a DLL version of VIM (NOT RECOMMENDED):
#VIMDLL = 1
#
# Change to alignment you desire: (1,2 or 4: s/b 4 for Win32, 2 for DOS)
!if ($(OS)==DOS16)
ALIGN = 2
!else
ALIGN = 4
!endif
#
# Sanity checks for the above options:
#
!if ($(OS)==DOS16)
!if (($(CPU)+0)>4)
!error CPU Must be less than or equal to 4 for DOS16
!endif
#
!if (($(ALIGN)+0)>2)
!error ALIGN Must be less than or equal to 2 for DOS16
!endif
#
!else	# not DOS16
!if (($(CPU)+0)<3)
!error CPU Must be greater or equal to 3 for WIN32
!endif
!endif
#
!if ($(OS)!=WIN32) && ($(OS)!=DOS16)
!error Check the OS variable again: $(OS) is not supported!
!endif
#
# Optimizations: change as desired (RECOMMENDATION: Don't change!):
#
!ifdef DEBUG
OPT = -Od -N
!else
!if ($(OPTIMIZE)==SPACE)
OPT = -O1 -f- -N- -d
!else
OPT = -O2 -f- -d -N- -Oca -O
!endif
!ifdef FASTCALL
OPT = $(OPT) -pr
!endif
!ifndef CODEGUARD
OPT = $(OPT) -vi-
!endif
!endif
!if ($(OS)==DOS16)
!undef GUI
!undef VIMDLL
!undef USEDLL
!endif
# shouldn't have to change:
LIB = $(BOR)\lib
INCLUDE = $(BOR)\include;$(PERLLIB)\core;.;proto 
DEFINES = -DWIN32 -DPC
#
!ifdef PERL
DEFINES = $(DEFINES) -DHAVE_PERL_INTERP
INCLUDE = $(PERLIB)\core;$(INCLUDE)
!endif
#
# DO NOT change below:
#
CPU = -$(CPU)
ALIGN = -a$(ALIGN)
#
!ifdef DEBUG
DEFINES=$(DEFINES) -DDEBUG
!endif
#
!if ($(OLE)==1)
DEFINES = $(DEFINES) -DHAVE_OLE
!endif
#
!if ($(GUI)==1)
DEFINES = $(DEFINES) -DUSE_GUI_WIN32 -DUSE_CLIPBOARD
!ifdef DEBUG
TARGET = gvimd.exe
!else
TARGET = gvim.exe
!endif
!ifdef VIMDLL
EXETYPE=-WD
DEFINES = $(DEFINES) -DVIMDLL
!else
EXETYPE=-WE
!endif
STARTUPOBJ = c0w32.obj
LINK2 = -aa
RESFILE = vim.res
!else
!ifdef DEBUG
TARGET = vimd.exe
!else
# for now, anyway: VIMDLL is only for the GUI version
!undef VIMDLL
TARGET = vim.exe
!endif
!if ($(OS)==DOS16)
DEFINES=-DMSDOS
EXETYPE=-ml
STARTUPOBJ = c0l.obj
LINK2 =
!else
EXETYPE=-WC
STARTUPOBJ = c0x32.obj
LINK2 = -ap -OS -o -P
!endif
RESFILE =
!endif

!ifdef USEDLL
DEFINES = $(DEFINES) -D_RTLDLL
!endif

!ifdef DEBUG
OBJDIR	= $(OS)\objdbg
!else
!if ($(GUI)==1)
OBJDIR	= $(OS)\gobj
!else
OBJDIR	= $(OS)\obj
!endif
!endif

##### BASE COMPILER/TOOLS RULES #####
!if ($(OS)==DOS16)
BRC =
LINK	= $(BOR)\BIN\TLink
CC   = $(BOR)\BIN\Bcc
LFLAGS	= -Tde -c -m -L$(LIB) $(DEBUG) $(LINK2)
LFLAGSDLL  =
CFLAGS = -w- -w-aus -w-par -I$(INCLUDE) -H- -P- $(HEADERS)
!else
BRC = brc32
LINK	= $(BOR)\BIN\TLink32
CC   = $(BOR)\BIN\Bcc32
LFLAGS	= -OS -r -Tpe -c -m -L$(LIB) $(DEBUG) $(LINK2)
LFLAGSDLL  = -Tpd -c -m -L$(LIB) $(DEBUG) $(LINK2)
CFLAGS = -w- -w-aus -w-par -I$(INCLUDE) -P- -d -x- -RT- -k- -Oi $(HEADERS) -N- -f-
!endif

CC1 = -c
CC2 = -o
CC = $(CC) +$(OBJDIR)\bcc.cfg

# implicit rules:
.c.obj:
	$(CC) $(CC1) $(CC2)$@ $*.c

.cpp.obj:
	$(CC) $(CC1) $(CC2)$@ $*.cpp

!if ($(OS)==DOS16)
!else # win32:
vimmain = \
	$(OBJDIR)\os_w32exe.obj
!ifdef VIMDLL
vimwinmain = \
	$(OBJDIR)\os_w32dll.obj
!else
vimwinmain = \
	$(OBJDIR)\os_w32exe.obj
!endif
!endif

vimobj = $(vimwinmain) \
	$(OBJDIR)\buffer.obj \
	$(OBJDIR)\charset.obj \
	$(OBJDIR)\digraph.obj \
	$(OBJDIR)\edit.obj \
	$(OBJDIR)\eval.obj \
	$(OBJDIR)\ex_cmds.obj \
	$(OBJDIR)\ex_docmd.obj \
	$(OBJDIR)\ex_getln.obj \
	$(OBJDIR)\fileio.obj \
	$(OBJDIR)\getchar.obj \
	$(OBJDIR)\main.obj \
	$(OBJDIR)\mark.obj \
	$(OBJDIR)\memfile.obj \
	$(OBJDIR)\memline.obj \
	$(OBJDIR)\message.obj \
	$(OBJDIR)\misc1.obj \
	$(OBJDIR)\misc2.obj \
	$(OBJDIR)\multbyte.obj \
	$(OBJDIR)\normal.obj \
	$(OBJDIR)\ops.obj \
	$(OBJDIR)\option.obj \
	$(OBJDIR)\quickfix.obj \
	$(OBJDIR)\regexp.obj \
	$(OBJDIR)\screen.obj \
	$(OBJDIR)\search.obj \
	$(OBJDIR)\syntax.obj \
	$(OBJDIR)\tag.obj \
	$(OBJDIR)\term.obj \
	$(OBJDIR)\ui.obj \
	$(OBJDIR)\undo.obj \
	$(OBJDIR)\version.obj \
	$(OBJDIR)\window.obj

!if ($(OLE)==1)
vimobj = $(vimobj) \
	$(OBJDIR)\if_ole.obj
!endif

!ifdef PERL
vimobj = $(vimobj) \
    $(OBJDIR)\if_perl.obj
!endif

!ifdef VIMDLL
vimdllobj = $(vimobj)
!ifdef DEBUG
DLLTARGET = vim32d.dll
!else
DLLTARGET = vim32.dll
!endif
!else
DLLTARGET = joebob
!endif

!if ($(GUI)==1)
vimobj = $(vimobj) \
	$(OBJDIR)\gui.obj \
	$(OBJDIR)\gui_w32.obj
!endif

!if ($(OS)==WIN32)
vimobj = $(vimobj) \
	$(OBJDIR)\os_win32.obj
!elif ($(OS)==DOS16)
vimobj = $(vimobj) \
	$(OBJDIR)\os_msdos.obj
!endif
# Blab what we are going to do:
MSG = Compiling $(OS) $(TARGET) $(OLETARGET), with:
!ifdef GUI
MSG = $(MSG) GUI
!endif
!ifdef USEDLL
MSG = $(MSG) USEDLL
!endif
!ifdef VIMDLL
MSG = $(MSG) VIMDLL
!endif
!ifdef DEBUG
MSG = $(MSG) DEBUG
!endif
!ifdef CODEGUARD
MSG = $(MSG) CODEGUARD
!endif
MSG = $(MSG) cpu=$(CPU)
MSG = $(MSG) Align=$(ALIGN)

!message $(MSG)

!if ($(OS)==DOS16)
TARGETS = $(TARGET)
!else
!ifdef VIMDLL
TARGETS = $(DLLTARGET)
!endif
TARGETS = $(TARGETS) $(TARGET)
!endif

# Targets:
vim: dirs $(OBJDIR)\bcc.cfg $(TARGETS)
	@del $(OBJDIR)\version.obj

dirs: 
    -@md $(OS)
    -@md $(OBJDIR)

all: vim vimrun.exe install.exe xxd ctags

###########################################################################
###### Note well: Before you attempt to make 'xxd' or 'ctags', you will
###### have to edit their respective makefile.w32 files to work with 
###### Borland C.  It isn't hard, but I can't do it for you!
###########################################################################
xxd:
	@cd xxd
	$(MAKE) -f makefile.w32
	@cd ..

ctags:
	@cd ctags
	$(MAKE) -f makefile.w32
	@cd ..

install.exe: dosinst.c
	$(BOR)\BIN\bcc32 -WC -einstall dosinst.c

clean:
	-@del /y $(OBJDIR)\*.*
	-@del /y *.res
	-@del /y *.dll
	-@del /y *vim*.exe
	-@del /y *.csm
	-@del /y *.map

$(DLLTARGET): $(OBJDIR) $(vimdllobj)
  $(LINK) @&&|
	$(LFLAGSDLL) +
	c0d32.obj +
	$(vimdllobj)
	$<,$*
!ifdef CODEGUARD
	cg32.lib+
!endif
!if ($(OLE)==1)
	ole2w32.lib +
!endif
!if ($(OS)==WIN32)
	import32.lib+
!ifdef PERL
	$(PERLLIB)\core\perl.lib+
!endif
!if ($(USEDLL)==1)
	cw32i.lib
!else
	cw32.lib
!endif
	vim.def
!else
	cl.lib
!endif
|

!ifdef VIMDLL
$(TARGET): $(OBJDIR) $(DLLTARGET) $(vimmain) $(RESFILE)
!else
$(TARGET): $(OBJDIR) $(vimobj) $(RESFILE)
!endif
  $(LINK) @&&|
	$(LFLAGS) +
	$(STARTUPOBJ) +
!ifdef VIMDLL
	$(vimmain)
!else
	$(vimobj)
!endif
	$<,$*
!if ($(OS)==WIN32)
!ifdef CODEGUARD
	cg32.lib+
!endif
!if ($(OLE)==1)
	ole2w32.lib +
!endif
	import32.lib+
!ifdef PERL
	$(PERLLIB)\core\perl.lib+
!endif
!if ($(USEDLL)==1)
	cw32i.lib
!else
	cw32.lib
!endif
!if ($(GUI)==1)

	$(RESFILE)
!endif
!else
	emu.lib + cl.lib
!endif
|

$(OBJDIR)\buffer.obj:  buffer.c

$(OBJDIR)\charset.obj:	charset.c

$(OBJDIR)\digraph.obj:	digraph.c

$(OBJDIR)\edit.obj:  edit.c

$(OBJDIR)\eval.obj:  eval.c

$(OBJDIR)\ex_cmds.obj:	ex_cmds.c ex_cmds.h

$(OBJDIR)\ex_docmd.obj:  ex_docmd.c ex_cmds.h

$(OBJDIR)\ex_getln.obj:  ex_getln.c

$(OBJDIR)\fileio.obj:  fileio.c

$(OBJDIR)\getchar.obj:	getchar.c

$(OBJDIR)\main.obj:  main.c

$(OBJDIR)\mark.obj:  mark.c

$(OBJDIR)\memfile.obj:	memfile.c

$(OBJDIR)\memline.obj:	memline.c

$(OBJDIR)\message.obj:	message.c

$(OBJDIR)\misc1.obj:  misc1.c

$(OBJDIR)\misc2.obj:  misc2.c

$(OBJDIR)\multbyte.obj:  multbyte.c

$(OBJDIR)\normal.obj:  normal.c

$(OBJDIR)\ops.obj:  ops.c

$(OBJDIR)\option.obj:  option.c

$(OBJDIR)\quickfix.obj:  quickfix.c

$(OBJDIR)\regexp.obj:  regexp.c

$(OBJDIR)\screen.obj:  screen.c

$(OBJDIR)\search.obj:  search.c

$(OBJDIR)\syntax.obj:  syntax.c

$(OBJDIR)\tag.obj:  tag.c

$(OBJDIR)\term.obj:  term.c

$(OBJDIR)\ui.obj:  ui.c

$(OBJDIR)\undo.obj:  undo.c

$(OBJDIR)\version.obj:	version.c

$(OBJDIR)\os_win32.obj:  os_win32.c

$(OBJDIR)\os_msdos.obj:  os_msdos.c

$(OBJDIR)\window.obj:  window.c

$(OBJDIR)\gui.obj: gui.c

$(OBJDIR)\gui_w32.obj: gui_w32.c

$(OBJDIR)\os_w32dll.obj: os_w32dll.c

$(OBJDIR)\if_ole.obj: if_ole.cpp
	copy if_ole.obj $(OBJDIR)

$(OBJDIR)\os_w32exe.obj: os_w32exe.c
	$(CC) $(CC1) -WE $(CC2)$@ os_w32exe.c

$(OBJDIR):
	-@if not exist $(OBJDIR)\nul mkdir $(OS)
	-@if not exist $(OBJDIR)\nul mkdir $(OBJDIR)

$(OBJDIR)\if_perl.obj: if_perl.c
	$(CC) $(CC1) $(CC2)$@ -pc if_perl.c


if_perl.c: if_perl.xs typemap
	$(PERL) $(PERLLIB)\ExtUtils\xsubpp -prototypes -typemap \
	    $(PERLLIB)\ExtUtils\typemap if_perl.xs > $@

vim.res: vim.rc version.h tools.bmp tearoff.bmp vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
    $(BRC) $(DEFINES) -i $(BOR)\include -32 -r $*.rc
    
# vimrun.exe:
vimrun.exe: vimrun.c 
!if $d(USEDLL)
	$(BOR)\BIN\BCC32 -WC -O1 -I$(INCLUDE) -D_RTLDLL vimrun.c cw32mti.lib
!else
	$(BOR)\BIN\BCC32 -WC -O1 -I$(INCLUDE) vimrun.c 
!endif


$(OBJDIR)\bcc.cfg: Makefile.bor
  copy &&|
	$(CFLAGS)
	$(DEFINES)
	$(EXETYPE)
	$(DEBUG)
	$(OPT)
	$(CODEGUARD)
	$(CPU)
	$(ALIGN)
| $@

# vi:set sts=4 sw=4:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -