# vmd Makefile, generated by configure: Tue May 14 14:06:27 CDT 1996
#
ARCH			= IRIX5
INSTALLNAME		= vmd
INSTALLLIBDIR		= /usr/local/lib/vmd
INSTALLBINDIR		= /usr/local/bin
INSTALLFTPDIR		= /Net/lisboa/usr/ftp/pub/mdscope/vmd
DEFHTMLVIEWER		= Mosaic
DEFBABELBIN		= /usr/local/bin/babel
DEFDISPLAY		= WIN
DEFTITLE			= ON
DEFHEIGHT			= 6.0
DEFDIST			= -2.0
DEFTMPDIR			= /tmp
INITFILENAME		= .vmd_init
MAXSTRINGLEN		= 6
PROGNAME			= vmd_IRIX5
PROGVERSION		= 1.1
PROMPTSTRING		= "vmd > "
STARTUPFILENAME		= .vmdrc
TCLINCLUDEDIR		= /usr/local/include
TCLLIBRARYDIR		= /usr/local/lib
TCLXINCLUDEDIR		= /usr/local/include
TCLXLIBRARYDIR		= /usr/local/lib
TCLDPINCLUDEDIR		= /usr/local/include
TCLDPLIBRARYDIR		= /usr/local/lib
OPENGLINCLUDEDIR		= 
OPENGLLIBRARYDIR		= 
OPENGLLIBRARIES 		= -lGL -lGLU -lX11
AUTHORS			= "W. Humphrey, A. Dalke, K. Hamer, J. Leech, J. Phillips"
VMD_ARCH  		= "IRIX5"
VMD_OPTIONS		= " GL FORMS TCL REMOTE SURF UNC EXTERNAL OPTIMIZE"
VMD_HOMEPAGE		= "http://www.ks.uiuc.edu/Research/vmd"
VMD_HELPPAGE		= "http://www.ks.uiuc.edu/Research/vmd"
OPTIMIZEFLAG		= $(ARCH_OPT_FLAG)
.SILENT:

############################################################################
##################  no more configuration beyond this point  ###############
############################################################################

# makefile configuration
VPATH                   = .:../src
SHELL 			= /bin/sh
.SUFFIXES: .C .c ..c .i .o

#################################################################
# file which contains makefile dependencies (generated by make depend)
DEPENDFILE 		= Makedata.depend

# directories for object files, scripts, and different parts of code.
# these are all relative to being in any of the subdirs of the main directory
# such as the src, lib, or bin dirs
MAINDIR			= ../.
SRCDIR 			= ../src
OBJDIR 			= ../$(ARCH)
VMDLIBDIR		= ../lib
SCRIPTLIBDIR		= ../lib
DATADIR			= ../data
BINDIR			= ../bin
DOCDIR			= ../doc
PROTEINSDIR		= ../proteins
BASEDISTRIBDIR		= ../distrib

# information on how to create the distribution
BASEDISTRIBFILE		= $(INSTALLNAME)-$(PROGVERSION)
BASEDISTRIBALLFILE	= $(BASEDISTRIBFILE).all.tar
BASEDISTRIBBINFILE	= $(BASEDISTRIBFILE).bin.tar
LINKDISTRIBALLFILE	= $(INSTALLNAME).all.tar
LINKDISTRIBBINFILE	= $(INSTALLNAME).bin.tar
DISTRIBDIR		= $(BASEDISTRIBDIR)/$(BASEDISTRIBFILE)
DISTRIBMAINDIRS		= bin data lib proteins src
DISTRIBDOCDIRS		= doc
### the CAVE and XForms cannot be redistributed by us
# so when making the distribution move xforms to xforms.local
# and xforms.distrib to xforms.  Do the same for the CAVE
DISTRIBLIBS		= cave xforms libg++ mdcomm unc tcl
DISTRIBLIBSEXTRA	= cave xforms libg++ unc tcl
DISTRIBPROTEINS		= \
			$(PROTEINSDIR)/alanin.pdb \
			$(PROTEINSDIR)/alanin.psf \
			$(PROTEINSDIR)/alanin.DCD \
			$(PROTEINSDIR)/deoxy.pdb \
			$(PROTEINSDIR)/mbco.pdb \
			$(PROTEINSDIR)/star.pdb

# directory where to put the ftp files
FTPDIR                  = $(INSTALLFTPDIR)

# dirs for extra includes (except for OPTIONS, must have -I appended in front)
INCDIRS	= -I. -I$(VMDLIBDIR)/libg++/include $(OPTIONSINCDIRS) -I/usr/include

# dir for extra libs (except for OPTIONS, must have -l & -L appended in front)
LIBDIRS	= -L. -L$(VMDLIBDIR)/libg++/lib_$(ARCH) $(OPTIONSLIBDIRS)

# set up the libs
# the -ll is for the lex library - you might not need it
LIBS		= -ll -lg++ $(OPTIONSLIBS) -lm

# compiler and linker options
CFLAGS		= $(ARCH_COPTS)		$(OPTIMIZEFLAG) $(INCDIRS) \
			-DARCH_$(ARCH)	$(OPTIONSDEFS)	$(USER_COPTS)
CPPFLAGS	= $(ARCH_CPPOPTS)	$(OPTIMIZEFLAG) $(INCDIRS) \
			-DARCH_$(ARCH)	$(OPTIONSDEFS)	$(USER_CPPOPTS)

LFLAGS		= $(LIBDIRS) 	$(LIBS)	$(ARCH_LOPTS)
YFLAGS		= -d

#################################################################
# architecture-specific declarations:
#################################################################
# definitions for IRIX5 architecture
#####
# specific names of programs used in make commands
#####
GLINCDIR	=
GLLIBDIR	=
GLLIBNAME	= -lsphere -lfm_s -lgl_s 
CD		= cd
COPY		= cp
COPYDIR		= cp -r
MAKEDIR		= mkdir
MOVE		= mv -f
DELETE		= rm -f
DELETEDIR	= rm -rf
ECHO		= echo
TAR		= tar
COMPRESS	= compress
GNUCOMPRESS	= /usr/local/bin/gzip
AR		= ar rsc
RANLIB		= /bin/true
COCMD		= co -q
COLOCKCMD	= co -l
CICMD		= ci -m"No message"
LATEX		= latex

#####
# extra compiler and linker options
#####
CCPP		= CC
CC		= cc
LEX		= lex
YACC		= yacc
ARCH_OPT_FLAG	= -O
ARCH_DBG_FLAG	= -g
ARCH_DEP_FLAG	= -c -M
ARCH_COPTS	=
ARCH_CPPOPTS	= -I/usr/include/CC
ARCH_LOPTS      = -L/usr/lib -lmalloc -lc_s

#################################################################
# optional components
#################################################################
# options included:  GL FORMS TCL REMOTE SURF UNC EXTERNAL OPTIMIZE

#######################
# OPTIONAL COMPONENT: use GL library for windows and graphics
#	This specifies the libraries used for the rendering library and
#	window manager.
#######################

GRAPHICSDEF		= -DVMDGRAPHICS -DVMDGL
GRAPHICSINCDIR		= $(GLINCDIR)
GRAPHICSLIBDIR		= $(GLLIBDIR)
GRAPHICSLIB		= $(GLLIBNAME)
GRAPHICS_CCPP		= \
				GLDisplayDevice.C \
				GLRenderer.C
GRAPHICS_CC		=
GRAPHICS_H		= \
				GLDisplayDevice.h \
				GLRenderer.h
GRAPHICS_EXTRA		=
GRAPHICS_OBJS		= $(GRAPHICS_CCPP:.C=.o)	$(GRAPHICS_CC:.c=.o)


