# Generated automatically from Makefile.in by configure.
################################################################# 
# Makefile for HMMER: Main project directory: installation, documentation
# CVS $Id: Makefile.in,v 1.35 2001/08/05 23:44:42 eddy Exp $
###########
# HMMER - Biological sequence analysis with profile HMMs
# Copyright (C) 1992-1999 Washington University School of Medicine
# All Rights Reserved
# 
#     This source code is distributed under the terms of the
#     GNU General Public License. See the files COPYING and LICENSE
#     for details.
###########

# On most Unices, you can build the package without modifying anything 
#   by just typing "./configure; make".
#
# You may want to modify the following make variables:
#   BINDIR  - where the executables will be installed by a 'make install'
#   MANDIR  - where the man pages will be installed by a 'make install'
#   CC      - which compiler to use
#   CFLAGS  - compiler flags to use

# where you want things installed
# Sort of uses GNU coding standards. ${prefix} might be /usr/local.
# ${exec_prefix} gives you some flexibility for installing architecture
# dependent files (e.g. the programs): an example ${exec_prefix} might be
# /nfs/share/irix64/
#
prefix      = /usr/local
exec_prefix = ${prefix}
BINDIR      = ${exec_prefix}/bin
MANDIR      = ${prefix}/man

# how to install the man pages; 
# cp is generally fine, unless you preformat your pages.
#
INSTMAN   = cp
MANSUFFIX = 1

# your compiler and compiler flags
#
CC     = cc
CFLAGS = -g -O2

#######
## You should not need to modify below this line.
## Much of it is concerned with maintenance of the development version
## and building the release (indeed, several commands will only work in 
## St. Louis)
#######
SHELL       = /bin/sh
BASENAME    = "hmmer"
PACKAGE     = "HMMER"
RELEASE     = "2.2g"
RELCODE     = "hmmer2_2g"
RELEASEDATE = "August 2001"
COPYRIGHT   = "Copyright \(C\) 1992-2001 HHMI/Washington University School of Medicine"
LICENSE     = "Freely distributed under the GNU General Public License \(GPL\)"
LICENSETAG  = gnu
COMPRESS    = gzip

# The program lists below for HMMER and SQUID are not necessarily
# a complete manifest. They are the list of stable programs that the
# package will install. There must be a man page for each one of them
# in the appropriate places (documentation/man for HMMER, squid/Man
# for the SQUID library). 
#
PROGS = hmmalign\
	hmmbuild\
	hmmcalibrate\
	hmmconvert\
	hmmemit\
	hmmfetch\
	hmmindex\
	hmmpfam\
	hmmsearch

PVMPROGS = 

SQUIDPROGS = afetch\
	alistat\
	seqstat\
	sfetch\
	sindex\
	shuffle\
	sreformat

# all: Compile everything (except the testsuite),
#      and stick the supported programs in binaries/
#
all: version.h
	@if test -d binaries; then\
	   echo "You appear to already have a compiled HMMER distribution.";\
	   echo "You don't need to make.";\
	   echo "";\
	   echo "If I'm wrong, it's because I'm only looking to see if you have";\
	   echo "a 'binaries' directory; do 'make distclean' to revert HMMER";\
	   echo "to a pristine source distribution.";\
	else\
	   (cd squid; make CC="$(CC)" CFLAGS="$(CFLAGS)"; make module);\
	   (cd src;   make CC="$(CC)" CFLAGS="$(CFLAGS)"; make module);\
	   mkdir binaries;\
	      for prog in $(PROGS) $(PVMPROGS); do\
	      mv src/$$prog binaries/;\
	   done;\
	   for prog in $(SQUIDPROGS); do\
	      mv squid/$$prog binaries/;\
	   done;\
	fi

