# 
# This Makefile was created by the configure script using
# the files config/MakeDefs.linux and lib/Makefile.in 
# 
# linux with dynamic libraries 

# these next values for compilers will be used unless overridden with an argument to configure
cc = gcc
CC = g++
FC = gfortran

# On some 64-bit machines some libraries are in lib64 instead of lib
# this next line will be changed by the configure script
LIB64 = lib64

# Here is the rpath command
OV_RPATH = -Wl,-rpath,
#xlc OV_RPATH = -R

MOTIF_LIB = $(MOTIF)/$(LIB64)
OPENGL_LIB = $(OpenGL)/$(LIB64)

XLIBS_LIB = $(XLIBS)/$(LIB64)
OV_X_LIBRARIES = -L$(XLIBS_LIB) -lXpm -lXp -lXt -lXmu -lXi -lXext -lX11
OV_MOTIF_LIBRARIES = $(OV_RPATH)$(MOTIF_LIB) -L$(MOTIF_LIB) -lXm

# these next lines will be changed by the configure script
USE_DOUBLE_OR_SINGLE = -DOV_USE_DOUBLE
#xlc USE_DOUBLE_OR_SINGLE = -WF,-DOV_USE_DOUBLE

A++ = $(APlusPlus)
A+++ = $(APlusPlus)
# AppLibraries = -L$(APlusPlus) -lA++ -lA++_static
AppLibraries = $(OV_RPATH)$(APlusPlus)/lib -L$(APlusPlus)/lib -lApp -lApp_static 

Include=  -I$(Overture)/include -I. 
Lib=      $(Overture)/lib
LibOverture= -lOverture -lOverture_static
# Make 2 dynamic libs for ibm: 
#xlc LibOverture= -lOverture1 -lOverture2 -lOverture_static
LibRapsodi= -lRapsodi -lRapsodi_static 
BOXLIB_DEFS = -DBL_USE_DOUBLE -DBL_Solaris

# Here is where we can find the perl include files and library (CORE)
# These will normally be changed by the configure script unless it can't find the location of the perl CORE 
OV_PERL_INCLUDE = /usr/lib64/perl5/CORE
OV_PERL_LIB = /usr/lib64/perl5/CORE
#kkc 060111 here is an attempt to automatically setup the perl stuff
PERLSYSS := $(shell perl -V:archname)
PERL_SYS := $(shell $(PERLSYSS) echo $${archname} )
PERLDIRS := $(shell perl -V:prefix)
PERL_DIR := $(shell $(PERLDIRS) echo $${prefix} )
PERLVERS := $(shell perl -V:version)
PERL_VER := $(shell $(PERLVERS) echo $${version} )
OV_PERL_INCLUDE = /usr/lib64/perl5/CORE
OV_PERL_LIB = /usr/lib64/perl5/CORE
# Here are the perl libraries we need to link to (NOTE: this next line is set by the configure script)
OV_PERL_LIBRARIES = $(OV_RPATH)$(OV_PERL_LIB) -L$(OV_PERL_LIB) -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
# old OV_PERL_LIBRARIES = $(OV_RPATH)$(OV_PERL_LIB) -L$(OV_PERL_LIB) -lperl -lcrypt

# these next flags are compiler dependent
# *** WARNING *** these next lines are changed by the configure script
cc_FLAGS = -fPIC
CC_FLAGS = -fPIC
FF_FLAGS = -fPIC
# turn off warnings from intel f95 compiler
#ifc FF_FLAGS = -fPIC -w

# these next values will may be changed by the configure script
C_OPTIMIZATION_FLAG = -O
CPP_OPTIMIZATION_FLAG = -O
FORTRAN_OPTIMIZATION_FLAG = -g

# Use this next flag to optimize files that Bill likes to by default compile optimized
STD_OPT_FLAG = -O 

CFLAGS =  $(cc_FLAGS)  $(Include)  $(C_OPTIMIZATION_FLAG) -I$(XLIBS) -DSHM
# flags for c routines we always optimize (except if debug is on)
CFLAGSO =  $(STD_OPT_FLAG) $(cc_FLAGS)  $(Include)  -I$(XLIBS) -DSHM

