# include	"../conf/conf.h"

SHELL=	/bin/sh
DBS=	../..
LIB=	../lib
ACCESS=	$(LIB)/a.a

CC=	cc
i_FLAG=
O_FLAG=	-O
# ifndef FP_PROCESSOR
f_FLAG=	-f
# else
f_FLAG=
# endif

# ifdef A7150
# endif

# ifdef BC
# endif

# ifdef EC1834
# endif

# ifdef ESER_PSU
# ifdef TRACE
i_FLAG=	-d
# endif
# endif

# ifdef ESER_VMX
# endif

# ifdef HP_UX
# endif

# ifdef P8000
# endif

# ifdef PDP
# endif

# ifdef PDP70
# endif

# ifdef VAX
# endif

# ifdef VENIX
# endif

# ifdef XENIX286
i_FLAG=	-i -M2s
# endif

# ifdef XENIX386
# endif

CFLAGS=	$(O_FLAG) $(f_FLAG) $(i_FLAG)

AR=	-ar
# ifdef TEST
AR_R	=rv
AR_X	=xv
# else
AR_R	=r
AR_X	=x
# endif
LIBMODE=0644

# ifdef RANLIB
MKLIB=	ranlib
# else
MKLIB=	@echo ranlib
# endif
CHMOD=	chmod
RM=	-rm -f
TOUCH=	touch

OBJS=	opencat.o	closecat.o	cat_desc.o	inpcloser.o	\
	closer.o	noclose.o	openr.o		accbuf.o	\
	acc_addbuf.o	batch.o		batchxtra.o	writebatch.o	\
	getequal.o	get.o		insert.o	replace.o	\
	delete.o	setkey.o	find.o		rhash.o		\
	ndxsearch.o	findbest.o	scan_dups.o	get_tuple.o	\
	put_tuple.o	del_tuple.o	tup_len.o	newlino.o	\
	add_ovflo.o	formatpg.o	last_page.o	page.o		\
	compare.o	add_prim.o	utility.o	cleanrel.o	\
	readadmin.o	relpath.o

INSTALL:	install

install:	$(ACCESS)

$(ACCESS):	$(OBJS)
	$(AR) $(AR_R) $@ $?
	@-$(CHMOD) $(LIBMODE) $@
	$(MKLIB) $@

UNLOAD:		unload

unload:
	@-$(AR) $(AR_X) $(ACCESS)
	@$(RM) __.SYMDEF
	@-$(TOUCH) $(ACCESS)

ALLCLEAN:	allclean

allclean:	clean
	$(RM) $(ACCESS)

CLEAN:		clean

clean:
	$(RM) $(OBJS)

accbuf.o:	../h/trace.h

batch.o:	../h/trace.h

closer.o:	../h/trace.h

delete.o:	../h/trace.h

find.o:		../h/trace.h

findbest.o:	../h/trace.h

get.o:		../h/trace.h

getequal.o:	../h/trace.h

inpcloser.o:	../h/trace.h

insert.o:	../h/trace.h

last_page.o:	../h/trace.h

noclose.o:	../h/trace.h

openr.o:	../h/trace.h

page.o:		../h/trace.h

put_tuple.o:	../h/trace.h

replace.o:	../h/trace.h

rhash.o:	../h/trace.h

setkey.o:	../h/trace.h

tup_len.o:	../h/trace.h

writebatch.o:	../h/trace.h

# ifdef WENZLAFF
HOME=	/z/dbs/src/access
SRC=	acc_addbuf.c	accbuf.c	add_ovflo.c	add_prim.c	\
	batch.c		batchxtra.c	cat_desc.c	cleanrel.c	\
	closecat.c	closer.c	compare.c	del_tuple.c	\
	delete.c	find.c		findbest.c	formatpg.c	\
	gen.h		get.c		get_tuple.c	getequal.c	\
	inpcloser.c	insert.c	last_page.c	ndxsearch.c	\
	newlino.c	noclose.c	opencat.c	openr.c		\
	page.c		put_tuple.c	readadmin.c	relpath.c	\
	replace.c	rhash.c		scan_dups.c	setkey.c	\
	tup_len.c	utility.c	writebatch.c	Makefile

.save:		$(SRC)
	mount DISK /wrk
	CP $? $@ /wrk/access
	> $@
	umount DISK

$(HOME)/.save:	$(SRC)
	CP $? $(HOME)
	> $@

.PRECIOUS:	.save
.PRECIOUS:	$(HOME)/.save
# endif
