#*********************************************************************
#    Makefile (version 0.3)                                          
#                                                                    
#    A simple Makefile to make the LAkernel package and its programs.
#
#    Reference:
#    H. Saigo, J.-P. Vert, T. Akutsu and N. Ueda, "Protein homology 
#    detection using string alignment kernels", Bioinformatics, 
#    vol.20, p.1682-1689, 2004.
#                                                                    
#                                                                    
#    Copyright 2003 Jean-Philippe Vert                                 
#    Copyright 2005 Jean-Philippe Vert, Hiroto Saigo
#
#    This file is part of LAkernel.
#
#    LAkernel is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    Foobar is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with Foobar; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# *********************************************************************/

#
# The settings to use for the gcc compiler.  If you don't have gcc,
# just set the CC value to your compiler and make sure optimization
# is turned on (it significantly affects the running time).

#CC=cc        #for sgi cluster
#CFLAGS= -64 

#CC=mpicc     #for intel cluster
#CFLAGS= -g -O3 

CC=gcc
CFLAGS= -lm -O2 -Wall -Wshadow

PROGS= LAkernel_direct LAkernel_1_vs_all LAkernel_all_vs_all
#PROGS= LAkernel_direct LAkernel_1_vs_all LAkernel_all_vs_all LAkernel_MPI

all: LAkernel_direct LAkernel_1_vs_all LAkernel_all_vs_all
#all: LAkernel_direct LAkernel_1_vs_all LAkernel_all_vs_all LAkernel_MPI

clean: 
	rm -f *.o $(PROGS)

LAkernel_direct: LAkernel_direct.o LAkernel.o
	$(CC) $(CFLAGS) -o LAkernel_direct LAkernel_direct.o LAkernel.o

LAkernel_1_vs_all: LAkernel_1_vs_all.o LAkernel.o seqio.o
	$(CC) $(CFLAGS) -o LAkernel_1_vs_all  LAkernel_1_vs_all.o LAkernel.o seqio.o

LAkernel_all_vs_all: LAkernel_all_vs_all.o LAkernel.o seqio.o
	$(CC) $(CFLAGS) -o LAkernel_all_vs_all  LAkernel_all_vs_all.o LAkernel.o seqio.o

#sgi cluster
#LAkernel_MPI: LAkernel_MPI.o LAkernel.o seqio.o
#	$(CC) $(CFLAGS) -o LAkernel_MPI LAkernel_MPI.o LAkernel.o seqio.o -lm -lmpi

#intel cluster
LAkernel_MPI: LAkernel_MPI.o LAkernel.o seqio.o
	$(CC) $(CFLAGS) -o LAkernel_MPI LAkernel_MPI.o LAkernel.o seqio.o -lm

LAkerneldirect.o: LAkernel.h
LAkernel_1_vs_all.o: LAkernel.h seqio.h
LAkernel_all_vs_all.o: LAkernel.h seqio.h
LAkernel_MPI.o: LAkernel.h seqio.h