# do not include some paths, such as STL in the places searched by makedepend (takes too long)
# *wdh* temporarily add -Wno-deprecated -- fix these later
# ** CC_INCLUDES_FOR_DEPEND =  $(Include)  -DUSE_MESA -I$(APlusPlus)/include -I$(OpenGL)/include -I$(XLIBS)/include  $(BOXLIB_DEFS) -Wno-deprecated -I$(OV_PERL_INCLUDE)
CC_INCLUDES_FOR_DEPEND =  $(Include)  -DUSE_MESA -I$(APlusPlus)/include -I$(OpenGL)/include -I$(XLIBS)/include  $(BOXLIB_DEFS) -I$(OV_PERL_INCLUDE)

STL_INCLUDE = 
#  HAS_MODFL_PROTO is for a perl compile error of OvertureParser.C for gcc 3.4.3
# CC_INCLUDES = $(CC_FLAGS) $(CC_INCLUDES_FOR_DEPEND) $(STL_INCLUDE) -DHAS_MODFL_PROTO
# CC_FLAGS = -fPIC
# wdh 081212 -- remove HAS_MODFL_PROTO since it fails with xlc
CC_INCLUDES = $(CC_FLAGS) $(CC_INCLUDES_FOR_DEPEND) $(STL_INCLUDE) 
CC_FLAGS = -fPIC

CCFLAGS= $(CC_INCLUDES) $(CPP_OPTIMIZATION_FLAG)

# things that are always compiled with optimization use this flag (except if debug is on)
CCFLAGSO= $(CC_INCLUDES) $(STD_OPT_FLAG)

# things that are always compiled with lots of optimization use this flag (except if debug is on)
CCFLAGSF= $(CC_INCLUDES) $(STD_OPT_FLAG)

# things that need to be compiled with no optimization use the following
CCFLAGSG= $(CC_INCLUDES) -g

# Notes: There seems to be problems using -O with g77
#        Some older versions of the egcs compiler also had trouble with -fPIC, removing it seemed to work.
FFLAGS=    $(FF_FLAGS)   -fdefault-real-8 $(FORTRAN_OPTIMIZATION_FLAG) $(Include)
# single precision always:
FFLAGSS=  $(FF_FLAGS)  $(FORTRAN_OPTIMIZATION_FLAG)  $(Include)
FFLAGSSO = ${FF_FLAGS}  $(Include) $(STD_OPT_FLAG)
FFLAGSO = $(FF_FLAGS)  -fdefault-real-8 $(STD_OPT_FLAG) $(Include)
FFLAGSG = $(FF_FLAGS)  -fdefault-real-8 -g $(Include)
FFLAGSG2 = $(FF_FLAGS)  -fdefault-real-8 -g $(Include)
# The ifort compiler can take for-ever if we use -g so use -O instead
#ifort FFLAGSG = $(FF_FLAGS)  -fdefault-real-8 -O $(Include)

# things that are always compile with optimization use these flags (except if debug is on)
FFLAGSO= $(STD_OPT_FLAG) $(FF_FLAGS)  -fdefault-real-8  $(FLAGS) $(Include) 
FFLAGSSO= $(STD_OPT_FLAG)  $(FF_FLAGS)  $(FLAGS) $(Include)

# Here we add a path to the compiler lib directory (this is sometimes needed so that we find the correct
# version of the compiler libraries if they are different from the the ones in /usr/lib for e.g.)
#OV_COMPILER_LIBS = $(OV_RPATH)$(COMPILER_LIB_DIRECTORY) -L$(COMPILER_LIB_DIRECTORY)

# here are the hdf libraries (the configure script will change this line for use with hdf5)
HDF_LIBS = $(OV_RPATH)$(HDF)/lib -L$(HDF)/lib -lhdf5 -ljpeg -lz 
#xlc HDF_LIBS = $(OV_RPATH)$(HDF)/lib -L$(HDF)/lib -lhdf5 -lz 

