###############################################################################
# Makefile to create the Linux version of the NMR-fitting version of ANALYZE  #
# Valid for Linux machines.                                                   #
###############################################################################
PP = /lib/cpp -P -C
CPPFLAGS = -DSUN
#
# The following three lines are to create a normally working executable.
# Higher optimization levels can be tried, but on the IBM platforms we
# were experiencing "segmentation violation" when using -O3.
#
exe = analyze-morass-Linux.x
FFLAGS = -O6 -m486 -fomit-frame-pointer -c 
LDFLAGS = -O6 -m486 -fomit-frame-pointer -o ${exe}
#FFLAGS = -O2 -m486 -fomit-frame-pointer -c 
#LDFLAGS = -O2 -m486 -fomit-frame-pointer -o ${exe}
#
# The following three lines are two create the executable with debugging 
# information (works much, much slower).
#
#exe = analyze-morass-debug-Linux.x
#FFLAGS = -g -c -C 
#LDFLAGS = -g -C -o ${exe}

BINDIR = ../bin

LIBDIR = 

COMP = f77

.SUFFIXES: .o .f .F

#.F.o:
#${PP} $*.F > $*.f
#${COMP} ${CPPFLAGS} ${FFLAGS} $*.f
#/bin/mv $*.f  f_FILES

.F.o:
	${COMP} ${CPPFLAGS} ${FFLAGS} $*.F

.f.o:
	${COMP} ${FFLAGS} $*.f

objects=analyze.o \
	arcos.o \
	ave_coord.o \
	ave_dist.o \
	bd11p.o \
	beta_turns.o \
	calc_angles.o \
	calc_prop.o \
	chrom_dist.o \
	clustconf.o \
	cluster.o \
	clustmaz.o \
	contact.o \
	cored.o\
	dist_constr.o \
	ellipsoid.o \
	fitsq.o \
	filter.o \
	generate.o \
	hydrogen_bonds.o \
	init_bridge.o \
	jacobi.o \
	lowest_in_energy.o \
	matout.o \
	minsumsl.o \
	morass_eceppak.o \
	noyes.o \
	open_rtns.o \
	param.o \
	pdbout.o \
	pinorm.o \
	ponat.o \
	print_prop.o \
	prop_distr.o \
	prp.o \
	read_angles.o \
	read_pdb.o \
	readprop.o \
	readrtns.o \
	rmdd.o \
	rms_calc.o \
	set_defaults2.o \
	specv.o \
	srtclust.o \
	ss_chiral.o \
	sumsld.o \
	symm.o \
	timing.o \
	track.o \
	utils.o \
	virtual_chain.o \
	write2.o \
	wrtclust.o \
	zimerman.o \
        intcor2.o \
	nmr_fit.o \
	read_spectrum.o \
	coupling.o \
	marquardt.o \
	funder_entropy.o \
	heval1.o \
	banachd.o

# The following modules were taken from the MORASS package of
# Dr. David Gorenstein group (Purdue University, West Lafayette, IN)
morassobj = procsim.o diag.o

analyze.x: ${objects} ${morassobj}
	${COMP} ${LDFLAGS} ${objects} ${morassobj} > loadmap
	mv ${exe} ${BINDIR}

clean: 
	/bin/rm *.o
