# vmd Makefile, generated by configure: Tue Mar 25 00:44:39 CST 1997
#
ARCH			= IRIX5
INSTALLNAME		= vmd
INSTALLLIBDIR		= /usr/local/lib/vmd
INSTALLBINDIR		= /usr/local/bin
INSTALLFTPDIR		= /Net/lisboa/usr/ftp/pub/mdscope/vmd
DEFHTMLVIEWER		= netscape -remote openURL\(%s,new-window\)
DEFSNAPSHOT               = /usr/sbin/scrsave %7Os %1Od %3Od %4Od %6Od
DEFBABELBIN		= /usr/local/bin/babel
DEFDISPLAY		= WIN
DEFTITLE			= ON
DEFHEIGHT			= 6.0
DEFDIST			= -2.0
DEFTMPDIR			= /usr/tmp
INITFILENAME		= .vmd_init
MAXSTRINGLEN		= 15
PROGNAME			= vmd_IRIX5
PROGVERSION		= 1.2b1
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
TKINCLUDEDIR		= /usr/local/include
TKLIBRARYDIR		= /usr/local/lib
OPENGLINCLUDEDIR		= 
OPENGLLIBRARYDIR		= 
OPENGLLIBRARIES 		= -lGL -lGLU -lX11
MESAINCLUDEDIR		= /usr/local/include
MESALIBRARYDIR		= /usr/local/lib
MESALIBRARIES 		= -lMesaGL -lMesaGLU -lXext
AUTHORS			= "A. Dalke, W. Humphrey, J. Ulrich"
VMD_ARCH  		= "IRIX5"
VMD_OPTIONS		= " GL FORMS TCL REMOTE CAVE SURF UNC 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
#  These are the directories to distribute in the complete distribution
DISTRIBLIBS		= cave xforms libg++ mdcomm unc tcl points
#  These are the ones to delete for the binary distribution
DISTRIBLIBSEXTRA	= cave xforms libg++ unc tcl points
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.  You'll know if
# you get an error like: ld: cannot open -ll: No such file or directory
# Also, if you compile under g++, for some reason you'll need to recompile
# the lib/libg++ tree (see the README there).  Otherwise you might get 
# errors like:
#   Unresolved:
#   GString::GString(void)
#   GString::~GString(void)
#   compare(GString const &, GString const &)
#   ...
# Note: the -lg-plus-plus is to eliminate possible name conflicts with -lg++
LIBS		= -ll -lg-plus-plus $(OPTIONSLIBS) -lm
# For g++ (like LINUX)
#LIBS		= -lg-plus-plus $(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 -lgl
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

#################################################################
# optional components
#################################################################
# options included:  GL FORMS TCL REMOTE CAVE SURF UNC 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 -I/usr/include/X11R5
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.  New with the 1.2b1 release Tcl
# MUST be compiled with VMD.  It is just too generally useful to leave
# out and too hard to make a compile time option.
########################

TCLDEF			= -DVMDTCL
TCLINCDIR		= -I$(TCLINCLUDEDIR) -I$(TCLXINCLUDEDIR)
TCLLIBDIR		= -L$(TCLLIBRARYDIR) -L$(TCLXLIBRARYDIR)
TCLLIB			= -ltclx -ltcl
# If Tcl wants dlopen, try adding -ldl (at least under Linux)
#TCLLIB			= -ltclx -ltcl -ldl
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: EVL/NCSA CAVE support
#	This may be commented out if not required.
#	This will require access to the cave library and headers, and will
#	result in unique CAVE objects being used in the program.
#######################

CAVEDEF			= -DVMDCAVE
CAVEDIR			= $(VMDLIBDIR)/cave
CAVEINCDIR		= -I$(CAVEDIR)/include
CAVELIBDIR		= -L$(CAVEDIR)/lib_$(ARCH)
CAVELIB			= -lcave -lsnd
CAVE_CCPP		= \
				CaveDisplayDevice.C \
				CaveScene.C \
				CaveRoutines.C \
				CaveTracker.C
CAVE_CC			=
CAVE_H			= \
				CaveDisplayDevice.h \
				CaveResizeArray.h 	CaveResizeArray.c \
				CaveRoutines.h \
				CaveScene.h \
				CaveTracker.h
CAVE_EXTRA		=
CAVE_OBJS		= $(CAVE_CCPP:.C=.o)	$(CAVE_CC:.c=.o)


