#----------------------------------------------------------
# Makefile for vtkFitsReader C++ example
#----------------------------------------------------------
SHELL = /bin/sh
C++ = CC

# directory containing vtk
VTK = /local/vtk2.2

VTK_FITS = .
FITSIO = /local/people/prajlich/fits/cfitsio2.0

INCS = -I$(VTK)/common \
	-I$(VTK)/graphics \
	-I$(VTK)/patented \
	-I$(VTK)/imaging \
        -I$(FITSIO)

FLAGS = -32 -g -DOPENGL -woff 3937 -woff 3920 -woff 3262

LDPATH = -L$(VTK)/common -L$(VTK)/graphics -L$(VTK)/patented -L$(VTK)/imaging \
	-L$(FITSIO)/

LIBS = -lVTKGraphics -lVTKPatented -lVTKCommon -lVTKImaging -lVTKGraphics \
        -lcfitsio -lGL -lXt -lX11 -lm

#----------------------------------------------------------
# make rules 
#----------------------------------------------------------
all: fits

fits: vtkFitsReader.o fits.o
	$(C++) -32 -o fits vtkFitsReader.o fits.o $(LDPATH) $(LIBS)

#----------------------------------------------------------
# generic rules
#----------------------------------------------------------
eclean:
	if [ -f *~ ]; then /bin/mv *~ .ebax; fi

clean: eclean
	if [ -f *.o ]; then /bin/rm *.o; fi
	if [ -f core ]; then /bin/rm core; fi

#----------------------------------------------------------
# suffix rules
#----------------------------------------------------------
.SUFFIXES: .cc .cxx .C .o

.cc.o:
	$(C++) $(FLAGS) $(INCS) -c $<

.cxx.o:
	$(C++) $(FLAGS) $(INCS) -c $<

.C.o:
	$(C++) $(FLAGS) $(INCS) -c $<