FORTRAN_LIBS = 
FORTRAN_LIBS =-lnsl -lg2c
FORTRAN_LIBS =-lgfortran
# This next line will be used with the Portland group compiler (the configure script will set the next line)
# 080623: aio_read etc. are found in /usr/lib/librt.so
PGI_LIB = 
#pgf77 FORTRAN_LIBS = $(OV_RPATH)$(PGI_LIB) -L$(PGI_LIB) -lpgftnrtl -lpgmp  -lpgc -lrt -lstd
# This next line will be used with the intel fortran compiler. (the configure script will set the next line)
# g2c may be needed by lapack (for cg)
IFORT_LIB = 
#ifc FORTRAN_LIBS = $(OV_RPATH)$(IFORT_LIB) -L$(IFORT_LIB) -lF90 -lIEPCF90 -lg2c
# old ifc FORTRAN_LIBS = -Wl,-rpath,/opt/intel/compiler60/ia32/lib -L/opt/intel/compiler60/ia32/lib -lF90 -lIEPCF90 -L/usr/lib/gcc-lib/i386-redhat-linux/2.96 -lg2c
# Here are the libraries for the new intel compiler (called ifort instead of ifc) (use "ifort -dryrun" to see libraries needed)
#ifort FORTRAN_LIBS = $(OV_RPATH)$(IFORT_LIB) -L$(IFORT_LIB) -lifcoremt
# Libraries using xlf and linux
#xlf FORTRAN_LIBS = -L/opt/ibmcmp/xlf/bg/11.1/bglib -lxlopt -lxl -lxlf90 -lxlfmath -L/opt/ibmcmp/xlsmp/bg/1.7/bglib/ -lxlomp_ser
LIB_TARGETS= lib_date libso_date
LIB_DEPENDENCIES= ../lib/lib_date
TEMPLATES=  
RAPTEMPLATES=  

# The KCC compiler should be used to build the static library (for templates)
AR = ar
#KCC AR = KCC
ARFLAGS = ruv  
#KCC ARFLAGS = -o 

LD = $(CC)
LDFLAGS = -L
RANLIB = ranlib
SOFLAGS = -shared
#xlc SOFLAGS = -qmkshrobj -qnostaticlink
# the next line is changed by the configure script
OpenGLibs =-lGL -lGLU -lGLw 
GLIBS=  $(OV_PERL_LIBRARIES) $(OV_RPATH)$(OPENGL_LIB) -L$(OPENGL_LIB) $(OpenGLibs) $(OV_MOTIF_LIBRARIES) $(OV_X_LIBRARIES) -lm

# On Don's machine the pgi libraries need to follow the mpi libraries : 
# FLIBS= $(OV_RPATH)$(Overture)/lib $(LDFLAGS)$(Overture)/lib $(LibOverture) $(HDF_LIBS) $(FORTRAN_LIBS) $(AppLibraries) 
FLIBS= $(OV_RPATH)$(Overture)/lib $(LDFLAGS)$(Overture)/lib $(LibOverture) $(OV_COMPILER_LIBS) $(HDF_LIBS) $(AppLibraries) $(FORTRAN_LIBS)


OGMGLIB = $(OV_RPATH)$(Overture)/lib $(LDFLAGS)$(Overture)/lib -lOgmg#
#


GridFunction= ../GridFunction
GridGenerator=../GridGenerator
boxlib=       ../boxlib
Mapping=      ../Mapping
templates=    ../templates
Oges=         ../Oges
Ogshow=       ../Ogshow
DataBase=     ../DataBase
Grid=         ../Grid
FVO=          ../FiniteVolumeOperators
otherStuff=   ../otherStuff
mapUtil=      ../mapUtil
phoneyFiles=  ../phoneyFiles
Ogmg=         ../Ogmg

.SUFFIXES:
.SUFFIXES:.C .o
.C.o:; $(CC) $(CCFLAGS) -c $*.C

 LIB_TARGETS := $(LIB_TARGETS) libOgmg_date