#######################
# OPTIONAL COMPONENT: Use FORMS GUI library
#	This specifies the library used for the on-screen GUI with buttons,
#	menus, etc.
#######################

# FORMS version
GUIDEF			= -DVMDGUI -DVMDFORMS 
GUIDIR			= $(VMDLIBDIR)/xforms
GUIINCDIR		= -I$(GUIDIR)/include 
GUILIBDIR		= -L$(GUIDIR)/$(ARCH) 
GUILIB			= -lforms -lX11
GUI_CCPP		= \
				AnimateFormsObj.C \
				ColorFormsObj.C \
				DisplayFormsObj.C \
				EditFormsObj.C \
				FilesFormsObj.C \
				FormsObj.C \
				GeometryFormsObj.C \
				GraphicsFormsObj.C \
				MainFormsObj.C \
				MolFormsObj.C \
				RemoteFormsObj.C \
				RenderFormsObj.C \
				SimFormsObj.C \
				TrackerFormsObj.C
GUI_CC			= forms_ui.c
GUI_H			= forms_ui.h \
				AnimateFormsObj.h \
				ColorFormsObj.h \
				DisplayFormsObj.h \
				EditFormsObj.h \
				FilesFormsObj.h \
				FormsObj.h \
				GeometryFormsObj.h \
				GraphicsFormsObj.h \
				MainFormsObj.h \
				MolFormsObj.h \
				RemoteFormsObj.h \
				RenderFormsObj.h \
				SimFormsObj.h \
				TrackerFormsObj.h
GUI_EXTRA		= forms_ui.fd
GUI_OBJS		= $(GUI_CCPP:.C=.o)	$(GUI_CC:.c=.o)


#######################
# OPTIONAL COMPONENT: use Tcl library for script parsing and interpreting
#	Tcl allows VMD to contain a general scripting language with variables,
# control loops, and other fun stuff.  If it is not included, VMD text
# commands will still work, but the general interpreted script capabilities
# will not be available.  The Tcl library must already be installed on
# the system to allow this option to work.
#	All Tcl-specific code is contained in UIText.C
#######################

TCLDEF			= -DVMDTCL
TCLINCDIR		= -I$(TCLINCLUDEDIR) -I$(TCLXINCLUDEDIR)
TCLLIBDIR		= -L$(TCLLIBRARYDIR) -L$(TCLXLIBRARYDIR)
TCLLIB			= -ltclx -ltcl
TCL_CCPP		= ColorInfo.C TclCommands.C MolInfo.C TclGraphics.C \
			Measure.C
TCL_CC			=
TCL_H			= TclCommands.h Measure.h
TCL_EXTRA		=
TCL_OBJS		= $(TCL_CCPP:.C=.o)	$(TCL_CC:.c=.o)


#######################
# OPTIONAL COMPONENT: Remote simulation connection support
#	This may be commented out if not required.
#	This allows the program to connect to or launch an MD simulation
#	on a remote computer, and to control and view the simulation results
#	on-line.  It requires an MD application modified to communicate with
#	this program (a primary example of this is namd).
#######################

REMOTEDEF		= -DVMDREMOTE
REMOTEDIR		= $(VMDLIBDIR)/mdcomm
REMOTEINCDIR		= -I$(REMOTEDIR)/include
#Alas, rapp uses a different ARCH spec than we do ...
REMOTELIBDIR		= -L$(REMOTEDIR)/lib_$(ARCH)
REMOTELIB		= -lrapp
REMOTE_CCPP		= \
				CmdRemote.C \
				MDCommUserCommands.C \
				MoleculeRemote.C \
				Remote.C \
				RemoteList.C \
				mdcomm.C
 
REMOTE_CC		=
REMOTE_H		= \
				CmdRemote.h \
				MDCommUserCommands.h \
				MoleculeRemote.h \
				Remote.h \
				RemoteList.h \
				mdcomm.h
REMOTE_EXTRA		=
REMOTE_OBJS		= $(REMOTE_CCPP:.C=.o)	$(REMOTE_CC:.c=.o)

# executable programs for mdcomm system (in lib/mdcomm/bin_ARCH dir)
REMOTE_CONFDIR		= rappd
REMOTE_CONSUMER		= namd_consumer
REMOTE_APPDAEMON	= namdd
REMOTE_DAEMON		= rappd
REMOTE_PROGRAMS		= \
				$(REMOTE_CONSUMER) \
				$(REMOTE_APPDAEMON) \
				$(REMOTE_DAEMON)


#######################
# OPTIONAL COMPONENT: SURF shape code
#	This is the interface between vmd and the SURF program
# from UNC (see ftp.cs.unc.edu in /pub/projects/GRIP/SURF)
#######################
SURFDEF			= -DVMDSURF
SURFDIR			= ../lib/surf
SURFINCDIR		= 
SURFLIBDIR		= 
SURFLIB			= 
SURF_CCPP		= DrawMolItemSurface.C Surf.C
SURF_CC			=
SURF_H			= Surf.h
SURF_EXTRA		=
SURF_OBJS		= $(SURF_CCPP:.C=.o)	$(SURF_CC:.c=.o)
SURF_EXE		= surf_$(ARCH)


#######################
# OPTIONAL COMPONENT: UNC Tracker library support
#	This may be commented out if not required.
#	This allows the use of many different spatial trackers with the
#	library developed at U. of North Carolina.  Without it, non-CAVE
#	tracking is not allowed.
#######################

UNCDEF			= -DVMDUNC
UNCDIR			= $(VMDLIBDIR)/unc
UNCINCDIR		= -I$(UNCDIR)/include
UNCLIBDIR		= -L$(UNCDIR)/lib_$(ARCH)
UNCLIB			= -ltracker -lquat
UNC_CCPP		= UNCTracker.C
UNC_CC			=
UNC_H			= UNCTracker.h
UNC_EXTRA		=
UNC_OBJS		= $(UNC_CCPP:.C=.o)	$(UNC_CC:.c=.o)


#######################
# OPTIONAL COMPONENT: External interface
#	This may be commented out if not required.
#	This allows other programs to communicate with vmd via Tcl-DP
#######################

EXTERNALDEF		= -DVMDEXTERNAL
#EXTERNALDIR		= /usr/local
EXTERNALINCDIR		= -I$(TCLDP_INCLUDE_DIR)
EXTERNALLIBDIR		= -I$(TCLDP_LIBRARY_DIR)
# we use tcl-dp3.2 without Tk, so need libdplite instead of libdpnetwork
EXTERNALLIB		= -ldplite
EXTERNAL_CCPP		= 
EXTERNAL_CC		=
EXTERNAL_H		=
EXTERNAL_EXTRA		=
EXTERNAL_OBJS		= $(EXTERNAL_CCPP:.C=.o)	$(EXTERNAL_CC:.c=.o)


OPTIONSDEFS	= $(GRAPHICSDEF)	$(GUIDEF)	$(REMOTEDEF) \
			$(UNCDEF)	$(CAVEDEF) 	$(TCLDEF) \
			$(SIGMADEF)	$(EXTERNALDEF)	$(DEBUGDEF) \
			$(ALPHADEF)	$(SURFDEF)
OPTIONSINCDIRS	= $(GRAPHICSINCDIR)	$(GUIINCDIR)	$(REMOTEINCDIR) \
			$(UNCINCDIR)	$(CAVEINCDIR) 	$(TCLINCDIR) \
			$(SIGMAINCDIR)	$(EXTERNALINCDIR) \
			$(ALPHAINCDIR)  $(SURFINCDIR)
