# DO NOT MODIFY THIS MAKEFILE.
# It was generated automatically by fixmake
# from input file makefile.gen and writing to makefile.
#
# Makefile for the construction of CONGEN info files and the manual.
#
#   Copyright @copyright{} 1987-1988 Robert E. Bruccoleri
#   
#   Copyright @copyright{} 1990-1997 Bristol-Myers Squibb Company
#   
#   Please see the file, COPYRIGHT, for the copyright notice and
#   terms and conditions for use of this file.
# Makefile macros for a Linux machine running gfortran and gcc.

# Flags -- note that common flags go on the binary definitions

CFLAGS        = -g
COPTFLAGS     = -g -O2 
CSPECOPTFLAGS = -g -O0
CPPFLAGS      = -DLANGUAGE_C -Dlinux -Dunix
FFLAGS        = -g
FOPTFLAGS     = -g -O2 
FSPECOPTFLAGS = -g -O0
FCPPFLAGS     = -Dlinux -Dunix 
ARFLAGS       = qs
LDFLAGS       = 
MAXPROCS      = 20

# Binaries

CC            = gcc44 -ffloat-store -pthread
CPP	      = gcc44 -E
FC            = gfortran44 -std=gnu -fno-second-underscore -fno-f2c -ffloat-store -pthread -fdump-core -fbacktrace 
FLECS         = $(CGBIN)/flecs
FCPP          = $(CGBIN)/fcpp -F
YACC          = $(CGBIN)/myacc
LEX           = flex
INSTALL	      = $(CGBIN)/install
MKPROTO	      = $(CGBIN)/mkproto
SHELL	      = /bin/sh


.SUFFIXES:			# Roll our own below.
.SUFFIXES: .o .c .flx .f .h_proto

SHELL = /bin/sh

TEXIFILES = congen.texinfo usage.texinfo io.texinfo struct.texinfo \
            hbonds.texinfo intcor.texinfo ecntrl.texinfo dynhelp.texinfo \
            cgen.texinfo cgrelated.texinfo sphere.texinfo vibran.texinfo \
	    images.texinfo cons.texinfo corman.texinfo misccom.texinfo \
	    analys.texinfo implem.texinfo storage.texinfo table.texinfo \
            compare.texinfo dynanal.texinfo correl.texinfo anio.texinfo \
            anplot.texinfo andraw.texinfo anclose.texinfo anmisc.texinfo \
            rtop.texinfo parmfile.texinfo support.texinfo nbonds.texinfo \
	    experimental.texinfo pbe.texinfo legalities.texinfo citation.texinfo

FLXSRCS = nmrdata.flx

CSRCS = 

SOURCES = $(TEXIFILES) makefile.gen congen nmrdata.flx nmrdata.xpl tree.xpl

PSFILES = fcpp.ps mkproto.ps wrapgen.ps fsplit.ps ndiffpost.ps rs6kfix.ps avgtable.ps

all:	info/congen html/index.html utils.pdf congen.pdf

install: all

info/congen: $(TEXIFILES) nmrdata.tfig tree.epsf 
	-rm -f info/*
	-makeinfo --output=info/congen congen.texinfo

congen.ps: $(TEXIFILES) nmrdata.epsf tree.epsf
	-rm congen.ps
	echo "Tab check:"
	-grep -n "	" $(TEXIFILES) 
	-tex congen.texinfo
	-texindex congen.??
	-tex congen.texinfo
	-texindex congen.??
	-tex congen.texinfo
	-dvips -f congen.dvi >congen.ps

congen.pdf: congen.ps
	ps2pdf14 congen.ps congen.pdf

utils.pdf: utils.ps
	ps2pdf14 utils.ps utils.pdf

utils.ps: $(PSFILES)
	cat $(PSFILES) >utils.ps

html/index.html: $(TEXIFILES)
	-rm -f html/*
	-makeinfo --html --output=html congen.texinfo

prepare clean:  
	- rm -f congen.aux congen.cp* congen.fn* congen.ky* congen.log \
                congen.pg* congen.toc congen.tp* congen.vr* congen-p*.ps foo.* \
                congen.dvi utils.ps utils.pdf congen.pdf congen.ps \
		makefile html/* info/*
	-$(MAKE) -f makefile.gen makefile

# The following is needed if you want to regenerate the figures.

reallyclean: clean
	- rm -f nmrdata nmrdata.dat nmrdata.epsf nmrdata.tfig tree.epsf \
	        nmrdata.f nmrdata.fli nmrdata.fi

tovax: tovax.time

tovax.time: $(SOURCES)
	cp $? congen-* dino
	(cd dino/; chmod u+w $? congen-*)
	touch tovax.time

nmrdata: nmrdata.flx
	$(FCPP) $(FCPPFLAGS) -I$(CGS) nmrdata.flx nmrdata.fi	
	$(FLECS) nmrdata.fi
	$(FC) -o nmrdata $(FFLAGS) nmrdata.f $(CGLIB)/congen.a

nmrdata.dat: nmrdata
	- ./nmrdata >nmrdata.dat

nmrdata.epsf: nmrdata.dat nmrdata.xpl
	- echo "dev poste nmrdata.epsf" | \
	  cat - nmrdata.xpl | \
	  plt2

nmrdata.tfig: nmrdata.dat nmrdata.xpl
	- echo "dev lp1 nmrdata.tfig" | \
	  cat - nmrdata.xpl | \
	  plt2

tree.epsf: tree.xpl
	- plt2 <tree.xpl

depend:
	cp makefile.gen makefile.gen.BAK
	mkdepend -c "cc -M -I$(CGS) -cckr" \
		 -e 's/olx/o/g' \
		 -e '/\/usr\/include/d' \
	         -e 's:$(CGS):../source:g' \
		 -e 's/.\///' \
		 makefile.gen \
		 $(FLXSRCS) $(CSRCS)
	$(MAKE) makefile

makefile: makefile.gen $(CG)/$(CGPLATFORM).make
	$(CGBIN)/fixmake $(CG)/$(CGPLATFORM) makefile.gen makefile

.DEFAULT:
	co $<