# wdh 100124 -- do not build libRapsodi anymore, just use libOverture 
default:    $(LIB_TARGETS) 
# default:    $(LIB_TARGETS) libRapsodi_date libRapsodiso_date
rapsodi: libRapsodi_date libRapsodiso_date


# Here is the static library
lib_date: ../static/static_date $(boxlib)/boxlib_date $(GridGenerator)/GridGenerator_date
	  $(AR) $(ARFLAGS) libOverture_static.a ../static/*.o $(boxlib)/*.o $(TEMPLATES)
	  $(RANLIB) libOverture_static.a
	  touch $@

DYNAMIC_LIBRARY = libOverture.so
RAP_DYNAMIC_LIBRARY = libRapsodi.so
#hpux DYNAMIC_LIBRARY = libOverture.sl
#darwin DYNAMIC_LIBRARY = libOverture.dylib
#darwin RAP_DYNAMIC_LIBRARY = libRapsodi.dylib

# On Darwin we need to rebuild the dynamic library if the static lib is rebuilt since files in the static lib
# are embedded in the dynamic lib apparently
SO_LIB_DEPENDENCIES = 
#darwin SO_LIB_DEPENDENCIES = lib_date

# Here is the dynamic library
libso_date: $(SO_LIB_DEPENDENCIES) $(DataBase)/DataBase_date \
          $(GridFunction)/GridFunction_date           \
          $(Mapping)/Mapping_date             \
          $(Oges)/Oges_date                   \
          $(Grid)/Grid_date           \
          $(GridGenerator)/GridGenerator_date \
          $(Ogshow)/Ogshow_date  \
	  $(otherStuff)/otherStuff_date \
          $(templates)/ListClasses_date \
	  $(mapUtil)/mapUtil_date
	  $(LD) -o $(DYNAMIC_LIBRARY) $(SOFLAGS) $(DataBase)/*.o $(GridFunction)/*.o $(templates)/*.o \
             $(Grid)/*.o $(Mapping)/*.o $(Oges)/*.o  $(GridGenerator)/*.o $(Ogshow)/*.o $(mapUtil)/*.o \
	     $(otherStuff)/*.o $(LIBLIBS)
	  rm -rf libOverture.so.1.0
	  ln -s $(DYNAMIC_LIBRARY) libOverture.so.1.0
	  touch $@

# Build two libraries for ibm, one lib is too large(?)
#xlc libso_date: libso1_date libso2_date; touch $@

DYNAMIC_LIBRARY1 = libOverture1.so
libso1_date: $(DataBase)/DataBase_date \
          $(GridFunction)/GridFunction_date           \
          $(Mapping)/Mapping_date             \
          $(Oges)/Oges_date                   \
          $(Grid)/Grid_date           \
          $(GridGenerator)/GridGenerator_date \
          $(Ogshow)/Ogshow_date  \
	  $(otherStuff)/otherStuff_date \
          $(templates)/ListClasses_date \
	  $(mapUtil)/mapUtil_date
	  $(LD) -o $(DYNAMIC_LIBRARY1) $(SOFLAGS) $(DataBase)/*.o $(GridFunction)/*.o $(templates)/*.o \
             $(Grid)/*.o $(Mapping)/*.o 
	  rm -rf libOverture1.so.1.0
	  ln -s $(DYNAMIC_LIBRARY1) libOverture1.so.1.0
	  touch $@

DYNAMIC_LIBRARY2 = libOverture2.so
libso2_date: $(DataBase)/DataBase_date \
          $(GridFunction)/GridFunction_date           \
          $(Mapping)/Mapping_date             \
          $(Oges)/Oges_date                   \
          $(Grid)/Grid_date           \
          $(GridGenerator)/GridGenerator_date \
          $(Ogshow)/Ogshow_date  \
	  $(otherStuff)/otherStuff_date \
          $(templates)/ListClasses_date \
	  $(mapUtil)/mapUtil_date
	  $(LD) -o $(DYNAMIC_LIBRARY2) $(SOFLAGS) $(Oges)/*.o  $(GridGenerator)/*.o $(Ogshow)/*.o $(mapUtil)/*.o \
	     $(otherStuff)/*.o $(LIBLIBS)
	  rm -rf libOverture2.so.1.0
	  ln -s $(DYNAMIC_LIBRARY2) libOverture2.so.1.0
	  touch $@

# Here is the multigrid library
OGMG_DYNAMIC_LIBRARY = libOgmg.so
#hpux OGMG_DYNAMIC_LIBRARY = libOgmg.sl
#darwin OGMG_DYNAMIC_LIBRARY = libOgmg.dylib
OGMG_EXTRA_LIBS = 
#darwin OGMG_EXTRA_LIBS = $(LDFLAGS)$(Overture)/lib -lOverture -lOverture_static

libOgmg_date: lib_date libso_date $(Ogmg)/Ogmg_date
	  $(LD) -o $(OGMG_DYNAMIC_LIBRARY) $(SOFLAGS) $(Ogmg)/*.o $(LIBLIBS) $(OGMG_EXTRA_LIBS)
	  rm -rf libOgmg.so.1.0
	  ln -s $(OGMG_DYNAMIC_LIBRARY) libOgmg.so.1.0
	  touch $@

# libOgmg_date: $(Ogmg)/Ogmg_date
# 	  $(AR) $(ARFLAGS) libOgmg.a $(Ogmg)/*.o
# 	  $(RANLIB) libOgmg.a
# 	  touch $@


# Here is the dynamic library for P++ (no grid generator or FVO)
libsoPPP_date: $(DataBase)/DataBase_date \
          $(GridFunction)/GridFunction_date           \
          $(Mapping)/Mapping_date             \
          $(Oges)/Oges_date                   \
          $(Grid)/Grid_date           \
          $(Ogshow)/Ogshow_date  \
          $(FVO)/FVO_date           \
	  $(otherStuff)/otherStuff_date \
          $(templates)/ListClasses_date
	  $(LD) -o  $(DYNAMIC_LIBRARY) $(SOFLAGS) $(DataBase)/*.o $(GridFunction)/*.o $(templates)/*.o \
             $(Grid)/*.o $(Mapping)/*.o $(Oges)/*.o  $(GridGenerator)/*.o $(Ogshow)/*.o $(mapUtil)/*.o $(FVO)/*.o \
	     $(otherStuff)/*.o
	  rm -rf libOverture.so.1.0
	  ln -s $(DYNAMIC_LIBRARY) libOverture.so.1.0
	  touch $@

# Here we make a static library instead of the dynamic library
liba_date: ../static/static_date $(boxlib)/boxlib_date \
          $(DataBase)/DataBase_date \
          $(GridFunction)/GridFunction_date           \
          $(Mapping)/Mapping_date             \
          $(Oges)/Oges_date                   \
          $(Grid)/Grid_date           \
          $(GridGenerator)/GridGenerator_date \
          $(Ogshow)/Ogshow_date  \
          $(FVO)/FVO_date           \
	  $(otherStuff)/otherStuff_date \
          $(templates)/ListClasses_date \
          $(Ogmg)/Ogmg_date
	  $(AR) $(ARFLAGS) libOverture.a  ../static/*.o $(boxlib)/*.o $(TEMPLATES) \
             $(DataBase)/*.o $(GridFunction)/*.o $(templates)/*.o \
             $(Grid)/*.o $(Mapping)/*.o $(Oges)/*.o  $(GridGenerator)/*.o \
             $(Ogshow)/*.o $(mapUtil)/*.o $(FVO)/*.o $(otherStuff)/*.o $(Ogmg)/*.o
	  $(RANLIB) libOverture.a
	  touch $@

# Here is the Rapsodi library with it's dependencies.

RapsodiOgshowFiles = $(Ogshow)/render.o $(Ogshow)/osRender.o \
	 $(Ogshow)/GenericGraphicsInterface.o $(Ogshow)/GraphicsParameters.o $(Ogshow)/plotMapping.o \
         $(Ogshow)/GL_GraphicsInterface.o $(Ogshow)/plotCompositeSurface.o \
	 $(Ogshow)/plotUnstructured.o $(Ogshow)/plotStructured.o  \
         $(Ogshow)/GUIState.o $(Ogshow)/getAnswer.o $(Ogshow)/DialogData.o $(Ogshow)/textGetMenu.o \
         $(Ogshow)/colourTable.o $(Ogshow)/label.o \
         $(Ogshow)/plotAxes.o $(Ogshow)/NameList.o $(Ogshow)/stroke.o \
         $(Ogshow)/plotPoints.o $(Ogshow)/ColourBar.o  $(Ogshow)/OvertureParser.o \
         $(Ogshow)/cggi.o $(Ogshow)/isosurf.o $(Ogshow)/ParallelUtility.o $(Ogshow)/CopyArray.o

RapsodiOtherStuffFiles = $(otherStuff)/helpOverture.o $(otherStuff)/floatDisplay.o $(otherStuff)/intDisplay.o \
         $(otherStuff)/doubleDisplay.o $(otherStuff)/floatSerialDisplay.o $(otherStuff)/intSerialDisplay.o \
         $(otherStuff)/doubleSerialDisplay.o $(otherStuff)/DisplayParameters.o $(otherStuff)/TridiagonalSolver.o \
         $(otherStuff)/TridiagonalFactor.o $(otherStuff)/arrayGetIndex.o $(otherStuff)/fortranInputOutput.o \
         $(otherStuff)/prtpeg.o $(otherStuff)/pentaDiagonal.o

# AP: Everything in Mapping besides DataFormatsMG.o
RapsodiMappingFiles = $(Mapping)/AirfoilMapping.o $(Mapping)/NormalMapping.o $(Mapping)/createMappings.o \
         $(Mapping)/AnnulusMapping.o $(Mapping)/NurbsMapping.o $(Mapping)/cs.o $(Mapping)/Bound.o \
         $(Mapping)/OffsetShell.o $(Mapping)/dpm.o $(Mapping)/BoundingBox.o $(Mapping)/OrthographicTransform.o \
         $(Mapping)/dpmInverse.o $(Mapping)/BoxMapping.o $(Mapping)/PlaneMapping.o $(Mapping)/dpmScalar.o \
         $(Mapping)/CircleMapping.o $(Mapping)/QuadTree.o $(Mapping)/ComposeMapping.o \
         $(Mapping)/QuadraticMapping.o $(Mapping)/equi.o $(Mapping)/CompositeSurface.o $(Mapping)/ReductionMapping.o \
         $(Mapping)/generate.o $(Mapping)/CrossSectionMapping.o $(Mapping)/ReferenceCountingList.o \
         $(Mapping)/hyperNull.o $(Mapping)/CylinderMapping.o $(Mapping)/ReparameterizationTransform.o \
         $(Mapping)/ingrid.o $(Mapping)/DataFormats.o $(Mapping)/RestrictionMapping.o \
         $(Mapping)/initializeMappingList.o $(Mapping)/RevolutionMapping.o $(Mapping)/mappingUtil.o \
         $(Mapping)/DataPointMapping.o $(Mapping)/RocketMapping.o $(Mapping)/nurbsEvaluation.o \
         $(Mapping)/DepthMapping.o $(Mapping)/SmoothedPolygonMapping.o $(Mapping)/plot.o \
         $(Mapping)/FilamentMapping.o $(Mapping)/SphereMapping.o $(Mapping)/plyFileInterface.o \
         $(Mapping)/FilletMapping.o $(Mapping)/SplineMapping.o $(Mapping)/plyfile.o $(Mapping)/Fraction.o \
         $(Mapping)/SquareMapping.o $(Mapping)/project.o $(Mapping)/HyperbolicMapping.o $(Mapping)/StretchMapping.o \
         $(Mapping)/r1mach.o $(Mapping)/IgesReader.o $(Mapping)/StretchTransform.o $(Mapping)/r1machc.o \
         $(Mapping)/IntersectionMapping.o $(Mapping)/StretchedSquareMapping.o $(Mapping)/readMappings.o \
         $(Mapping)/Inverse.o $(Mapping)/SweepMapping.o $(Mapping)/sPrintF.o $(Mapping)/JoinMapping.o \
         $(Mapping)/TFIMapping.o $(Mapping)/startCurve.o $(Mapping)/LineMapping.o $(Mapping)/TriangleClass.o \
         $(Mapping)/stencilWalk.o $(Mapping)/Mapping.o $(Mapping)/TrimmedMapping.o $(Mapping)/strtch.o \
         $(Mapping)/MappingBuilder.o $(Mapping)/UnstructuredMapping.o $(Mapping)/tspack.o $(Mapping)/MappingP.o \
         $(Mapping)/UserDefinedMapping1.o $(Mapping)/unstructuredCompositeSurface.o \
         $(Mapping)/MappingProjectionParameters.o $(Mapping)/applyBoundaryConditions.o \
         $(Mapping)/unstructuredProject.o $(Mapping)/MappingRC.o $(Mapping)/cggpoly.o $(Mapping)/update.o \
         $(Mapping)/MatrixMapping.o $(Mapping)/checkMapping.o $(Mapping)/util.o $(Mapping)/MatrixTransform.o \
         $(Mapping)/compositeTopology.o $(Mapping)/viewMappings.o $(Mapping)/PolynomialMapping.o \
         $(Mapping)/FaceInfo.o $(Mapping)/EntityTag.o $(Mapping)/entityConnectivityBuilder.o \
         $(Mapping)/refineTriangulation.o $(Mapping)/refineCurve.o $(Mapping)/stretch.o $(Mapping)/GridSmoother.o \
         $(Mapping)/GridStretcher.o $(Mapping)/MatchingCurve.o $(Mapping)/ellipticSmooth.o \
         $(Mapping)/stretchUpdate.o $(Mapping)/ReorientMapping.o $(Mapping)/ULink.o $(Mapping)/MappingGeometry.o \
	 $(Mapping)/verifyUnstructuredConnectivity.o $(Mapping)/nurbs_eval.o $(Mapping)/DistributedInverse.o \
         $(Mapping)/inverseMap.o $(Mapping)/dpmMap.o $(Mapping)/LoftedSurfaceMapping.o

RapsodiLibraryFiles = $(DataBase)/*.o \
                      $(mapUtil)/*.o  \
                      $(phoneyFiles)/phoneyMappings.o \
                      $(RapsodiMappingFiles) \
                      $(RapsodiOgshowFiles) \
                      $(RapsodiOtherStuffFiles) 

RapsodiStaticFiles= ../static/mogl.o ../static/overlay.o ../static/initOvertureGlobalVariables.o \
             ../static/initStaticMappingVariables.o ../static/xColours.o ../static/ReferenceCounting.o \
             ../static/RapsodiInit.o ../static/memoryUsage.o


RapsodiStaticFilesPlus= $(RapsodiStaticFiles) 

#buildGLw RapsodiStaticFilesPlus= $(RapsodiStaticFiles) ../static/GLwDrawA.o ../static/GLwMDrawA.o

# Here is the static Rapsodi library
libRapsodi_date: ../static/static_date $(boxlib)/boxlib_date 
	  $(AR) $(ARFLAGS) libRapsodi_static.a $(RapsodiStaticFilesPlus) $(boxlib)/*.o $(RAPTEMPLATES)
	  $(RANLIB) libRapsodi_static.a
	  touch $@


# Here is the dynamic Rapsodi library with it's dependencies.
libRapsodiso_date: $(DataBase)/DataBase_date   \
          $(Mapping)/Mapping_date       \
          $(Ogshow)/Ogshow_rapsodi_date
	  $(LD) -o $(RAP_DYNAMIC_LIBRARY) $(SOFLAGS) $(RapsodiLibraryFiles) $(RLIBLIBS)
	  touch $@


.PRECIOUS:lib_date libso_date