OPTIONSLIBDIRS	= $(GRAPHICSLIBDIR)	$(GUILIBDIR)	$(REMOTELIBDIR) \
			$(UNCLIBDIR)	$(CAVELIBDIR) 	$(TCLLIBDIR)  \
			$(SIGMALIBDIR)	$(EXTERNALLIBDIR) \
			$(ALPHALIBDIR)	$(SURFLIBDIR)
OPTIONSLIBS	= $(GRAPHICSLIB)	$(GUILIB)	$(REMOTELIB) \
			$(UNCLIB)	$(CAVELIB) 	$(TCLLIB) \
			$(SIGMALIB)	$(EXTERNALLIB)  $(ALPHALIB) \
			$(SURFLIB)
OPTIONS_CCPP	= $(GRAPHICS_CCPP)	$(GUI_CCPP)	$(REMOTE_CCPP) \
			$(UNC_CCPP)	$(CAVE_CCPP) 	$(TCL_CCPP) \
			$(SIGMA_CCPP)	$(EXTERNAL_CCPP) \
			$(ALPHA_CCPP)	$(SURF_CCPP)
OPTIONS_CC	= $(GRAPHICS_CC)	$(GUI_CC)	$(REMOTE_CC) \
			$(UNC_CC)	$(CAVE_CC) 	$(TCL_CC) \
			$(SIGMA_CC)	$(EXTERNAL_CC)	$(ALPHA_CC) \
			$(SURF_CC)
OPTIONS_H	= $(GRAPHICS_H)		$(GUI_H)	$(REMOTE_H) \
			$(UNC_H)	$(CAVE_H) 	$(TCL_H) \
			$(SIGMA_H)	$(EXTERNAL_H)	$(ALPHA_H) \
			$(SURF_H)
OPTIONS_EXTRA	= $(GRAPHICS_EXTRA)	$(GUI_EXTRA)	$(REMOTE_EXTRA) \
			$(UNC_EXTRA)	$(CAVE_EXTRA) 	$(TCL_EXTRA) \
			$(SIGMA_EXTRA)	$(EXTERNAL_EXTRA) \
			$(ALPHA_EXTRA)  $(SURF_EXTRA)
OPTIONS_OBJS	= $(GRAPHICS_OBJS)	$(GUI_OBJS)	$(REMOTE_OBJS) \
			$(UNC_OBJS)	$(CAVE_OBJS) 	$(TCL_OBJS) \
			$(SIGMA_OBJS)	$(EXTERNAL_OBJS) \
			$(ALPHA_OBJS)	$(SURF_OBJS)
OPTIONS_SRCS	= $(OPTIONS_CCPP)	$(OPTIONS_CC)

#######################
# end of optional component selection
#######################


# VMD source files
VMD_CCPP	= \
		Animation.C \
		ArtDisplayDevice.C \
		AtomColor.C \
		AtomRep.C \
		AtomSel.C \
		Axes.C \
		BabelConvert.C \
		BaseMolecule.C \
		Buttons.C \
		CmdAnimate.C \
		CmdColor.C \
		CmdDisplay.C \
		CmdLabel.C \
		CmdMenu.C \
		CmdMol.C \
		CmdMouse.C \
		CmdPick.C \
		CmdRender.C \
		CmdTool.C \
		CmdTracker.C \
		CmdTrans.C \
		CmdUser.C \
		CmdUtil.C \
		ColorList.C \
		ColorUser.C \
		Command.C \
		CommandQueue.C \
		ConfigList.C \
		CoorDCD.C \
		CoorFile.C \
		CoorFileData.C \
		CoorPDB.C \
		DisplayDevice.C \
		Displayable.C \
		DispCmds.C \
		DrawMolecule.C \
		DrawMolItem.C \
		DrawForce.C \
		DrawPatch.C \
		Enterprise.C \
		FileRenderList.C \
		FileRenderer.C \
		Geometry.C \
		GeometryAngle.C \
		GeometryAtom.C \
		GeometryBond.C \
		GeometryDihedral.C \
		GeometryList.C \
		GeometryMol.C \
		GeometryTug.C \
		Global.C \
		GrabTool.C \
		Inform.C \
		Light.C \
		LightList.C \
		Matrix4.C \
		MolAction.C \
		Molecule.C \
		MoleculeList.C \
		MoleculeFile.C \
		MoleculeFileEDM.C \
		MoleculeGraphics.C \
		MoleculeFilePDB.C \
		MoleculeFilePSF.C \
		MoleculeFileRaster3D.C \
		Mouse.C \
		MoveTool.C \
		NormalScene.C \
		ParseTree.C \
		PickList.C \
		PickMode.C \
		PickModeAtomMove.C \
		PickModeCenter.C \
		PickModeMolLabel.C \
		PickModeQuery.C \
		Pickable.C \
		PointerTool.C \
		PopupMenu.C \
		POVDisplayDevice.C \
		RadianceDisplayDevice.C \
		RayShadeDisplayDevice.C \
		R3dDisplayDevice.C \
		ReadDCD.C \
		ReadEDM.C \
		ReadPDB.C \
		ReadPSF.C \
		RotateTool.C \
		Scene.C \
		Stage.C \
		SymbolTable.C \
		TextTracker.C \
		Timer.C \
		Timestep.C \
		Tokenize.C \
		TokenDisplayDevice.C \
		Tool.C \
		ToolControl.C \
		Tracker.C \
		TrackerList.C \
		TransTool.C \
		TugTool.C \
		UIList.C \
		UIObject.C \
		UIText.C \
		UIVR.C \
		VButton.C \
		VMDTitle.C \
		VRegion.C \
		VRegionList.C \
		startup.C \
		utilities.C \
		vmd.C

VMD_CC	=

# VMD header files ... NOTE: for templates, both the .h AND the .c file
#	should be specified on the same line, in this header section.
#	The filename extension for a template source file should be .c,
#	not .C (the case of the extension must match the case of the header
#	file defining the template).  This all is done because template
#	source code files are NOT to be compiled as normal, and should NOT
#	have dependencies generated for them.
VMD_H		= \
		Animation.h \
		ArtDisplayDevice.h \
		Atom.h \
		AtomColor.h \
		AtomParser.h \
		AtomRep.h \
		AtomSel.h \
		Axes.h \
		BabelConvert.h \
		BaseMolecule.h \
		Buttons.h \
		CmdAnimate.h \
		CmdColor.h \
		CmdDisplay.h \
		CmdLabel.h \
		CmdMenu.h \
		CmdMol.h \
		CmdMouse.h \
		CmdPick.h \
		CmdRender.h \
		CmdTool.h \
		CmdTracker.h \
		CmdTrans.h \
		CmdUser.h \
		CmdUtil.h \
		ColorList.h \
		ColorUser.h \
		Command.h \
		CommandQueue.h \
		ConfigList.h \
		CoorDCD.h \
		CoorFile.h \
		CoorFileData.h \
		CoorPDB.h \
		DLinkList.h 		DLinkList.c \
		DispCmds.h \
		DisplayDevice.h \
		Displayable.h \
		DrawMolecule.h \
		DrawMolItem.h \
		DrawForce.h \
		DrawPatch.h \
		Enterprise.h \
		FileRenderList.h \
		FileRenderer.h \
		Fragment.h \
		Geometry.h \
		GeometryAngle.h \
		GeometryAtom.h \
		GeometryBond.h \
		GeometryDihedral.h \
		GeometryList.h \
		GeometryMol.h \
		GeometryTug.h \
		Global.h \
		GrabTool.h \
		Grid.h			Grid.c \
		Inform.h \
		Light.h \
		LightList.h \
		Matrix4.h \
		MolAction.h \
		Molecule.h \
		MoleculeFile.h \
		MoleculeFileEDM.h \
		MoleculeFilePDB.h \
		MoleculeFilePSF.h \
		MoleculeFileRaster3D.h \
                MoleculeGraphics.h \
		MoleculeList.h \
		Mouse.h \
		MouseEvent.h \
		MoveTool.h \
		NameList.h		NameList.c \
		NormalScene.h \
		ParseTree.h \
		PickList.h \
		PickMode.h \
		PickModeAtomMove.h \
		PickModeCenter.h \
		PickModeMolLabel.h \
		PickModeQuery.h \
		Pickable.h \
		PointerTool.h \
		PopupMenu.h \
		POVDisplayDevice.h \
		RadianceDisplayDevice.h \
		RayShadeDisplayDevice.h \
		R3dDisplayDevice.h \
		ResizeArray.h		ResizeArray.c \
		ReadDCD.h \
		ReadEDM.h \
		ReadPDB.h \
		ReadPSF.h \
		Residue.h \
		RotateTool.h \
		Scene.h \
		Stack.h 		Stack.c \
		Stage.h \
		SymbolTable.h \
		TextTracker.h \
		Timer.h \
		Timestep.h \
		Tokenize.h \
		TokenDisplayDevice.h \
		Tool.h \
		ToolControl.h \
		Tracker.h \
		TrackerList.h \
		TransTool.h \
		TugTool.h \
		UIList.h \
		UIObject.h \
		UIText.h \
		UIVR.h \
		VButton.h \
		VMDTitle.h \
		VRegion.h \
		VRegionList.h \
		startup.h \
		utilities.h

