################################################################
# Makefile for HMMER testsuite
# CVS $Id: Makefile.in,v 1.18 2003/06/13 20:05:31 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.
###########

CC        = gcc
CFLAGS    = -g -O2 -Werror=implicit-function-declaration -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -ffile-prefix-map=.=. -flto=auto -ffat-lto-objects -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -fdebug-prefix-map=.=/usr/src/hmmer2-2.3.2+dfsg-12build1
CPPFLAGS  = -Wdate-time -D_FORTIFY_SOURCE=3
LDFLAGS   = -Wl,-Bsymbolic-functions -Wl,--package-metadata={%22type%22:%22deb%22%2C%22os%22:%22ubuntu%22%2C%22name%22:%22hmmer2%22%2C%22version%22:%222.3.2+dfsg-12build1%22%2C%22architecture%22:%22arm64%22} -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now
DEFS      = -DHAVE_CONFIG_H
LIBS      =  -lm
PKG_CONFIG = /usr/bin/pkg-config
MYLIBS    = -lhmmer `$(PKG_CONFIG) --libs libsquid`

# Configuration for optional pthreads multiprocessor support
#
PTHREAD_LIBS   = 
PTHREAD_CFLAGS = -D_XOPEN_SOURCE=500

SHELL     = /bin/sh

SHIVA = alignalign_test\
	evd_test\
	masks_test\
	parsingviterbi_test\
	tophits_test\
	trace_test\
	viterbi_exercise\
	weeviterbi_test

#######
## Targets defining how to make Shiva executables.
#######

.c.o:
	$(CC) $(CFLAGS) $(PTHREAD_CFLAGS) ${CPPFLAGS} $(DEFS) `$(PKG_CONFIG) --cflags libsquid` -I../src -c $<		

all: 	$(SHIVA)

$(SHIVA): %: %.o
	$(CC) $(CFLAGS) $(PTHREAD_CFLAGS) ${LDFLAGS} $(DEFS) -o $@ -L../src $@.o $(MYLIBS) $(PTHREAD_LIBS) $(LIBS)

#######
## `make check` actually runs the tests.
#######

check: 
	@echo 
	@echo Running test suite exercises.
	@echo Warning: some tests may take several minutes to complete. 
	@echo 
	./sqc 2 exercises.sqc . ../src


#######
## Miscellaneous
#######

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

distclean:
	make clean
	-rm -f Makefile

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

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