#######################
# 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)


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 \
		CoorCRD.C \
		CoorDCD.C \
		CoorFile.C \
		CoorFileData.C \
		CoorPDB.C \
		DisplayDevice.C \
		Displayable.C \
		DispCmds.C \
		DrawMolecule.C \
		DrawMolItem.C \
		DrawMolItem2.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 \
		Global.C \
		GrabTool.C \
		Inform.C \
		Light.C \
		LightList.C \
		Matrix4.C \
		MolAction.C \
		Molecule.C \
		MoleculeList.C \
		MoleculeFile.C \
		MoleculeFileEDM.C \
		MoleculeGraphics.C \
		MoleculeFilePARM.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 \
		POV3DisplayDevice.C \
		PSDisplayDevice.C \
		RadianceDisplayDevice.C \
		RayShadeDisplayDevice.C \
		R3dDisplayDevice.C \
		ReadDCD.C \
		ReadEDM.C \
		ReadPARM.C \
		ReadPDB.C \
		ReadPSF.C \
		RotateTool.C \
		Scene.C \
		SnapshotDisplayDevice.C \
		Stage.C \
		STLDisplayDevice.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 \
		VrmlDisplayDevice.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 \
		CoorCRD.h \
		CoorDCD.h \
		CoorFile.h \
		CoorFileData.h \
		CoorPDB.h \
		DepthSortObject.h \
		DepthSortObject2.h \
		DLinkList.h 		DLinkList.c \
		DispCmds.h \
		DisplayDevice.h \
		Displayable.h \
		DrawMolecule.h \
		DrawMolItem.h \
		DrawMolItemSolventPoints.data \
		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 \
		Global.h \
		GrabTool.h \
		Grid.h			Grid.c \
		Inform.h \
		Light.h \
		LightList.h \
		Matrix4.h \
		MolAction.h \
		Molecule.h \
		MoleculeFile.h \
		MoleculeFileEDM.h \
		MoleculeFilePARM.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 \
		POV3DisplayDevice.h \
		PSDisplayDevice.h \
		RadianceDisplayDevice.h \
		RayShadeDisplayDevice.h \
		R3dDisplayDevice.h \
		ResizeArray.h		ResizeArray.c \
		ReadDCD.h \
		ReadEDM.h \
		ReadPARM.h \
		ReadPDB.h \
		ReadPSF.h \
		Residue.h \
		RotateTool.h \
		Scene.h \
		SnapshotDisplayDevice.h \
		SortableArray.h		SortableArray.c \
		Stack.h 		Stack.c \
		Stage.h \
		STLDisplayDevice.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 \
		VrmlDisplayDevice.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

# There is a printf in here because "echo -n" doesn't work on HPs :(
# But I don't know if printf works on other than HPs, SGIs, and Linux
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 ; \
	printf "%s %s" \#define "DEF_VMDSNAPSHOT " >> config.h ; \
	$(ECHO) \"$(DEFSNAPSHOT)\" | tr 'O' '\044' >> 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
###############################
# you must be in a subdirectory of $(VMDDIR) (like src)
# make the basic dir structure, if needed
# copy the docs
# copy the main vmd binaries
# copy the other binaries
# copy the scripts and mdcomm subdirectories using a tar
# copy the default .vmdrc and .vmd_init
# copy the vmd startup script
install:
	if [ ! -d $(INSTALLLIBDIR) ]; then \
		$(MAKEDIR) $(INSTALLLIBDIR); \
	fi ; \
	if [ ! -d $(INSTALLLIBDIR)/doc ]; then \
		$(MAKEDIR) $(INSTALLLIBDIR)/doc; \
	fi
	-$(COPY) $(DOCDIR)/vmd_help.html $(INSTALLLIBDIR)/doc
	-$(COPY) ../$(ARCH)/vmd_$(ARCH) $(INSTALLLIBDIR)
	-$(COPY) $(OTHER_EXE) $(SURFDIR)/$(SURF_EXE) $(INSTALLLIBDIR)
	-$(CD) $(VMDLIBDIR); $(TAR) -cf - scripts mdcomm | \
	 (cd $(INSTALLLIBDIR) ; tar -xf -)
	-$(COPY) ../.vmdrc ../.vmd_init ../.tracker $(INSTALLLIBDIR)
	$(CD) $(BINDIR) ; \
	 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) Make sure $(INSTALLBINDIR)/$(INSTALLNAME) is in your path.
	$(ECHO) "VMD installation complete.  Enjoy!"


	

### 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)

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


#### This has been replaced by a perl script.  We figure if you
## want to make a distribution of your own code you should be able
## to install perl for your system.
dist distribution distrib:
	$(ECHO) "This call is now obsolete.  Use 'make_distrib' instead.";


###############################
### 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)