# version.h: 
#   create the version.h file that will define stamps used by 
#   squidcore.c's Banner(), which is called by all executables to
#   print a standard package/copyright/license banner;
#   then puts copies of version.h in all directories that are 
#   going to need it -- HMMER src/ and any modules of mine that
#   also produce installed executables (squid/)
#
version.h:
	echo "/* version.h -- automatically generated by a Makefile. DO NOT EDIT. */" > version.h
	echo "#define PACKAGE     \"$(PACKAGE)\""     >> version.h
	echo "#define RELEASE     \"$(RELEASE)\""     >> version.h
	echo "#define RELEASEDATE \"$(RELEASEDATE)\"" >> version.h
	echo "#define COPYRIGHT   \"$(COPYRIGHT)\""   >> version.h
	echo "#define LICENSE     \"$(LICENSE)\""     >> version.h
	cp version.h squid/
	cp version.h src/

# check: compiles and runs test suite in testsuite/
#       These are public tests, distributed with the package.
#
check:	squid/libsquid.a src/libhmmer.a
	(cd testsuite; make CC="$(CC)" CFLAGS="$(CFLAGS)")
	(cd testsuite; make check)

squid/libsquid.a: version.h
	(cd squid; make CC="$(CC)" CFLAGS="$(CFLAGS)"; make module)

src/libhmmer.a: version.h
	(cd src;   make CC="$(CC)" CFLAGS="$(CFLAGS)"; make module)


# install: installs the binaries in BINDIR/
#          installs man pages in MANDIR/man1/  (e.g. if MANSUFFIX is 1)
install: 
	for file in $(PROGS) $(SQUIDPROGS) $(PVMPROGS); do\
	   cp binaries/$$file $(BINDIR)/;\
	done
	for file in hmmer $(PROGS) $(SQUIDPROGS); do\
	   $(INSTMAN) documentation/man/$$file.man $(MANDIR)/man$(MANSUFFIX)/$$file.$(MANSUFFIX);\
	done
	for file in $(SQUIDPROGS); do\
	   $(INSTMAN) squid/Man/$$file.man $(MANDIR)/man$(MANSUFFIX)/$$file.$(MANSUFFIX);\
	done

# "make clean" removes almost everything except configuration files
#              and binaries.
clean:
	-rm -f *.o *~ Makefile.bak core TAGS gmon.out
	(cd src;       make clean)
	(cd squid;     make clean)
	(cd testsuite; make clean)

# "make distclean" leaves a pristine source distribution.
#
distclean:
	-rm -rf binaries
	-rm config.cache config.log config.status
	-rm version.h
	make clean
	(cd src;       make distclean)
	(cd squid;     make distclean)
	(cd testsuite; make distclean)
	-rm Makefile

# verify: consistency checks on the package
#         These are private tests, not distributed with HMMER
verify:
	@echo Checking options for consistency and documentation...
	@for prog in $(PROGS) $(SQUIDPROGS); do\
	   ./checkoptions.pl $$prog;\
	done

# doc:  build the Userguide and on-line manual
#
doc:
	(cd Userguide; make)

