#----------------------------------------------------------------------
#
# Modify the following defines as necessary
#

#
#  Compiler defines:
#
#  CC 		which compiler to use. By default, use gcc. 
#		You may also try 'CC = cc' to use your regular 
#		Unix C compiler.
#
#  CFLAGS	what compiler options to enable. By default, generate
#		optimized code ('CFLAGS = -C'). You might want to turn on
#		debugging by specifying 'CFLAGS = -g'. Also, some
#		compiler/system combinations may require additional 
#		settings like '-ansi' or '-DBSD'. 
#

CC = gcc
CFLAGS = -O

#
#  OpenGL libraries and include files:
#
#  OGLLIBDIR	where the OpenGL library files reside. Make expects to find
#		either libGL.* and libGLU.* in this directory or, if you are
#   	        compiling with Mesa, libMesaGL.* and libMesaGLU.*.
#  OGLINCDIR	where the OpenGL include files reside. Make expects to find
#		files GL/gl.h, GL/glu.h and GL/glx.h in this directory.
#  OGLLIBS	which OpenGL libraries to use when linking. By default,
#		'OGLLIBS = -lGLU -lGL'. If you are using Mesa, replace
#		that line with 'OGLLIBS = -lMesaGLU -lMesaGL'
#

OGLLIBDIR = /usr/lib
OGLINCDIR = /usr/include
OGLLIBS = -lGLU -lGL

#
#  Tcl/Tk libraries and include files:
#
#  TCLTKLIBDIR 	where the Tcl and Tk library files reside. Make expects to
#		find libtcl.* and libtk.* in this directory.
#  TCLTKINCDIR	where the Tcl and Tk include files reside. Make expects to 
#		find files tcl.h and tk.h in this directory.
#  TCLTKLIBS	which tcl/tk libraries to use. By default Tcl v7.5 and Tk 
#		v 4.1 are used, and so this line usually reads
#		'TCLTKLIBS = -ltk4.1 -ltcl7.5'. If you are trying to
# 		use newer versions of tcl/tk, update the version numbers
#		accordingly.
#

TCLTKLIBDIR = /usr/local/lib
TCLTKINCDIR = /usr/local/include
TCLTKLIBS = -ltk4.1 -ltcl7.5

#
#  X libraries and include files:
#
#  XLIBDIR 	where X libraries such as libX.* libXext.* etc. are
#	        to be found. 
#  XINCDIR	where X include files such as X11/Xlib.h and X11/X.h 
#		are to be found.
#  XLIBS 	which X libraries to link in. 
#

XLIBDIR = /usr/lib
XINCDIR = /usr/include
XLIBS = -lXmu -lX11 -lXext 

#
#  Other libraries
#
#  OTHERLIBS	libraries which do not fit in any of the previous 
#		categories. In general, only the math library (libm.*) is
#		required, but in some systems, mainly those supporting
#		dynamic loading, other libraries may have to be specified.
# 		Also, be warned that using Tcl/Tk in
#		some systems requires that some additional libraries be
#		linked in. For instance, under Solaris, the socket and
#		nsl libraries are also needed and dynamic loading requires
#		a library called dll; thus, this line
#		would read  'OTHERLIBS = -lsocket -lnsl -ldl -lm'
#
#

OTHERLIBS = -lm

#  RANLIB	Some architectures require library files to be processed
#		by a program called ranlib, while some others don't.
#		If your system has a utility called ranlib somewhere,
#		this variable should be set to its path, otherwise
#		define 'RANLIB = true'
#

RANLIB	= ranlib

#
#  End of user modifiable defines. In normal circumstances, the rest of
#  this file should be left as it is.
# 
#----------------------------------------------------------------------

LIBS =  -L$(OGLLIBDIR) -L$(TCLTKLIBDIR) -L$(XLIBDIR) 

INCS = -I$(OGLINCDIR) -I$(TCLTKINCDIR) -I$(XINCDIR) 

glwish: tkogl.a 
	$(CC) $(CFLAGS) $(LIBS) -o glwish tkogl.a \
	$(OGLLIBS) $(TCLTKLIBS) $(XLIBS) $(OTHERLIBS)

tkogl.a: tkogl.o tkoglparse.o load3ds.o gencyl.o tkAppInit.o tess.o quadric.o\
	 nurbs.o get.o printstr.o feedback.o strokefont.o
	ar r tkogl.a tkogl.o tkoglparse.o load3ds.o gencyl.o tkAppInit.o \
	tess.o quadric.o nurbs.o get.o printstr.o feedback.o strokefont.o
	$(RANLIB) tkogl.a

.c.o: 
	$(CC) $(CFLAGS) $(INCS) -c $<

clean:	
	rm -rf *.o *.a glwish
