# -*- Makefile -*-
# $Id: Makefile,v 1.25 1996/06/05 08:40:22 yumiko Exp $
#
# Makefile for an SQL client. These sources should be compiled for Sun WSs.
#
# Copyright (C) 1996 by Yokota-Laboratory, 
#	Japan Advanced Inst. of Sci. and Tech.,
#	1-1 Asahidai, Tatsunokuchi, Ishikawa 923-12, Japan.
#

SHELL		= /bin/sh
RM		= /bin/rm -f

KLIC		= klic
KLICFLAGS	= -v

##### DO NOT DELETE THE FOLLOWING RULES
.SUFFIXES:
.SUFFIXES: .kl1 .o

COMPILE.kl1	= $(KLIC) $(KLICFLAGS) -c
LINK.kl1	= $(KLIC) $(KLICFLAGS)

.kl1.o:
	$(COMPILE.kl1) $<
.kl1:
	$(LINK.kl1) -o $@ $<

#####
TARGET	= rdbserv

LNSRC	= rdbserv.kl1 algebra.kl1 access.kl1 exec.kl1 trans.kl1 lock.kl1 \
	deadlock.kl1 log.kl1 util.kl1 paraio.kl1 selection.kl1 access1.kl1 \
	processor.kl1 projection.kl1 fastio.kl1 \
	create.kl1 drop.kl1 insert.kl1 delete.kl1
BTSRC   = bt_get.kl1 bt_util.kl1 bt_add.kl1 bt_page.kl1 \
	bt_del.kl1 bt_del1.kl1 bt_del2.kl1 bt_del3.kl1
SRVSRC  = catalog.kl1 $(LNSRC) $(BTSRC)

SRVOBJ1	= rdbserv.o algebra.o access.o exec.o trans.o lock.o \
	deadlock.o log.o util.o catalog.o paraio.o selection.o access1.o \
	processor.o projection.o fastio.o \
	create.o drop.o insert.kl1 delete.o 
BTOBJ   = bt_get.o bt_util.o bt_add.o bt_page.o \
	bt_del.o bt_del1.o bt_del2.o bt_del3.o

SRVOBJ  = $(SRVOBJ1) $(BTOBJ)

.PHONY:	all sun install.sun ncube install.ncube all-clean clean

all: sun

sun: rdbserv

rdbserv: $(SRVOBJ)
	$(KLIC) $(KLICFLAGS) -o $(TARGET) $(SRVOBJ)

#
install.sun: $(TARGET)
	install -c -m 755 $(TARGET) ../bin

#
ncube:
install.ncube:

#
all-clean: clean
	$(RM) $(TARGET) $(LNSRC) $(BTSRC) core

clean:
	$(RM) $(SRVOBJ) $(BTOBJ) *.[cho] *.ext *.db

#
#
#
rdbserv.kl1:
	- ln -s ../../common/server/rdbserv.kl1 .
algebra.kl1:
	- ln -s ../../common/server/algebra.kl1 .
access.kl1:
	- ln -s ../../common/server/access.kl1 .
access1.kl1:
	- ln -s ../../common/server/access1.kl1 .
exec.kl1:
	- ln -s ../../common/server/exec.kl1 .
lock.kl1:
	- ln -s ../../common/server/lock.kl1 .
deadlock.kl1:
	- ln -s ../../common/server/deadlock.kl1 .
log.kl1:
	- ln -s ../../common/server/log.kl1 .
trans.kl1:
	- ln -s ../../common/server/trans.kl1 .
util.kl1:
	- ln -s ../../common/util/util.kl1 .
paraio.kl1:
	- ln -s ../socket/paraio.kl1 .
fastio.kl1:
	- ln -s ../../common/coding/fastio.kl1 .
selection.kl1:
	- ln -s ../../common/server/selection.kl1 .
projection.kl1:
	- ln -s ../../common/server/projection.kl1 .
processor.kl1:
	- ln -s ../../common/server/processor.kl1 .
create.kl1:
	- ln -s ../../common/server/create.kl1 .
insert.kl1:
	- ln -s ../../common/server/insert.kl1 .
delete.kl1:
	- ln -s ../../common/server/delete.kl1 .
drop.kl1:
	- ln -s ../../common/server/drop.kl1 .
bt_get.kl1:
	- ln -s ../../common/server/btree/bt_get.kl1 .
bt_util.kl1:
	- ln -s ../../common/server/btree/bt_util.kl1 .
bt_add.kl1:
	- ln -s ../../common/server/btree/bt_add.kl1 .
bt_del.kl1:
	- ln -s ../../common/server/btree/bt_del.kl1 .
bt_del1.kl1:
	- ln -s ../../common/server/btree/bt_del1.kl1 .
bt_del2.kl1:
	- ln -s ../../common/server/btree/bt_del2.kl1 .
bt_del3.kl1:
	- ln -s ../../common/server/btree/bt_del3.kl1 .
bt_page.kl1:
	- ln -s ../../common/server/btree/bt_page.kl1 .