# dist: build a new distribution directory in hmmer-$RELEASE
#       Exports from the CVS repository.
#       tags RCS files with $(RELCODE) for later reconstruction
#       squid RCS files are tagged with hmmer$(RELCODE).
#       Adds a license statement to each file that has a @ LICENSE @ line.
#       Virtually identical to squid's make dist -- keep them in sync!
dist:	
	# Delete old versions of the same release
	#
	@if test -d ${BASENAME}-$(RELEASE);        then rm -rf ${BASENAME}-$(RELEASE);        fi
	@if test -e ${BASENAME}-$(RELEASE).tar;    then rm -f  ${BASENAME}-$(RELEASE).tar;    fi
	@if test -e ${BASENAME}-$(RELEASE).tar.Z;  then rm -f  ${BASENAME}-$(RELEASE).tar.Z;  fi
	@if test -e ${BASENAME}-$(RELEASE).tar.gz; then rm -f  ${BASENAME}-$(RELEASE).tar.gz; fi
	# 
	# CVS tag and extract. -c: make sure we committed;
	#                      -F: allow more than one "make dist" per rel
	# prep: must have done "cvs commit", and CVSROOT must be set
	# We also need the squid library, so tag and export it too.
	#
	cvs tag -F $(RELCODE)
	cvs export -r $(RELCODE) -d ${BASENAME}-${RELEASE} ${BASENAME}
	cvs rtag -F ${RELCODE} squid
	(cd ${BASENAME}-${RELEASE}; cvs export -r ${RELCODE} -d squid squid)
	# 
	# Make the configure scripts from configure.in
	#
	(cd ${BASENAME}-${RELEASE};       autoconf)
	(cd ${BASENAME}-${RELEASE}/squid; autoconf)
	# 
	# Include the appropriate license files and release notes
	#
	cp  Licenses/LICENSE.$(LICENSETAG)   ${BASENAME}-$(RELEASE)/LICENSE
	cp  Licenses/COPYING.$(LICENSETAG)   ${BASENAME}-$(RELEASE)/COPYRIGHT
	-cp Release-Notes/RELEASE-$(RELEASE) ${BASENAME}-$(RELEASE)/NOTES
	#
	# Attach license stamps on files that need 'em (replace LICENSE keyword)
	# licenseadd.pl is basically harmless, so we can overannotate here by
	# trying to licenseadd everything.
	#
	find ${BASENAME}-${RELEASE} -type f -exec licenseadd.pl Licenses/$(LICENSETAG) {} \;
	# 
	# Compilation of the documentation.
	# Documentation is not provided in source form.
	#
	(cd documentation/userguide; make clean)
	(cd documentation/userguide; make pdf)
	cp -f documentation/userguide/Userguide.pdf build/hmmer-$(RELEASE)/
	#
	# Remove CVS-controlled files/directories that don't belong in 
	# the distro
	#
	-rm -rf ${BASENAME}-${RELEASE}/Bugs
	-rm -rf ${BASENAME}-${RELEASE}/CHECKLIST
	-rm -rf ${BASENAME}-${RELEASE}/Internal-Notes
	-rm -rf ${BASENAME}-${RELEASE}/Licenses
	-rm -rf ${BASENAME}-${RELEASE}/MAILING_LIST
	-rm -rf ${BASENAME}-${RELEASE}/Release-Notes
	-rm -rf ${BASENAME}-${RELEASE}/configure.in
	-rm -rf ${BASENAME}-${RELEASE}/checkoptions.pl
	-rm -rf ${BASENAME}-${RELEASE}/licenseadd.pl
	-rm -rf ${BASENAME}-${RELEASE}/nodebuild
	-rm -rf ${BASENAME}-${RELEASE}/rootbuild
	-rm -rf ${BASENAME}-${RELEASE}/buildall
	-rm -rf ${BASENAME}-${RELEASE}/documentation/userguide
	-rm -rf ${BASENAME}-${RELEASE}/squid/Licenses
	-rm -rf ${BASENAME}-${RELEASE}/squid/LOG
	-rm -rf ${BASENAME}-${RELEASE}/squid/configure.in
	#
	# Packaging commands
	#
	tar cvf ${BASENAME}-${RELEASE}.tar ${BASENAME}-${RELEASE}
	$(COMPRESS) ${BASENAME}-$(RELEASE).tar


# make ftpdist: install FTP distribution. Assumes a "make dist"
#               has already succeeded. Doesn't do the symlink;
#               doesn't install the on-line manual for the Web site.
#
ftpdist:
	cp -f $(READMES)                     $(FTPDIR)
	cp -f build/hmmer-$(RELEASE)/COPYING $(FTPDIR)
	cp -f build/hmmer-$(RELEASE)/LICENSETAG $(FTPDIR)
	cp -f build/hmmer-$(RELEASE)/NOTES   $(FTPDIR)
	cp -f build/hmmer-$(RELEASE).tar.Z   $(FTPDIR)
	cp -f build/hmmer-$(RELEASE)-*.tar.Z $(FTPDIR)
	cp -f Userguide/Userguide.ps         $(FTPDIR)
	cp -f Userguide/Userguide.pdf        $(FTPDIR)
	cp -f Userguide/hmmer-html.tar.Z     $(FTPDIR)


# make stable: Set up the FTP site symlink to the current stable HMMER release.
#
stable:
	ln -sf $(FTPDIR)/hmmer-$(RELEASE).tar.Z $(FTPDIR)/hmmer.tar.Z


