# CHARMM makefile for IBM RS/6000
ROOT = rootdir
SRC = $(ROOT)/source
FLX = $(ROOT)/tool/preflx
LIB = $(ROOT)/lib/ibmlnxmp
EXEC = $(ROOT)/exec/ibmlnxmp
#FC = xlf95_r -qalign=4k -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1 -q64 -qintsize=8 -qposition=appendold
#FC = xlf95_r -q64 -qintsize=8
FC = mpif90  -qalign=4k -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1 -q64 -qintsize=8 -qposition=appendold
CC = mpicc  -q64 -qlonglong -Dnographics -Dnographics -Dibmrs -Di8
#CC = xlc_r -q64 -qlonglong -Dnographics -Dnographics -Dibmrs -Di8
#LD = xlf95_r -O -qalign=4k -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1  -q64 -qintsize=8
#LD = xlf95_r -O  -q64 -qintsize=8
LD = mpif90 -O -qalign=4k -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1  -q64 -qintsize=8
GLIB = 
#CPP = /usr/lib/cpp
#CPPFLAGS =-P -DIBMRS -DCHARMMTEST -DCHARMM  -I$(SRC)/moldyn
RANLIB = echo
GMS = $(ROOT)/tool/gmscomp_ibmaix
#QLIB = -Lmpi -lfmpich -lmpich
#QLIB = -Lmpi -lmpich
QLIB = 
MBONDFLG = 
.SUFFIXES: .fcm .src .o
VPATH = fcm
#FC0 = $(FC) -c -qfixed 
#FC1 = $(FC) -c -qfixed 
#FC2 = $(FC) -c -qfixed 
#FC3 = $(FC) -c -qfixed 
#FCR = $(FC) -c -qfixed 
#FCD = $(FC) -c -qfixed 
#FCRD = $(FC) -c -qfixed 
FC0 = $(FC) -c -g  -qfixed -qxlf77=leadzero
FC1 = $(FC) -c -O   -qfixed -qxlf77=leadzero
FC2 = $(FC) -c -O3  -qfixed -qxlf77=leadzero
FC3 = $(FC) -c -O3  -qfixed -qxlf77=leadzero
FCR = $(FC) -c -O3 -qfixed -qstrict -g  -qxlf77=leadzero
FCD = $(FC) -c -no -g -qfixed 
FCRD = $(FC) -c -no -g -qfixed 

#--------- Uncomment for debugging with debugger -----------------
# FC0 = $(FC) -c -g  -qfixed -qxlf77=leadzero
# FC1 = $(FC) -c -g  -qfixed -qxlf77=leadzero
# FC2 = $(FC) -c -g  -qfixed -qxlf77=leadzero
# FC3 = $(FC) -c -g  -qfixed -qxlf77=leadzero
# LD = xlf95_r -g -qalign=4k -qarch=auto -qcache=auto -qtune=auto -qmaxmem=-1  -q64 -qintsize=8


LIBS = \
	$(LIB)/adumb.so \
	$(LIB)/cadint.so \
	$(LIB)/cff.so \
	$(LIB)/correl.so \
	$(LIB)/dimb.so \
	$(LIB)/dynamc.so \
	$(LIB)/energy.so \
	$(LIB)/gamint.so \
	$(LIB)/gener.so \
	$(LIB)/graphics.a \
	$(LIB)/gukint.so \
	$(LIB)/image.so \
	$(LIB)/io.so \
	$(LIB)/machdep.so \
	$(LIB)/manip.so \
	$(LIB)/mbond.so \
	$(LIB)/mc.so \
	$(LIB)/minmiz.so \
	$(LIB)/misc.so \
	$(LIB)/mmff.so \
	$(LIB)/moldyn.a \
	$(LIB)/molvib.so \
	$(LIB)/nbonds.so \
	$(LIB)/pert.so \
	$(LIB)/quantum.so \
	$(LIB)/rxncor.so \
	$(LIB)/shapes.so \
	$(LIB)/solvation.so \
	$(LIB)/util.so \
	$(LIB)/vibran.so

$(EXEC)/charmm : $(LIB)/stamp $(LIBS)
#	ranlib $(LIBS)
	$(LD) -o charmm.exe $(LIB)/charmm.so $(LIBS) $(LIBS) $(QLIB) $(GLIB)
