# Copyright (c) 1988,89 by George M. Sipe

# Makefile for:  dbf.lib - dBase II and III interface library

MODEL		=
DEFINES		= /DANSI /DMSC
CFLAGS		= /O /A$(MODEL) /G0 /W3 $(DEFINES)
PAGESIZE	= /PAGESIZE:16
DEST		= c:\msc\lib
INCLUDE		= c:\msc\include
SHELL		= c:\command.com
MAKEFILE	= makefile
LIBRARY		= dbf.lib
SRCS		= d_addrec.c d_blank.c d_close.c d_cpystr.c d_getfld.c \
		  d_getrec.c d_open.c d_putfld.c d_putrec.c
HDRS		= dbf.h
EXTHDRS		=
OBJS		= d_addrec.obj d_blank.obj d_close.obj d_cpystr.obj \
		  d_getfld.obj d_getrec.obj d_open.obj d_putfld.obj \
		  d_putrec.obj
VPATH		= .;..

# Compile and create each library.
all:		small # compact medium large

s$(LIBRARY) c$(LIBRARY) m$(LIBRARY) l$(LIBRARY) h$(LIBRARY):	$(OBJS)
		lib $(MODEL)$(LIBRARY) $(PAGESIZE) -+ $?;

# Compile and create the small model library.
small:		s
		(cd s; make -f ..\$(MAKEFILE) MODEL=S s$(LIBRARY))
		-@rm -f mk??????.bat

s:;		mkdir s

# Compile and create the compact model library.
compact:	c
		(cd c; make -f ..\$(MAKEFILE) MODEL=C c$(LIBRARY))
		-@rm -f mk??????.bat

c:;		mkdir c

# Compile and create the medium model library.
medium:		m
		(cd m; make -f ..\$(MAKEFILE) MODEL=M m$(LIBRARY))
		-@rm -f mk??????.bat

m:;		mkdir m

# Compile and create the large model library.
large:		l
		(cd l; make -f ..\$(MAKEFILE) MODEL=L l$(LIBRARY))
		-@rm -f mk??????.bat

l:;		mkdir l

# Compile and create the huge model library.
huge:		h
		(cd h; make -f ..\$(MAKEFILE) MODEL=H h$(LIBRARY))
		-@rm -f mk??????.bat

h:;		mkdir h

# Edit the makefile and regenerate the dependency information.
depend:
		mkmf -f $(MAKEFILE) LIBRARY=$(LIBRARY) DEST=$(DEST)

# Print source code files.
print:
		print $(HDRS) $(SRCS)

# Move the headers and libraries to the destination directories.
install:
		-cp $(HDRS) $(INCLUDE)
		-cp s\s$(LIBRARY) $(DEST)
		-cp c\c$(LIBRARY) $(DEST)
		-cp m\m$(LIBRARY) $(DEST)
		-cp l\l$(LIBRARY) $(DEST)
		-cp h\h$(LIBRARY) $(DEST)

# Remove the headers and libraries from the destination directories.
uninstall:
		(cd $(INCLUDE); rm -f $(HDRS))
		(cd $(DEST); rm -f s$(LIBRARY) c$(LIBRARY) m$(LIBRARY) \
			l$(LIBRARY) h$(LIBRARY))

# Remove all target and intermediate files.
clean:
		-rm -rf s c m l h mk??????.bat
		-rm -f made *.crf *.cod *.lst *.map *.obj *.ref

### Do NOT edit this or the following lines.
d_addrec.obj:	dbf.h
d_blank.obj:	dbf.h
d_close.obj:	dbf.h
d_cpystr.obj:	dbf.h
d_getfld.obj:	dbf.h
d_getrec.obj:	dbf.h
d_open.obj:	dbf.h
d_putfld.obj:	dbf.h
d_putrec.obj:	dbf.h