# VMD yacc and lex files.  There is only one of each,
#  and they are used for the atom selection parser
VMD_YACC	= AtomParser.y

VMD_LEX		= AtomLexer.l

# summary of the above files
VMD_SRCS	= $(VMD_CCPP)		$(VMD_CC) \
		  $(VMD_YACC)		$(VMD_LEX)
VMD_OBJS	= $(VMD_CCPP:.C=.o)	$(VMD_CC:.c=.o) \
		  $(VMD_LEX:.l=.o)	$(VMD_YACC:.y=.o)

# data files, such as the .vmdrc and other files
VMD_DATA	= \
		vmd_help.html \
		.tracker \
		.vmdrc \
		.vmd_init

# utility scripts, i.e. the script to start up vmd
VMD_BIN		= vmd

# VMD 'extra' files
VMD_EXTRA	=

# other executable files to be included along with VMD
OTHER_EXE	= $(VMDLIBDIR)/LASSP/Det_$(ARCH)\
		$(VMDLIBDIR)/LASSP/Eigen_$(ARCH) \
		$(VMDLIBDIR)/LASSP/Invert_$(ARCH) \
		$(VMDLIBDIR)/stride/stride_$(ARCH)

OTHER_NAMES	= Det_$(ARCH) Eigen_$(ARCH) Invert_$(ARCH) stride_$(ARCH)

###############################
# all components ... includes optional files, defined in Makedata.options
###############################
ALL_CCPP_SRCS	= $(VMD_CCPP)		$(OPTIONS_CCPP)
ALL_CC_SRCS	= $(VMD_CC)		$(OPTIONS_CC)
ALL_YACC_SRCS	= $(VMD_YACC)		$(OPTIONS_YACC)
ALL_LEX_SRCS	= $(VMD_LEX)		$(OPTIONS_LEX)
ALL_SRCS	= $(VMD_SRCS)		$(OPTIONS_SRCS)
ALL_H		= $(VMD_H)		$(OPTIONS_H)
ALL_OBJS	= $(VMD_OBJS)		$(OPTIONS_OBJS)
EXTRA_FILES	= $(VMD_EXTRA)		$(OPTIONS_EXTRA)
DATA_FILES	= $(VMD_DATA)
BINARY_FILES	= 
SCRIPT_FILES	= $(INSTALLNAME)

# main directory utility files, such as this configure script and README
MAIN_DIR_FILES	= \
		Announcement \
		FEEDBACK \
		README \
		configure

###############################
# Documentation files ... all in directory DOCDIR
###############################
DOC_STYLE_FILES	= \
		graphic.sty \
		picinpar.sty

# files needed for the installation guide
MAIN_INST_DOC	= ig.tex
DOC_INST_FILES	= \
		ig_chapters.tex \
		ig_custom.tex \
		ig_install.tex \
		ig_intro.tex \
		ig_macros.tex \
		ig_make.tex \
		ig_unpack.tex
ALL_INST_FILES	= $(MAIN_INST_DOC) $(DOC_INST_FILES)

# files needed for the user's guide
MAIN_USER_DOC	= ug.tex
DOC_USER_FILES	= \
		ug_basics.tex \
		ug_chapters.tex \
		ug_exec_env.tex \
		ug_file_types.tex \
		ug_form_animate.tex \
		ug_form_color.tex \
		ug_form_display.tex \
		ug_form_edit.tex \
		ug_form_file.tex \
		ug_form_graphics.tex \
		ug_form_labels.tex \
		ug_form_main.tex \
		ug_form_mol.tex \
		ug_form_remote.tex \
		ug_form_render.tex \
		ug_form_tracker.tex \
		ug_forms.tex \
		ug_future.tex \
		ug_graphics.tex \
		ug_intro.tex \
		ug_mdcomm.tex \
		ug_misc.tex \
		ug_mol_colors.tex \
		ug_mol_reps.tex \
		ug_mol_selection.tex \
		ug_molecule_info.tex \
		ug_mouse_display.tex \
		ug_mouse_forms.tex \
		ug_other_ui.tex \
		ug_rendering.tex \
		ug_simulation.tex \
		ug_stereo.tex \
		ug_text_ui.tex \
		ug_tutorial.tex \
		ug_vectors.tex

ALL_USER_FILES	= $(MAIN_USER_DOC) $(DOC_USER_FILES)

# files needed for the programmer's guide
MAIN_PROG_DOC	= pg.tex
DOC_PROG_FILES	= \
		pg_chapters.tex \
		pg_codestyle.tex \
		pg_filestruct.tex \
		pg_intro.tex \
		pg_macros.tex \
		pg_make.tex \
		pg_objects.tex \
		pg_structure.tex \
		ColorList.tex \
		ColorUser.tex \
		Command.tex \
		CommandQueue.tex \
		Animation.tex \
		Atom.tex \
		BaseMolecule.tex \
		DLinkList.tex \
		DispCmd.tex \
		DisplayDevice.tex \
		Displayable.tex \
		DrawMolecule.tex \
		Inform.tex \
		Matrix4.tex \
		Molecule.tex \
		Mouse.tex \
		PopupMenu.tex \
		PopupMenuItem.tex \
		NameList.tex \
		ResizeArray.tex \
		Scene.tex \
		Stack.tex \
		Timer.tex \
		Timestep.tex \
		UIList.tex \
		UIObject.tex \
		UIText.tex

ALL_PROG_FILES	= $(MAIN_PROG_DOC) $(DOC_PROG_FILES)

# files needs by all the different guides, and for the book format
MAIN_ALL_DOC	= vmd.tex
DOC_ALL_FILES	= \
		vmd_authors.tex \
		vmd_begindoc.tex \
		vmd_configure.tex \
		vmd_macros.tex \
		vmd_moreinfo.tex \
		vmd_paramcomp.tex \
		vmd_paraminst.tex \
		vmd_ref.tex \
		vmd_style.tex \
		vmd_title.tex

ALL_MAIN_FILES	= $(MAIN_ALL_DOC) $(DOC_ALL_FILES)

DOC_FILES = \
		$(ALL_INST_FILES) \
		$(ALL_PROG_FILES) \
		$(ALL_USER_FILES) \
		$(ALL_MAIN_FILES) \
		$(DOC_STYLE_FILES)

