
GFX_OGLX11_OBJS= mav_gfxOpenGL.o mav_gfxWMOpenGLX11.o
GFX_OGLGTK_OBJS= mav_gfxOpenGL.o mav_gfxWMOpenGLGTK.o
GFX_IGLX11_OBJS= mav_gfxIrisGL.o mav_gfxWMIrisGLX11.o
GFX_NONE_OBJS= mav_gfxNone.o mav_gfxWMNone.o

all:	../../lib/libmav_gfxOpenGLX11${OPT_EXT}.so ${GTKLIB} ${IRISGLLIB} ../../lib/libmav_gfxNone${OPT_EXT}.so

../../lib/libmav_gfxOpenGLX11${OPT_EXT}.so: ${GFX_OGLX11_OBJS}
	${LD} -o libmav_gfx${OPT_EXT}.so ${GFX_OGLX11_OBJS} ${OPENGLLIBS}
	cd ../../lib; \
	mv ../src/gfx/libmav_gfx${OPT_EXT}.so libmav_gfxOpenGLX11${OPT_EXT}.so; \
	rm -f libmav_gfx${OPT_EXT}.so; \
	ln -s libmav_gfxOpenGLX11${OPT_EXT}.so libmav_gfx${OPT_EXT}.so

../../lib/libmav_gfxOpenGLGTK${OPT_EXT}.so: ${GFX_OGLGTK_OBJS}
	${LD} -o libmav_gfx${OPT_EXT}.so ${GFX_OGLGTK_OBJS} ${GTKLIBS} ${OPENGLLIBS} 
	cd ../../lib; \
	mv ../src/gfx/libmav_gfx${OPT_EXT}.so libmav_gfxOpenGLGTK${OPT_EXT}.so; \
	rm -f libmav_gfx${OPT_EXT}.so; \
	ln -s libmav_gfxOpenGLGTK${OPT_EXT}.so libmav_gfx${OPT_EXT}.so

../../lib/libmav_gfxIrisGLX11${OPT_EXT}.so: ${GFX_IGLX11_OBJS}
	${LD} -o libmav_gfx${OPT_EXT}.so ${GFX_IGLX11_OBJS} ${IRISGLLIBS} 
	cd ../../lib; \
	mv ../src/gfx/libmav_gfx${OPT_EXT}.so libmav_gfxIrisGLX11${OPT_EXT}.so; \
	rm -f libmav_gfx${OPT_EXT}.so; \
	ln -s libmav_gfxIrisGLX11${OPT_EXT}.so libmav_gfx${OPT_EXT}.so

../../lib/libmav_gfxNone${OPT_EXT}.so: ${GFX_NONE_OBJS}
	${LD} -o libmav_gfx${OPT_EXT}.so ${GFX_NONE_OBJS} ${NONEGFXLIBS}
	mv libmav_gfx${OPT_EXT}.so ../../lib/libmav_gfxNone${OPT_EXT}.so



mav_gfxOpenGL.o:	mav_gfxOpenGL.c
	${CC} -I../../incl ${OPENGLINCL} ${CFLAG} -c mav_gfxOpenGL.c
mav_gfxIrisGL.o:	mav_gfxIrisGL.c
	${CC} -I../../incl ${IRISGLINCL} ${CFLAG} -c mav_gfxIrisGL.c
mav_gfxNone.o:		mav_gfxNone.c
	${CC} -I../../incl ${CFLAG} -c mav_gfxNone.c
mav_gfxWMOpenGLX11.o:	mav_gfxWMOpenGLX11.c
	${CC} -I../../incl ${OPENGLINCL} ${CFLAG} -c mav_gfxWMOpenGLX11.c
mav_gfxWMOpenGLGTK.o:	mav_gfxWMOpenGLGTK.c
	${CC} -I../../incl ${GTKINCL} ${OPENGLINCL} ${CFLAG} -c mav_gfxWMOpenGLGTK.c
mav_gfxWMIrisGLX11.o:	mav_gfxWMIrisGLX11.c
	${CC} -I../../incl ${IRISGLINCL} ${CFLAG} -c mav_gfxWMIrisGLX11.c
mav_gfxWMNone.o:	mav_gfxWMNone.c
	${CC} -I../../incl ${CFLAG} -c mav_gfxWMNone.c



clean:
	rm -f ${GFX_OGLX11_OBJS}
	rm -f ${GFX_OGLGTK_OBJS}
	rm -f ${GFX_IGLX11_OBJS}
	rm -f ${GFX_NONE_OBJS}
