# Makefile for Mone Carlo Mapping    			        #
# G. Matthias Ullmann						#
# 								#
# --------------------------------------------------------------#
#								#
# The order of the libraries is important!!!			#
# ------------------------------------------------------------- #
# ------------------------------------------------------------- #
# Flags, Libraries etc.
# path for binaries
#
GMULIB  = ../libmol/

CFLAGS  =  -O3 -W -Wall -I$(GMULIB) -pedantic -static
LIBRARY =  -L $(GMULIB) -lmol -lgmu -lz -lm 
# ---------------------------------------------
# Compile
CC = gcc
AR = ar rv 
#CC = gcc
# --------------------------------------------- 
# Source files
#
MCMAP         = mcmap.o dock-help.o exclude.o
GRD2PDB       = grid2pdb.o exclude.o
PRINTCOOR     = print-coor.o exclude.o dock-help.o
EXCL          = make-excl.o exclude.o
CALC-ENE      = calc-energy.o dock-help.o exclude.o
GET-POTENTIAL = get-potential.o dock-help.o exclude.o
HISTO         = histogram.o 
HISTO2D       = histogram2d.o 
SHIFTCENETER  = shift-center.o
PSFCRD2PQR    = psfcrd2pqr.o
PQRMINFO      = pqrm-info.o
MINDIST       = min-dist.o
# ---------------------------------------------
# Compilation 
#
all: mcmap make-excl print-coor calc-energy \
	get-potential grid2pdb \
     min-dist histogram histogram2d shift-center psfcrd2pqr pqrm-info


get-potential:	$(GET-POTENTIAL)
	$(CC) $(CFLAGS) $(GET-POTENTIAL) $(LIBRARY) -o get-potential
	strip get-potential
print-coor:	$(PRINTCOOR)
	$(CC) $(CFLAGS) $(PRINTCOOR)     $(LIBRARY) -o print-coor
	strip print-coor
mcmap:	$(MCMAP)
	$(CC) $(CFLAGS) $(MCMAP)        $(LIBRARY) -o mcmap
	strip mcmap
calc-energy:	$(CALC-ENE)
	$(CC) $(CFLAGS) $(CALC-ENE)      $(LIBRARY) -o calc-energy
	strip calc-energy
make-excl:	$(EXCL)
	$(CC) $(CFLAGS) $(EXCL)          $(LIBRARY) -o make-excl
	strip make-excl
grid2pdb:	$(GRD2PDB)
	$(CC) $(CFLAGS) $(GRD2PDB)       $(LIBRARY) -o grid2pdb
	strip grid2pdb
min-dist:	$(MINDIST)
	$(CC) $(CFLAGS) $(MINDIST)       $(LIBRARY) -o min-dist
	strip min-dist
histogram: $(HISTO)
	$(CC) $(CFLAGS) $(HISTO)         $(LIBRARY) -o histogram
	strip histogram
histogram2d: $(HISTO2D)
	$(CC) $(CFLAGS) $(HISTO2D)       $(LIBRARY) -o histogram2d
	strip histogram2d
shift-center:	$(SHIFTCENETER)
	$(CC) $(CFLAGS) $(SHIFTCENETER)  $(LIBRARY) -o shift-center
	strip shift-center
psfcrd2pqr: $(PSFCRD2PQR)
	$(CC) $(CFLAGS) $(PSFCRD2PQR)    $(LIBRARY) -o psfcrd2pqr
	strip psfcrd2pqr
pqrm-info: $(PQRMINFO)
	$(CC) $(CFLAGS) $(PQRMINFO)      $(LIBRARY) -o pqrm-info
	strip pqrm-info 

clean:	
	rm -f *.o *~ *.a grid2pdb make-excl mcmap print-coor \
            calc-energy get-potential \
            min-dist histogram histogram2d shift-center psfcrd2pqr pqrm-info
new:	
	makedepend -fMakefile -I $(GMULIB) *.c

install :
	if test ! -d "../../bin";   then mkdir            ../../bin; fi
	if test -f "mcmap";         then mv mcmap         ../../bin/; fi
	if test -f "make-excl";     then mv make-excl     ../../bin/; fi
	if test -f "print-coor";    then mv print-coor    ../../bin/; fi
	if test -f "calc-energy";   then mv calc-energy   ../../bin/; fi
	if test -f "get-potential"; then mv get-potential ../../bin/; fi
	if test -f "min-dist";      then mv min-dist      ../../bin/; fi
	if test -f "histogram";     then mv histogram     ../../bin/; fi
	if test -f "histogram2d";   then mv histogram2d   ../../bin/; fi
	if test -f "shift-center";  then mv shift-center  ../../bin/; fi
	if test -f "psfcrd2pqr";    then mv psfcrd2pqr    ../../bin/; fi
	if test -f "pqrm-info";     then mv pqrm-info     ../../bin/; fi




# ---------------------------------------------
# DO NOT DELETE THIS LINE -- makedepend depends on it.

