#
# vtk library makefile
#

#
# Makefile for Visualization Toolkit sources. 
# 
#------------------------------------------------------------------------------
#

SHELL = /bin/sh
.SUFFIXES: .cxx .java


srcdir        = @srcdir@
VPATH         = @srcdir@

#------------------------------------------------------------------------------
# Autoconfig defines that can be overridden in user.make

@MAKEINCLUDE@ @MAKEQUOTE@../system.make@MAKEQUOTE@

#------------------------------------------------------------------------------
# Include user-editable defines.

@MAKEINCLUDE@ @MAKEQUOTE@../user.make@MAKEQUOTE@

#------------------------------------------------------------------------------
LDLIBS = -L../common \
        ${USE_CONTRIB_JAVA}	\
        ${USE_PATENTED_JAVA}		\
	${USE_IMAGING_JAVA}	\
	${USE_GRAPHICS_JAVA}	\
        -lVTKCommonJava \
        ${XLIBS} ${GRAPHICS_API_LIBS} ${DL_LIBS} ${THREAD_LIBS}

C_FLAGS = ${CPPFLAGS} ${XCFLAGS} ${CFLAGS} -I${srcdir} 

all:  vtk

#------------------------------------------------------------------------------
# build the vtk java library
#
vtk: libvtkJava$(SHLIB_SUFFIX)

# special hack for sgi compilers, uncomment out the following target 
# and comment out the normal one
#libvtkJava$(SHLIB_SUFFIX): 
#	touch empty.c; $(CXX) $(CXX_FLAGS) $(USER_CXXFLAGS)
#	${VTK_SHLIB_BUILD_FLAGS} -c -o empty.o empty.c
#	$(CXX) ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} empty.o \
#	-o libvtkJava$(SHLIB_SUFFIX) -L. ${XLDFLAGS} ${LDLIBS} \
#	${XLIBS} -lXext ${X_PRE_LIBS} -lX11 ${X_EXTRA_LIBS} ${JAVA_CXX_LIB}
#	rm -f empty.c empty.o

libvtkJava$(SHLIB_SUFFIX): 
	$(CXX) ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} \
	-o libvtkJava$(SHLIB_SUFFIX) -L. ${XLDFLAGS} ${LDLIBS} \
	${XLIBS} -lXext ${X_PRE_LIBS} -lX11 ${X_EXTRA_LIBS} ${JAVA_CXX_LIB}

#------------------------------------------------------------------------------
clean: 
	-rm -f *.o *.a Makefile


