# Makefile for the Eceppak Package (serial version) on the Extreme.
#
# Note: This file is written for the gnu version of make, and it may not
#  be compatible with other versions.

# Make configuration variables
SHELL = /bin/sh
VPATH = Object:Include:../bin


# Preprocessor variables
CPP = /usr/lib/cpp

# Wilson's VRND is used for the serial version until we test PRNG.
# PRNG (Parallel Random Number Generator ) algorithm is the default 
# for the pre-processor. The -DWVRND flag should be used in this case. 
# When using PRNG, LIBS should include the correct library. 
CPPFLAGS = -P -C -DSGI -DWVRND  -DPHCALC

# Fortran compiler variables
FC = f77 
FFLAGS = -O3 -check_bounds  -OPT:Olimit=3025  -Wf,-IInclude 
# FFLAGS = -g -check_bounds -Wf,-IInclude 

# Linker/loader variables
LDFLAGS = -o eceppakpH-${ECEPP_ARCH}
LIBS = 

# Suffix rule definitions
# All three of these need to be here. ".F.f" is necessary for working
# with RCS and GNU make, and ".f.o" and ".F.o" are always necessary. 
.SUFFIXES: .o .f .F


.F.f:
	${CPP} ${CPPFLAGS} $*.F >  $*.f
	cp $*.f f_FILES/
.f.o:
	${FC} -c ${FFLAGS} $<
	mv $*.o Object

.F.o:
	${CPP}  ${CPPFLAGS}  $*.F >  $*.f
	cp $*.f f_FILES/
	${FC} -c ${FFLAGS} $*.f
	mv $*.o Object
	rm $*.f

objects = accept.o \
	  bd11p.o \
	  calcfpo.o \
	  charged_conf.o \
	  cluster.o \
	  conf_calc.o \
	  connect_ha.o \
	  connect_la97.o \
	  connect_lh.o \
	  core.o \
	  degionzpH.o \
	  dihedral_const.o \
	  distconf.o \
	  distconst.o \
	  eceppize.o \
	  edmc.o \
	  edmc_rtns.o \
	  en_ggg000.o \
	  en_ggg001.o \
	  ene_eval.o \
	  generate.o \
	  gradients.o \
	  grant2.o \
	  init_int_table.o \
	  inptest.o \
	  linbcg.o \
	  main_driver.o \
	  map.o \
	  minimiz.o \
	  mseed_new.o \
	  nrgsetup.o \
	  openunits.o \
	  optim_ionstate.o \
	  orient1.o \
	  param.o \
	  pepprob.o \
	  place.o \
	  potential_eql_DR.o \
	  potential_xyz.o \
	  precal01.o \
	  probres.o \
	  protonation.o \
	  randgens.o \
	  readinfo.o \
	  readrtns.o \
	  restart.o \
	  rmdcon.o \
	  rms_rtns.o \
	  rmscalcs.o \
	  rmsconst.o \
	  set_defaults.o \
	  sigma0_loc.o \
	  sigma_ibem.o \
	  sigma_loc.o \
	  sims_01_pbl.o \
	  sims_02_pbl.o \
	  solv_frengSIMS.o \
	  solv_ibems_DR.o \
	  solv_transSIMS.o \
	  solvation.o \
	  sp_KKK.o \
	  ssint_en.o \
	  ssolv_en.o \
	  sumsl1.o \
	  surf_loc01.o \
	  surf_loc02.o \
	  thermo.o \
	  thetartns.o \
	  timing.o \
	  timit.o \
	  utils.o \
	  vtf_rtns.o \
	  write.o

# All rules go below here

eceppakpH-${ECEPP_ARCH}: ${objects}
	cd Object; ${FC} ${LDFLAGS} ${objects} ${LIBS}; \
	mv $(@F) ${ECEPPH_ROOT}/bin
clean:
	rm -f Object/*.o *.o
