# makefile

CC = cc
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	#


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
#BSP_AUX = bsp_mc.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 
	cp bsp ../../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 

temp:   temp.c 
	$(CC) $(CFLAGS)  -o $@  $@.c   -lm 



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



pdb_res.o 	: pdb_atom.c pdb_atom.h
pdb_atom.o 	: pdb_atom_aux.c pdb_atom_aux.h