DOC_DRIVER_FILES	= $(MAIN_INST_DOC) $(MAIN_PROG_DOC) $(MAIN_USER_DOC) \
				$(MAIN_ALL_DOC)
DOC_DVI_FILES		= $(DOC_DRIVER_FILES:.tex=.dvi)
DOC_PS_FILES		= $(DOC_DRIVER_FILES:.tex=.ps)

############################### 
# default rules 
###############################

.C.i:
	$(ECHO) "Preprocessing " $< " --> " $*.i " ..."; \
	$(CCPP) $(CPPFLAGS) -E $(SRCDIR)/$< > $*.i

.C..c:
	$(ECHO) "Translating " $< " --> " $*..c " ..."; \
	$(CCPP) $(CPPFLAGS) -Fc $(SRCDIR)/$< > $*..c

.C.o:
	$(ECHO) "Compiling " $< " --> " $*.o " ..."; \
	$(CCPP) $(CPPFLAGS) -c $(SRCDIR)/$<

.c.o:
	$(ECHO) "Compiling " $< " --> " $*.o " ..."; \
	$(CC) $(CFLAGS) -c $(SRCDIR)/$<

.y.o:
	$(ECHO) "Converting " $< " --> "$@ " ..."; \
	$(YACC) $(YFLAGS) $(SRCDIR)/$<
	$(MOVE) y.tab.c y.tab.C
	$(CCPP) $(CPPFLAGS) -I$(SRCDIR) -c y.tab.C
	$(MOVE) y.tab.o $@
	$(DELETE) y.tab.C y.tab.h

.l.o:
	$(ECHO) "Converting " $< " --> "$@ " ..."; \
	$(LEX) $(SRCDIR)/$<
	$(MOVE) lex.yy.c lex.yy.C
	$(CCPP) $(CPPFLAGS) -I$(SRCDIR) -c lex.yy.C
	$(MOVE) lex.yy.o $@
	$(DELETE) lex.yy.C


###############################
# main target rule
###############################

all default:	$(PROGNAME)

#### executables

$(PROGNAME): $(ALL_OBJS)
	$(ECHO) "Linking " $@ " ..."; \
	$(CCPP) $(CPPFLAGS) -o $@ $(ALL_OBJS) $(LFLAGS)

#### yacc headers

$(SRCDIR)/y.tab.h: $(SRCDIR)/AtomParser.y $(SRCDIR)/AtomParser.h
	$(ECHO) "Creating " $@ " ..."; \
	$(YACC) $(YFLAGS) $(SRCDIR)/AtomParser.y; \
	$(MOVE) y.tab.h $(SRCDIR); \
	$(DELETE) y.tab.c

#### configure include files for src and documentation

version: srcversion docversion

srcversion:
	$(ECHO) "Updating src/config.h ..."; \
	$(CD) $(SRCDIR); \
	if [ -f config.h ]; then $(DELETE) config.h; fi; \
	$(ECHO) \#ifndef CONFIG_OPTIONS_H >> config.h ; \
	$(ECHO) \#define CONFIG_OPTIONS_H >> config.h ; \
	$(ECHO) \#define VMDVERSION \"$(PROGVERSION)\" >> config.h ; \
	$(ECHO) \#define VERSION_MSG \"$(INSTALLNAME) for $(ARCH), version $(PROGVERSION) \(`date +'%B %e, %Y'`\)\" >> config.h ; \
	$(ECHO) \#define CMDLEN $(MAXSTRINGLEN) >> config.h ; \
	$(ECHO) \#define DEF_VMDHTMLVIEWER \"$(DEFHTMLVIEWER)\" >> config.h; \
	$(ECHO) \#define DEF_VMDBABELBIN \"$(DEFBABELBIN)\" >> config.h ; \
	$(ECHO) \#define DEF_VMDENVVAR \"$(INSTALLLIBDIR)\" >> config.h ; \
	$(ECHO) \#define DEF_VMDTMPDIR \"$(DEFTMPDIR)\" >> config.h ; \
	$(ECHO) \#define INIT_DEFDISPLAY DISPLAY_$(DEFDISPLAY) >> config.h ; \
	$(ECHO) \#define INIT_DEFTITLE   TITLE_$(DEFTITLE) >> config.h ; \
	$(ECHO) \#define INIT_DEFHEIGHT  $(DEFHEIGHT) >> config.h ; \
	$(ECHO) \#define INIT_DEFDIST    $(DEFDIST) >> config.h ; \
	$(ECHO) \#define VMD_AUTHORS   \"$(AUTHORS)\" >> config.h ; \
	$(ECHO) \#define VMD_INITFILE  \"$(INITFILENAME)\" >> config.h ; \
	$(ECHO) \#define VMD_STARTUP   \"$(STARTUPFILENAME)\" >> config.h ; \
	$(ECHO) \#define VMD_ARCH      \"$(VMD_ARCH)\" >> config.h ; \
	$(ECHO) \#define VMD_OPTIONS   \"$(VMD_OPTIONS)\" >> config.h ; \
	$(ECHO) \#define VMD_HOMEPAGE  \"$(VMD_HOMEPAGE)\" >> config.h ; \
	$(ECHO) \#define VMD_HELPPAGE  \"$(VMD_HELPPAGE)\" >> config.h ; \
	$(ECHO) \#define VMD_CMD_PROMPT \"$(PROMPTSTRING)\" >> config.h ; \
	$(ECHO) \#endif >> config.h; \
	if [ -d $(UNCDIR)/include ]; then \
	  $(COPY) config.h $(UNCDIR)/include; \
	fi

docversion:
	$(ECHO) "Updating doc/vmd_version.tex ..."; \
	$(CD) $(DOCDIR); \
	if [ -f vmd_version.tex ]; then $(DELETE) vmd_version.tex; fi; \
	$(ECHO) '\\'newcommand\{\\VMDNAME\} \{$(INSTALLNAME)\}>>vmd_version.tex ;\
	$(ECHO) '\\'newcommand\{\\VMDDATE\} \{`date +'%B %e, %Y'`\} >> vmd_version.tex ;\
	$(ECHO) '\\'newcommand\{\\VMDVER\} \{$(PROGVERSION)\}>>vmd_version.tex;\
	$(ECHO) '\\'newcommand\{\\VMDAUTHORS\} \{$(AUTHORS)\}>>vmd_version.tex

###############################
### latex the documentation
###############################
doc doc.all:	doc.ig doc.pg doc.ug

doc.ig:
	$(ECHO) "Creating the installation guide ..." ; \
	$(CD) $(DOCDIR); \
	$(LATEX) $(MAIN_INST_DOC) && \
		dvips -o -Z $(MAIN_INST_DOC:.tex=.dvi)

doc.pg:
	$(ECHO) "Creating the programmers guide ..." ; \
	$(CD) $(DOCDIR); \
	$(LATEX) $(MAIN_PROG_DOC) && \
		dvips -o -Z $(MAIN_PROG_DOC:.tex=.dvi)

doc.ug:
	$(ECHO) "Creating the users guide ..." ; \
	$(CD) $(DOCDIR); \
	$(LATEX) $(MAIN_USER_DOC) && \
		dvips -o -Z $(MAIN_USER_DOC:.tex=.dvi)

doc.book:
	$(ECHO) "Creating the complete documentation book ..." ;\
	$(CD) $(DOCDIR); \
	$(LATEX) $(MAIN_ALL_DOC) && \
		dvips -o -Z $(MAIN_ALL_DOC:.tex=.dvi)

###############################
### installation targets
###############################

### install everything
install.all: install install.doc

