# ./src/hbond/Makefile
#
# copyright 1988-1990 (C) John Overington + Perfect Cock Software
#
# ==============================================================================
#
# to install hbond; first install strlib then edit BINDIR, MANDIR, JOYLIB and
# JOYLIBDIR below. and then type:
#       make install
#
BINDIR=/usr/local/bin
MANDIR=/usr/local/man/man1
# use the second line if your compiler has EXIT(), DATE(), and TIME():
JOYLIB=sysrout.o /usr/local/lib/libjoy.a
# JOYLIB=/usr/local/lib/libjoy.a
JOYLIB=-ljoy
JOYLIBDIR=-L../joylib
#
# ==============================================================================
#
SHELL=/bin/sh
F77=f77
F77FLAGS=-g
TROFF=groff
PIC=gpic
TBL=gtbl
EQN=geqn
#
FILES=	donacc.f addmh.f chainbreak.f hbond.f help.f\
	rdpdb.f fit.f hbeng.f version.f rmsd.f cadist.f throne.f pka.f prhb.f\
	hbond.1 Makefile hbond.h README
OBJECTS=donacc.o addmh.o chainbreak.o hbond.o help.o\
	rdpdb.o fit.o hbeng.o version.o rmsd.o cadist.o throne.o pka.o prhb.o

hbond:	date sysrout.o $(OBJECTS)
	$(F77) -o hbond $(OBJECTS) $(JOYLIBDIR) $(JOYLIB)

sysrout.o: sysrout.f
	$(F77) -c $(FFLAGS) -o sysrout.o sysrout.f

date:
	@-rm -f date.h
	@echo "      data DATE /'"`date`"'/" > date.h

# The dependancies

addmh.o cadist.o chainbreak.o donacc.o hbond.o rdpdb.o throne.o:	hbond.h
hbond.o:	date.h

# other things

tarfile:
	tar cf hbond.tar $(FILES) > /dev/null
	compress -f hbond.tar

tar:
	tar cv $(FILES)

strip:
	strip hbond

manual:
	$(TBL) hbond.1 | $(TROFF) -man > hbond.ps

install:	hbond strip
	cp hbond $(BINDIR)/hbond

installman:
	cp hbond.1 $(MANDIR)/hbond.1
 
clean:
	-rm -f *.o *.stb *~ *.tar.Z *.tar *.log

cleanest:
	-rm -f *.o *.stb *~ hbond *.tar.Z *.tar *.log
