############################################################
# Makefile for HMMER src directory
# CVS $Id: Makefile.in,v 1.18 2003/05/26 19:33:09 eddy Exp $
###########
# HMMER - Biological sequence analysis with profile HMMs
# Copyright (C) 1992-2003 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.
###########

## your compiler and compiler flags
#
CC     = gcc
CFLAGS = -O2 -static
LIBS   =  -lm
DEFS   = -DHAVE_CONFIG_H

## archiving command, and ranlib command if you need one.
#  In general, you shouldn't need to change these, and they're
#  only used for building the testsuite anyway... e.g. we
#  make a "libhmmer.a" library for building the testsuite.
#
AR     = /usr/bin/ar rcv 
RANLIB = ranlib

# Configuration for optional pthreads multiprocessor support
#
PTHREAD_LIBS   = 
PTHREAD_CFLAGS = -pthread


# Configuration for optional PVM functionality
#
PVMLIBDIR = 
PVMINCDIR = 
PVMLIBS   = 
PVMPROGS  = 

SHELL    = /bin/sh
MYLIBS   = -lsquid
MYLIBDIR = -L../squid
MYINCDIR = -I../squid

PROGS = hmmalign\
	hmmbuild\
	hmmcalibrate\
	hmmconvert\
	hmmemit\
	hmmfetch\
	hmmindex\
	hmmpfam\
	hmmsearch\
	${PVMPROGS}

OBJS =  alphabet.o\
	core_algorithms.o\
	debug.o\
	display.o\
	emit.o\
	emulation.o\
	fast_algorithms.o\
	histogram.o\
	hmmio.o\
	mathsupport.o\
        masks.o\
	misc.o\
	modelmakers.o\
	plan7.o\
	plan9.o\
	postprob.o\
	prior.o\
	pvm.o\
	threads.o\
	tophits.o\
	trace.o 

HDRS =  config.h\
	funcs.h\
	globals.h\
	postprob.h\
	structs.h

.c.o:
	$(CC) $(CFLAGS) $(DEFS) $(PTHREAD_CFLAGS) $(MYINCDIR) $(PVMINCDIR) -c $<

#################################################################
## Targets defining how to make HMMER executables.
##
all: 	$(PROGS) 

$(PROGS): %: %.o $(OBJS) 
	$(CC) $(CFLAGS) $(PTHREAD_CFLAGS) $(DEFS) $(MYLIBDIR) $(PVMLIBDIR) -o $@ $@.o $(OBJS) $(PVMLIBS) $(MYLIBS) $(PTHREAD_LIBS) $(LIBS)


#################################################################
## Targets used in making HMMER module for testsuite compilation.
##
module: libhmmer.a

libhmmer.a: $(OBJS) 
	$(AR) libhmmer.a $(OBJS) 
	$(RANLIB) libhmmer.a
	chmod 644 libhmmer.a


#################################################################
## Miscellaneous targets.
##
distclean:
	make clean
	-rm -f Makefile 

clean:
	-rm -f *.o *~ Makefile.bak core $(PROGS) TAGS gmon.out libhmmer.a

binclean:
	-rm -f *.o *~ Makefile.bak core TAGS gmon.out libhmmer.a

TAGS:
	etags -t *.c *.h Makefile.in