### install program and data files in proper directory (i.e. everything except docs)
install: install.exe install.scripts install.data install.mdcomm \
	install.surf install.other

### create installation directories
install.dir:
	if [ ! -d $(INSTALLLIBDIR) ]; then \
		$(MAKEDIR) $(INSTALLLIBDIR); \
	fi ; \
	if [ ! -d $(INSTALLLIBDIR)/doc ]; then \
		$(MAKEDIR) $(INSTALLLIBDIR)/doc; \
	fi

### install executable
install.exe: install.dir
	$(ECHO) "Installing executable(s) in $(INSTALLLIBDIR)"; \
	$(CD) $(SRCDIR); \
	if [ -f $(INSTALLLIBDIR)/$(PROGNAME) ]; then \
		$(COPY) $(INSTALLLIBDIR)/$(PROGNAME) \
			$(INSTALLLIBDIR)/$(PROGNAME)_old ; \
	fi; \
	$(COPY) $(PROGNAME)   $(INSTALLLIBDIR) ; \
	chmod u+w $(INSTALLLIBDIR)/$(PROGNAME)

### install executable and scripts and utilities
install.scripts: install.dir
	$(ECHO) "Installing scripts and utilities in $(INSTALLBINDIR)"; \
	$(CD) $(BINDIR); \
	if [ "$(BIN_FILES)" != "" ]; then \
	  $(COPY) $(BIN_FILES) $(INSTALLBINDIR) ; \
	fi ; \
	if [ -f run_vmd_tmp ]; then $(DELETE) run_vmd_tmp; fi ;\
	$(ECHO) '#!/bin/csh' >> run_vmd_tmp ; \
	$(ECHO) 'set defaultvmddir='$(INSTALLLIBDIR) >> run_vmd_tmp ; \
	$(ECHO) 'set vmdbasename='$(INSTALLNAME) >> run_vmd_tmp ; \
	$(ECHO) 'set consumer='$(REMOTE_CONSUMER) >> run_vmd_tmp ; \
	cat $(VMD_BIN) >> run_vmd_tmp ; \
	chmod +x run_vmd_tmp ; \
	$(COPY) run_vmd_tmp $(INSTALLBINDIR)/$(INSTALLNAME) ; \
	$(DELETE) run_vmd_tmp ; \
	$(ECHO) "Installing scripts.tar in $(INSTALLLIBDIR)"; \
	$(CD) $(SCRIPTLIBDIR) ; \
	cat scripts.tar | (cd $(INSTALLLIBDIR); $(TAR) -xf - )
	

### install data files in proper directory
install.data: install.dir
	$(ECHO) "Installing data files in $(INSTALLLIBDIR)"; \
	$(CD) $(DATADIR); \
	$(COPY) vmd_help.html .tracker $(INSTALLLIBDIR) ; \
	$(COPY) .vmd_init $(INSTALLLIBDIR)/$(INITFILENAME) ; \
	$(COPY) .vmdrc $(INSTALLLIBDIR)/$(STARTUPFILENAME) ; \
	$(CD) $(INSTALLLIBDIR) ; \
	chmod u+w .tracker vmd_help.html $(INITFILENAME) $(STARTUPFILENAME)

### install MDCOMM files (if necessary)
install.mdcomm: install.dir
	if [ "$(REMOTEDEF)" != "" ]; then \
	  $(ECHO) "Installing mdcomm files in $(INSTALLLIBDIR)/mdcomm"; \
	  $(COPYDIR) $(VMDLIBDIR)/mdcomm $(INSTALLLIBDIR) ; \
	fi

#	  if [ ! -d $(INSTALLLIBDIR)/mdcomm/$(REMOTE_CONFDIR) ]; then \
#	    $(MAKEDIR) $(INSTALLLIBDIR)/mdcomm/$(REMOTE_CONFDIR) ; \
#	  fi ; \
#	  if [ -f $(VMDLIBDIR)/mdcomm/bin_$(ARCH)/$(REMOTE_CONSUMER) ]; then \
#	    $(COPY) $(VMDLIBDIR)/mdcomm/bin_$(ARCH)/$(REMOTE_CONSUMER)  \
#		$(INSTALLLIBDIR)/mdcomm/$(REMOTE_CONSUMER)_$(ARCH) ; \
#	  fi; \
#	  if [ -f $(VMDLIBDIR)/mdcomm/bin_$(ARCH)/$(REMOTE_APPDAEMON) ];then \
#	    $(COPY) $(VMDLIBDIR)/mdcomm/bin_$(ARCH)/$(REMOTE_APPDAEMON)  \
#		$(INSTALLLIBDIR)/mdcomm/$(REMOTE_APPDAEMON)_$(ARCH) ; \
#	  fi; \
#	  if [ -f $(VMDLIBDIR)/mdcomm/bin_$(ARCH)/$(REMOTE_DAEMON) ];then \
#	    $(COPY) $(VMDLIBDIR)/mdcomm/bin_$(ARCH)/$(REMOTE_DAEMON)  \
#		$(INSTALLLIBDIR)/mdcomm/$(REMOTE_DAEMON)_$(ARCH) ; \
#	  fi; \
#	  $(COPY) $(VMDLIBDIR)/mdcomm/$(REMOTE_CONFDIR)/* \
#		$(INSTALLLIBDIR)/mdcomm/$(REMOTE_CONFDIR); \
#	fi

### install surf files
install.surf: install.dir
	if [ "$(SURFDEF)" != "" ]; then \
	  $(ECHO) "Installing surf files in $(INSTALLLIBDIR)"; \
	  if [ -f $(VMDLIBDIR)/surf_$(ARCH) ]; then \
	    $(COPY) $(VMDLIBDIR)/surf_$(ARCH) $(INSTALLLIBDIR) ; \
          fi ; \
        fi

### install OTHER files
install.other: install.dir
	$(ECHO) "Installing other exe files in $(INSTALLLIBDIR)"; \
	cd $(VMDLIBDIR) ; \
	$(COPY) $(OTHER_NAMES) $(INSTALLLIBDIR) ;

### install documentation in proper directory
install.doc: install.dir
	$(ECHO) "Installing documentation in $(INSTALLLIBDIR)/doc"; \
	$(CD) $(DOCDIR); \
	if [ "$(DOC_PS_FILES)" != "" ]; then \
	  $(COPY) *.ps $(INSTALLLIBDIR)/doc ; \
	fi

###############################
### create distribution files
###############################

#### create the distribution directory
distrib.dir:
	if [ ! -d $(DISTRIBDIR) ]; then \
	  $(ECHO) "Creating source distribution dir $(DISTRIBDIR) ..."; \
	  $(MAKEDIR) $(DISTRIBDIR); \
	  $(CD) $(DISTRIBDIR); \
	  $(MAKEDIR) $(DISTRIBMAINDIRS) $(DISTRIBDOCDIRS); \
	fi

#### copy over the bin files
distrib.bin:	distrib.dir
	$(ECHO) "Copying distribution files from 'bin' ..." ; \
	$(CD) $(BINDIR) ; \
	$(COPY) $(VMD_BIN) $(BIN_FILES) $(DISTRIBDIR)/bin

#### create a tar file of all the script files (tcl, tclX, dp, and vmd)
distrib.scripts.tar: distrib.dir
	$(ECHO) "Creating script distribution tar file" ; \
	$(CD) $(SCRIPTLIBDIR) ; \
	if [ -f scripts.tar ] ; then $(DELETE) scripts.tar; fi; \
	$(TAR) cf scripts.tar scripts

