# makefile

CC = g++
CFLAGS = -g -Wall

########################################

DIR_LIB = ../lib/

BASIC =			\
$(DIR_LIB)basic_ad.o	\
$(DIR_LIB)basic_io.o 	\
$(DIR_LIB)basic_mat.o	\
$(DIR_LIB)basic_ran.o	\
$(DIR_LIB)basic_stat.o	\
$(DIR_LIB)basic_vec.o	\
$(DIR_LIB)basic_stack.o	#

#
BASIC2 =		\
basic_ad.o		\
basic_io.o 		\
basic_mat.o		\
basic_ran.o		\
basic_stat.o		\
basic_vec.o		\
basic_stack.o		#

DIR_PDB = ./

PDB = 				\
$(DIR_PDB)pdb_atom.o		\
$(DIR_PDB)pdb_atom_aux.o	\
$(DIR_PDB)pdb_res.o		\
$(DIR_PDB)seq.o			#

#########################################################
#
#  REMEMBER: 
#  
#  - $@ is the target name (to be used in command lines)
#  - $$@ is the target name (to be used in dependency lines)
#  - :.o=.c means that a sostitution has to be done
#
##############################################################


$(BASIC):
	cd $(DIR_LIB); make $(BASIC)

BSP_AUX = bsp_mc.o bsp_score.o bsp_lig.o

# --- Main program for binding site prediction
bsp:   bsp.c $(BSP_AUX) $(BASIC) $(PDB) *.h
	$(CC) $(CFLAGS)  -o $@  $@.c  $(BSP_AUX) $(BASIC) $(PDB)  -lm 

#-----------PDB
pdb :  pdb.o pdb_io.o  $(BASIC) seq.o
	$(CC) $(CFLAGS) -o $@  pdb.c pdb_io.o   $(BASIC) seq.o -lm 
	cp pdb ../bin
# --- It's going to die;
#bsp_stat:  bsp_stat.o bsp_score.o $(BASIC) atom.o  
#	$(CC) $(CFLAGS)  -o $@  $@.c  bsp_score.o $(BASIC) atom.o  -lm 
#	cp $@ ../bin

#--- It's doing the cluster
bsp_cluster:   bsp_cluster.o $(BASIC)  
	$(CC) $(CFLAGS)  -o $@  $@.c  $(BASIC)   -lm 

Test : Test.c  $(BASIC) $(PDB)  *.h
	$(CC) $(CFLAGS)  -o $@  $@.c  $(BASIC) $(PDB)  -lm 



##########
clean:
	rm *.o core $(DIR_LIB)basic*.o;
clean_basic:
	rm $(DIR_LIB)basic*.o
clean_pdb:
	rm pdb*.o


################

basic_ad.o	: basic_ad.h
basic_io.o 	: basic_io.h
basic_mat.o	: basic_mat.h
basic_ran.o	: basic_ran.h
basic_stat.o	: basic_stat.h
basic_vec.o 	: basic_vec.h
basic_stack.o	: basic_stack.h
