#
# vtk library makefile
#

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

SHELL = /bin/sh
.SUFFIXES: .cxx

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 =  \
	${USE_CONTRIB_LIBS}	\
	${USE_PATENTED_LIBS}	\
	${USE_IMAGING_LIBS}	\
	${USE_GRAPHICS_LIBS}	\
        -L../common -lVTKCommonTcl \
	${XLIBS} ${GRAPHICS_API_LIBS} \
	${TK_LIB} ${TCL_LIB} ${DL_LIBS} \
	${THREAD_LIBS}


CXX_FLAGS = ${USER_CXXFLAGS} ${CPPFLAGS} ${CXXFLAGS} -I${srcdir} \
	-I${srcdir}/../common ${TK_INCLUDE} ${TCL_INCLUDE} \
	@USE_TKWIDGET_FLAG@ ${GRAPHICS_API_FLAGS} \
	${USE_TOOLKIT_FLAGS}

C_FLAGS = ${USER_CFLAGS} ${CPPFLAGS} ${CFLAGS} -I${srcdir} \
	${TK_INCLUDE} ${TCL_INCLUDE} @USE_TKWIDGET_FLAG@ \
	${GRAPHICS_API_FLAGS} ${USE_TOOLKIT_FLAGS}

all: 

tkAppInit.o: tkAppInit.c Makefile
	$(CC) $(C_FLAGS) -c -o tkAppInit.o $(srcdir)/tkAppInit.c

vtktcl.o: vtktcl.c Makefile
	$(CC) $(C_FLAGS) -c -o vtktcl.o $(srcdir)/vtktcl.c

#------------------------------------------------------------------------------
# build the vtk executable
#
vtk: 	Makefile tkAppInit.o ${TOOLKIT_DEPENDS} 
	$(CXX) -o vtk tkAppInit.o \
	-L. ${CXX_FLAGS} ${VTK_SHLIB_LINK_FLAGS} ${XLDFLAGS} ${LDLIBS} \
	${XLIBS} -lXext ${X_PRE_LIBS} -lX11 ${X_EXTRA_LIBS} -lm

vtktcl: Makefile vtktcl.o ${TOOLKIT_DEPENDS}
	${CXX} -o vtktcl vtktcl.o \
	-L. ${CXX_FLAGS} ${VTK_SHLIB_BUILD_FLAGS} ${XLDFLAGS} ${LDLIBS} \
	${XLIBS} -lXext ${X_PRE_LIBS} -lX11 ${X_EXTRA_LIBS} -lm


#------------------------------------------------------------------------------
clean: 
	-rm -f vtktcl vtk *.o *.a cpp_parse kit_init Makefile