#### copy the scripts tar file to the distrib lib dir
distrib.scripts: distrib.dir distrib.scripts.tar
	pwd
	$(ECHO) "Copying $(SCRIPTLIBDIR)/scripts.tar to '$(DISTRIBDIR)/lib'"; \
	$(COPY) $(SCRIPTLIBDIR)/scripts.tar $(DISTRIBDIR)/lib ;

#### copy over the data files
distrib.data:	distrib.dir
	$(ECHO) "Copying distribution files from 'data' ..." ; \
	$(CD) $(DATADIR) ; \
	$(COPY) $(DATA_FILES) $(DISTRIBDIR)/data

#### copy over the documentation files
distrib.doc:	distrib.dir
	$(ECHO) "Copying distribution files from 'doc' ..." ; \
	$(CD) $(DOCDIR) ; \
	$(COPY) ig.ps $(DISTRIBDIR)/doc ; \

###  used to be:  $(COPY) ig.ps pg.ps ug.ps $(DISTRIBDIR)/doc ; \

#### copy over the protein files
distrib.proteins:	distrib.dir
	$(ECHO) "Copying distribution files from 'proteins' ..." ; \
	$(COPY) $(DISTRIBPROTEINS) $(DISTRIBDIR)/proteins

#### create a tar file in the lib directory
distrib.lib.tar:
	$(ECHO) "Creating lib tar file ..." ; \
	$(CD) $(VMDLIBDIR) ; \
	if [ -f libtar.tar ] ; then $(DELETE) libtar.tar; fi ; \
	$(TAR) cf libtar.tar $(DISTRIBLIBS)

#### copy the tar file over to the distrib lib file, and untar it
distrib.lib:	distrib.dir distrib.lib.tar
	$(ECHO) "Copying distribution files from 'lib' ..." ; \
	$(MOVE) $(VMDLIBDIR)/libtar.tar $(DISTRIBDIR)/lib ; \
	$(CD) $(DISTRIBDIR)/lib ; \
	$(TAR) xf libtar.tar ; \
	$(DELETE) libtar.tar

#### copy over the source files, removing the revision history text
distrib.src:	distrib.dir
	$(ECHO) "Copying distribution files from 'src' ..." ; \
	$(CD) $(SRCDIR) ; \
	$(COPY) Makefile Makedata.depend $(DISTRIBDIR)/src ; \
	for i in `ls -1 *.C *.c *.h *.y *.l *.fd` ; do \
	  cat $$i | awk '{ while(1>0) { \
				if($$1!="/*" || $$2!="REVISION") { \
					print \
				} else { \
					break \
				} \
				if(getline < 1) { \
					break \
				} \
			   } \
			   exit \
			 }' > $(DISTRIBDIR)/src/$$i ; \
	done

#### copy over the vmd executable
distrib.exe:		distrib.dir
	$(ECHO) "Copying executable(s) to distribution directory ..." ; \
	$(CD) $(SRCDIR) ; \
	$(COPY) $(PROGNAME) $(DISTRIBDIR)/src ; \
	$(COPY) $(SURFDIR)/$(SURF_EXE) $(DISTRIBDIR)/lib ; \
	$(COPY) $(OTHER_EXE) $(DISTRIBDIR)/lib

#### create the configure.parameters file for distribution
distrib.conf.par:	distrib.dir
	$(ECHO) "Creating distribution configure.parameters ..." ; \
	cat ../configure | awk '{ if($$NF=="***STARTPARAMS***") { \
		  		 getline ; while($$NF!="***ENDPARAMS***") { \
					print ; getline \
		  		 } \
				} \
			}' > $(DISTRIBDIR)/configure.parameters

#### copy over the main files
distrib.top:	distrib.conf.par
	$(ECHO) "Copying top-level distribution files ..." ; \
	$(CD) .. ; \
	$(COPY) $(MAIN_DIR_FILES) configure.options src/$(DISTRIBDIR)/.

#### the main copying driver
distrib.copy:	distrib.bin distrib.data distrib.proteins distrib.lib \
			distrib.scripts distrib.src distrib.exe \
			distrib.doc distrib.top
	chmod -R u+w $(DISTRIBDIR)/. ; \
	chmod -R go-w $(DISTRIBDIR)/.

#### compress the distribution once is has been produced
distrib.compress:	distrib.copy
	$(CD) ../distrib ; \
	$(ECHO) "Creating and compressing $(BASEDISTRIBALLFILE).gz ..."; \
	if [ -f $(BASEDISTRIBALLFILE).gz ]; then \
	  $(MOVE) $(BASEDISTRIBALLFILE).gz $(BASEDISTRIBALLFILE).gz.old; \
	fi ; \
	$(TAR) cf - $(BASEDISTRIBFILE) | \
	  $(GNUCOMPRESS) > $(BASEDISTRIBALLFILE).gz ; \
	$(ECHO) "Creating and compressing $(BASEDISTRIBALLFILE).Z ..."; \
	if [ -f $(BASEDISTRIBALLFILE).Z ]; then \
	  $(MOVE) $(BASEDISTRIBALLFILE).Z $(BASEDISTRIBALLFILE).Z.old; \
	fi ; \
	$(TAR) cf - $(BASEDISTRIBFILE) | \
	  $(COMPRESS) > $(BASEDISTRIBALLFILE).Z ; \
	$(ECHO) "Removing extra files to create $(BASEDISTRIBBINFILE) ..." ; \
	$(CD) $(BASEDISTRIBFILE)/src ; \
	$(DELETE) *.C *.c *.h *.y *.l *.fd ; \
	$(CD) ../lib ; \
	$(DELETEDIR) $(DISTRIBLIBSEXTRA) ; \
	$(CD) ../.. ; \
	$(ECHO) "Creating and compressing $(BASEDISTRIBBINFILE).gz ..."; \
	if [ -f $(BASEDISTRIBBINFILE).gz ]; then \
	  $(MOVE) $(BASEDISTRIBBINFILE).gz $(BASEDISTRIBBINFILE).gz.old; \
	fi ; \
	$(TAR) cf - $(BASEDISTRIBFILE) | \
	  $(GNUCOMPRESS) > $(BASEDISTRIBBINFILE).gz ; \
	$(ECHO) "Creating and compressing $(BASEDISTRIBBINFILE).Z ..."; \
	if [ -f $(BASEDISTRIBBINFILE).Z ]; then \
	  $(MOVE) $(BASEDISTRIBBINFILE).Z $(BASEDISTRIBBINFILE).Z.old; \
	fi ; \
	$(TAR) cf - $(BASEDISTRIBFILE) | \
	  $(COMPRESS) > $(BASEDISTRIBBINFILE).Z

#### the main distribution creation target ... starts the whole chain ...
dist distribution distrib:	distrib.compress
	$(ECHO) "Deleting temporary distribution directory ..."; \
	#$(DELETEDIR) $(DISTRIBDIR)

#### put distrib file out for anon ftp
justftp ftp:
	$(ECHO) "Copying distribution to the FTP directory ..."; \
	$(CD) .. ; \
	$(COPY) README ChangeLog FEEDBACK $(FTPDIR) ; \
	$(CD) distrib ; \
	$(COPY) $(BASEDISTRIBALLFILE).gz $(BASEDISTRIBBINFILE).gz $(FTPDIR); \
	$(COPY) $(BASEDISTRIBALLFILE).Z  $(BASEDISTRIBBINFILE).Z  $(FTPDIR); \
	$(CD) $(FTPDIR) ; \
	chmod u+w README FEEDBACK ChangeLog ; \
	if [ -h $(LINKDISTRIBALLFILE).gz ]; then \
	  $(DELETE) $(LINKDISTRIBALLFILE).gz; \
	fi; \
	if [ -h $(LINKDISTRIBALLFILE).Z ]; then \
	  $(DELETE) $(LINKDISTRIBALLFILE).Z; \
	fi; \
	if [ -h $(LINKDISTRIBBINFILE).gz ]; then \
	  $(DELETE) $(LINKDISTRIBBINFILE).gz; \
	fi; \
	if [ -h $(LINKDISTRIBBINFILE).Z ]; then \
	  $(DELETE) $(LINKDISTRIBBINFILE).Z; \
	fi; \
	ln -s $(BASEDISTRIBALLFILE).gz $(LINKDISTRIBALLFILE).gz ; \
	ln -s $(BASEDISTRIBALLFILE).Z  $(LINKDISTRIBALLFILE).Z  ; \
	ln -s $(BASEDISTRIBBINFILE).gz $(LINKDISTRIBBINFILE).gz ; \
	ln -s $(BASEDISTRIBBINFILE).Z  $(LINKDISTRIBBINFILE).Z ; \
	chgrp -R vmd . ; \
	chmod -R g+w .

