#
# Makefile for Borland C++ 2.0, 3.1 or 4.0
# Can also be used for Turbo C++
#
# The options are at the end of this file
#

.AUTODEPEND

#		*Translator Definitions*
#   use tcc for Turbo C++
CC = bcc +VIM.CFG
#CC = tcc +VIM.CFG
TASM = TASM
TLIB = tlib
TLINK = tlink
#
# Adjust the paths for your environment
# use the first two if you don't have the spawno library
#	then also remove the SPAWNO define further down and the line
#	with spawnl.lib
#
#LIBPATH = C:\BC4\LIB
#INCLUDEPATH = C:\BC4\INCLUDE
LIBPATH = E:\BC4\LIB;C:\CC\SPAWN
INCLUDEPATH = E:\BC4\INCLUDE;C:\CC\SPAWN
 
 
#		*Implicit Rules*
#
# use -v for debugging
#
.c.obj:
  $(CC) -c {$< }
#  $(CC) -c -v {$< }
 
#		*List Macros*
 
 
EXE_dependencies =  \
 alloc.obj \
 buffer.obj \
 charset.obj \
 cmdcmds.obj \
 cmdline.obj \
 csearch.obj \
 digraph.obj \
 edit.obj \
 fileio.obj \
 getchar.obj \
 help.obj \
 linefunc.obj \
 main.obj \
 mark.obj \
 memfile.obj \
 memline.obj \
 message.obj \
 misccmds.obj \
 msdos.obj \
 normal.obj \
 ops.obj \
 option.obj \
 quickfix.obj \
 regexp.obj \
 regsub.obj \
 screen.obj \
 search.obj \
 tables.obj \
 tag.obj \
 term.obj \
 undo.obj \
 window.obj \
 version.obj
 
all: vim.exe ctags/ctags.exe xxd/xxd.exe

#		*Explicit Rules*
#  add /v to TLINK for debugging
vim.exe: vim.cfg $(EXE_dependencies)
  $(CC) -c version.c
  $(TLINK) /x/c/L$(LIBPATH) @&&|
c0l.obj+
alloc.obj+
buffer.obj+
charset.obj+
cmdcmds.obj+
cmdline.obj+
csearch.obj+
digraph.obj+
edit.obj+
fileio.obj+
getchar.obj+
help.obj+
linefunc.obj+
main.obj+
mark.obj+
memfile.obj+
memline.obj+
message.obj+
misccmds.obj+
msdos.obj+
normal.obj+
ops.obj+
option.obj+
quickfix.obj+
regexp.obj+
regsub.obj+
screen.obj+
search.obj+
tables.obj+
tag.obj+
term.obj+
undo.obj+
window.obj+
version.obj
vim
		# no map file
fp87.lib+
mathl.lib+
spawnl.lib+
cl.lib
|
 
ctags/ctags.exe: ctags/ctags.c
	cd ctags
	copy makefile.bcc makefile
	$(MAKE)
	cd ..

xxd/xxd.exe: xxd/xxd.c
	cd xxd
	copy makefile.bcc makefile
	$(MAKE)
	cd ..


# cleaning up
clean:
	-del *.obj
	-del *.exe
	-del cmdtab.h
	-del ctags\ctags.obj
	-del ctags\ctags.exe
	-del xxd\xxd.obj
	-del xxd\xxd.exe

#		*Individual File Dependencies*
alloc.obj: alloc.c 
 
buffer.obj: buffer.c 
 
charset.obj: charset.c 
 
cmdcmds.obj: cmdcmds.c
 
cmdline.obj: cmdline.c cmdtab.h
 
cmdtab.h: cmdtab.tab mkcmdtab.exe
	mkcmdtab cmdtab.tab cmdtab.h

mkcmdtab.exe: mkcmdtab.c
	$(CC) $(CFLAGS) -ml -omkcmdtab mkcmdtab.c
	-del mkcmdtab.obj

csearch.obj: csearch.c 
 
digraph.obj: digraph.c 
 
edit.obj: edit.c 
 
fileio.obj: fileio.c 

getchar.obj: getchar.c 

help.obj: help.c 
 
linefunc.obj: linefunc.c 
 
main.obj: main.c globals.h option.h
 
mark.obj: mark.c
 
memfile.obj: memfile.c 

memline.obj: memline.c 

message.obj: message.c 
 
misccmds.obj: misccmds.c 
 
msdos.obj: msdos.c 
 
normal.obj: normal.c ops.h
 
ops.obj: ops.c ops.h
 
option.obj: option.c 
 
quickfix.obj: quickfix.c 
 
regexp.obj: regexp.c 
 
regsub.obj: regsub.c 
 
screen.obj: screen.c 
 
search.obj: search.c 
 
tables.obj: tables.c

tag.obj: tag.c
 
term.obj: term.c term.h
 
undo.obj: undo.c 

window.obj: window.c 
 
version.obj: version.c 
 
#		*Compiler Configuration File*
# The following compile options can be changed for better machines.
#	replace -1- with -2 to produce code for a 80286 or higher
#	replace -1- with -3 to produce code for a 80386 or higher
#	add -v for source debugging
vim.cfg: makefile
  copy &&|
-ml
-1-
-f-
-C
-N
-O
-Z
-k-
-d
-h
-vi-
-H=VIM.SYM
-w-par
-weas
-wpre
-I$(INCLUDEPATH)
-L$(LIBPATH)
-DPC;MSDOS;SPAWNO
| vim.cfg

### See makefile.txt for a list of defines that can be included
