#################################################################
# Infernal
# testsuite Makefile
# SVN $Id$
#################################################################
#    This is open source software, distributed under
#    the BSD license. See the LICENSE file for more
#    details.
#################################################################

SHELL  = /bin/sh

## your compiler and compiler flags;
#  and other configuration of the compilation and linking
#  environment.
#  DEFS contains stuff that autoconf set up.
#
CC       = gcc -std=gnu99
CFLAGS   = -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing
CPPFLAGS = 
LDFLAGS  = 
DEFS     = -DHAVE_CONFIG_H
LIBS     =  -lm
MYLIBS   = -linfernal -lhmmer -leasel
SIMDFLAGS = 

# configuration for optional MPI functionality
MPILIBS   = 

# Where the build arenas are
#
MYLIBDIR = -L../easel/ -L../src -L../hmmer/src
MYINCDIR = -I../easel/ -I../src -I../hmmer/src

TESTPROGS = \
	bandcyk-montecarlo-test\
	bandcyk-truncation-test\
	cp9-test\
	sub_cm-test

#################################################################
## Building the test programs.
##

.c.o: 
	${CC} ${SIMDFLAGS} ${CFLAGS} ${DEFS} ${MYINCDIR} -c $<

all:	${TESTPROGS}

${TESTPROGS}: %: %.o 
	${CC} ${CFLAGS} ${LDFLAGS} ${DEFS} ${MYLIBDIR} -o $@ $@.o $(MYLIBS) $(LIBS) $(MPILIBS)



#################################################################
## Miscellaneous targets.
##
clean:
	-rm -f *.o *~ Makefile.bak core ${TESTPROGS} TAGS gmon.out 

distclean:
	-rm -f *.o *~ Makefile.bak core ${TESTPROGS} TAGS gmon.out 
	-rm -f Makefile 

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