#### the whole show, do the distribution and put on ftp
ftpall: distrib justftp


###############################
### RCS checkout targets:
###############################

co.main:
	$(ECHO) "Checking out main directory files ..." ; \
	$(CD) $(MAINDIR); \
	$(COCMD) $(MAIN_DIR_FILES)

co.data:
	$(ECHO) "Checking out data files ..." ; \
	$(CD) $(DATADIR); \
	$(COCMD) $(DATA_FILES)

co.bin:
	$(ECHO) "Checking out scripts and utility files ..." ; \
	$(CD) $(BINDIR); \
	$(COCMD) $(BIN_FILES) $(SCRIPT_FILES)

co.doc:
	$(ECHO) "Checking out all documentation files ..." ; \
	$(CD) $(DOCDIR); \
	$(COCMD) $(DOC_FILES)

co.doc.ig:
	$(ECHO) "Checking out installation guide documentation files ..." ; \
	$(CD) $(DOCDIR); \
	$(COCMD) $(ALL_INST_FILES) $(ALL_MAIN_FILES) $(DOC_STYLE_FILES)

co.doc.pg:
	$(ECHO) "Checking out programmers guide documentation files ..." ; \
	$(CD) $(DOCDIR); \
	$(COCMD) $(ALL_PROG_FILES) $(ALL_MAIN_FILES) $(DOC_STYLE_FILES)

co.doc.ug:
	$(ECHO) "Checking out users guide documentation files ..." ; \
	$(CD) $(DOCDIR); \
	$(COCMD) $(ALL_USER_FILES) $(ALL_MAIN_FILES) $(DOC_STYLE_FILES)

co.src:
	$(ECHO) "Checking out source files ..."; \
	$(CD) $(SRCDIR); \
	$(COCMD) $(ALL_SRCS)

co.h co.include co.header:
	$(ECHO) "Checking out include files ..."; \
	$(CD) $(SRCDIR); \
	$(COCMD) $(ALL_H)

co.extra:
	$(ECHO) "Checking out all other needed files ..." ; \
	if [ "$(EXTRA_FILES)" != "" ]; then \
	  $(CD) $(SRCDIR); \
	  $(COCMD) $(EXTRA_FILES); \
	fi

co:	co.src co.h co.doc co.data co.bin co.extra co.main
	make depend

locks:
	$(ECHO) "Currently locked RCS files: " ; \
	$(CD) $(SRCDIR)/RCS; \
	if [ "`rlog -L -R *,v`" != "" ]; then \
	  ls -alF `rlog -L -R *,v`; \
	fi

###############################
# other useful make commands
###############################

### make Tcl autoloading index file
tclindex:
	echo 'auto_mkindex . *.tcl' | tcl

### reconfigure, based on latest options
configure config conf:
	$(ECHO) "Reconfiguring ..." ;\
	$(CD) .. ;\
	configure

### cleanup target

clean:
	$(DELETE) *.o *.i *.a *.bak *.depend.old *~ core

### dependencies files targets

# save the current dependencies list to rcs
savedepend:
	if [ -f $(DEPENDFILE) ]; then \
	  $(ECHO) "Saving current dependencies file ..."; \
	  $(COLOCKCMD) $(DEPENDFILE).rcs; \
	  $(COPY) $(DEPENDFILE) $(DEPENDFILE).rcs; \
	  $(CICMD) $(DEPENDFILE).rcs; \
	else \
	  $(ECHO) "No current dependencies file $(DEPENDFILE) found.";\
	fi

### automatic file checkout rules

$(ALL_SRCS) $(ALL_H) $(EXTRA_FILES):
	@if [ ! -f $(SRCDIR)/$@ ]; then \
	  $(ECHO) "  Retrieving $@ from RCS directory ..." ; \
	  $(CD) $(SRCDIR) ; \
	  $(COCMD) $@ ; \
	fi

$(DATA_FILES):
	@if [ ! -f $(DATADIR)/$@ ]; then \
	  $(ECHO) "  Retrieving $@ from RCS directory ..." ; \
	  $(CD) $(DATADIR) ; \
	  $(COCMD) $@ ; \
	fi

$(SCRIPT_FILES):
	@if [ ! -f $(BINDIR)/$@ ]; then \
	  $(ECHO) "  Retrieving $@ from RCS directory ..." ; \
	  $(CD) $(BINDIR) ; \
	  $(COCMD) $@ ;\
	fi

$(DOC_FILES):
	@if [ ! -f $(DOCDIR)/$@ ]; then \
	  $(ECHO) "  Retrieving $@ from RCS directory ..." ; \
	  $(CD) $(DOCDIR) ; \
	  $(COCMD) $@ ;\
	fi

config.h vmd_version.tex:
	true

###########################
# write out rules to create dependencies
# create dependencies file ... does not work on all architectures
# also, the yacc/lex dependencies must be done by hand
###########################
depend: $(SRCDIR)/y.tab.h version
	if [ "$(ARCH_DEP_FLAG)" != "" ]; then \
	  $(ECHO) "Creating " $(DEPENDFILE) " ..."; \
	  if [ -f $(DEPENDFILE) ]; then \
	    $(MOVE) -f $(DEPENDFILE) $(DEPENDFILE).old; \
	  fi; \
	  touch $(DEPENDFILE); \
	  for i in ZZZ $(ALL_CCPP_SRCS) ; do \
	    if [ "$$i" != "ZZZ" -a -f $(SRCDIR)/$$i ]; then \
	      $(ECHO) "checking dependencies for $$i ..."; \
	      $(CCPP) $(ARCH_DEP_FLAG) $(INCDIRS) \
		$(OPTIONSDEFS) $(ARCH_CPPOPTS) -DARCH_$(ARCH) $(SRCDIR)/$$i \
			| grep -v "/usr/include" >> $(DEPENDFILE); \
	    fi; \
	  done; \
	  for i in ZZZ $(ALL_CC_SRCS) ; do \
	    if [ "$$i" != "ZZZ" -a -f $(SRCDIR)/$$i ]; then \
	      $(ECHO) "checking dependencies for $$i ..."; \
	      $(CC) $(ARCH_DEP_FLAG) $(INCDIRS) \
		$(OPTIONSDEFS) $(ARCH_COPTS) -DARCH_$(ARCH) $(SRCDIR)/$$i \
			| grep -v "/usr/include" >> $(DEPENDFILE); \
	    fi; \
	  done; \
	  $(ECHO) "ParseTree.o AtomLexer.o AtomParser.o: $(SRCDIR)/y.tab.h" \
		>> $(DEPENDFILE); \
	else \
	  $(ECHO) "Cannot find dependencies; your compiler does not support dependency checking."; \
	fi

###########################
# includes dependencies
###########################
include $(DEPENDFILE)

