#######################################################################
##
## HyperBase was designed and implemented by:
##
##	Uffe Kock Wiil 		(kock@iesd.auc.dk)
##	Claus Bo Nielsen 	(cbn@cci.dk)
##	Carsten Ruseng Jakobsen (ruseng@sun.com)
##	Finn Soelvsten
##	Per Magnus Petersen
##	Poul Larsen
##	Hans Mejdahl Jeppesen
##
## at The University of Aalborg in Denmark autumn 1989, and is provided
## for unrestricted use provided that this legend is included on all
## tape media and as a part of the software program in whole or part.
## Users may copy or modify HyperBase without charge, but are not
## authorized to license or distribute it to anyone else except as part
## of a product or program developed by the user.
##  
## HyperBase IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING
## THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A
## PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR
## TRADE PRACTICE.
## 
## HyperBase is provided with no support and without any obligation on
## the part of the authors, to assist in its use, correction,
## modification or enhancement.
##
## THE AUTHORS SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT
## OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY HyperBase OR ANY PART
## THEREOF.
##
## In no event will the authors and/or The University of Aalborg be
## liable for any lost revenue or profits or other special, indirect and
## consequential damages, even if the authors and/or The University of
## Aalborg has been advised of the possibility of such damages.
##
## Please address all correspondence to:
##
## Uffe Kock Wiil
## Department of Computer Science,
## The University of Aalborg,      Email:  kock@iesd.auc.dk
## Fredrik Bajers Vej 7E,          Phone:  + 45 98 15 42 11 (Ext 5051)
## DK-9220 Aalborg, Denmark.       Fax:    + 45 98 15 81 29
##
#######################################################################

#make ready for C++

.SUFFIXES: .o .cc .hh

.cc.o:
	$(CC) $(CFLAGS) -c ${<} 


# the flags:

CFLAGS= -g -O -I/home/local/sys/gnu/lib/g++-include
#CFLAGS= -g -O 
#-DSUN3
#-O -finline-functions
LDFLAGS=/home/local/sys/gnu/lib/libg++.a

#CC=g++ 
CC=/home/local/sys/gnu/bin/1.36/g++


# where are the files

BLOCK1=./block1/
BLOCK2=./block2/
BLOCK3=./block3/
BLOCK4A=./block4/4a/
BLOCK4B=./block4/4b/
CONFIG=./config/
DIRS=$(BLOCK1) $(BLOCK2) $(BLOCK3) $(BLOCK4A)


# and the object files

BLOCK1OBJ=$(BLOCK1)file.o $(BLOCK1)slist.o $(BLOCK1)Filehandler.o

BLOCK2OBJ=$(BLOCK2)Operations.o 

BLOCK3OBJ=$(BLOCK3)baltree.o $(BLOCK3)Event.o $(BLOCK3)Lock.o \
          $(BLOCK3)MainEventLock.o 

BLOCK4AOBJ=$(BLOCK4A)block3.o $(BLOCK4A)block4a.o $(BLOCK4A)block4a_main.o \
	  $(BLOCK4A)main.o 
BLOCK4BOBJ=$(BLOCK4B)block4b.o $(BLOCK4B)my_gethost.o
CONFIGOBJ=$(CONFIG)hb_config.o $(CONFIG)error.o

MAINOBJ=$(BLOCK4A)main.o

SERVEROBJ=$(BLOCK1OBJ) $(BLOCK2OBJ) $(BLOCK3OBJ) $(BLOCK4AOBJ)

#CLIENTOBJ=$(BLOCK4BOBJ) $(BLOCK5OBJ) $(CONFIGOBJ)
CLIENTOBJ=$(BLOCK4BOBJ) $(CONFIGOBJ)


# Make the hbserver

all	:	server client
server:  $(BLOCK1) $(BLOCK2) $(BLOCK3) $(BLOCK4A)  hbserver
client:  $(BLOCK4B) $(CONFIG) hblib

$(BLOCK1): FRC
	cd $@; make CC="$(CC)" CFLAGS="$(CFLAGS)"
$(BLOCK2): FRC
	cd $@; make CC="$(CC)" CFLAGS="$(CFLAGS)"
$(BLOCK3): FRC
	cd $@; make CC="$(CC)" CFLAGS="$(CFLAGS)"
$(BLOCK4A): FRC
	cd $@; make CC="$(CC)" CFLAGS="$(CFLAGS)"
$(BLOCK4B): FRC
	cd $@; make CC="$(CC)" CFLAGS="$(CFLAGS)"
$(CONFIG): FRC
	cd $@; make client CC="$(CC)" CFLAGS="$(CFLAGS)"
hbserver:	$(SERVEROBJ)
		$(CC) $(CFLAGS) -o hbserver  $(SERVEROBJ) $(LDFLAGS)
hblib:		$(CLIENTOBJ)
		ar rcv  hblib.a $(CLIENTOBJ);ranlib hblib.a
FRC:

clean:
	rm -f $(BLOCK1)*.o $(BLOCK2)*.o $(BLOCK3)*.o $(BLOCK4A)*.o \
	$(BLOCK4B)*.o $(CONFIG)*.o

