# Makefile.in --
#
#	This file is a Makefile for Sample TEA Extension.  If it has the name
#	"Makefile.in" then it is a template for a Makefile;  to generate the
#	actual Makefile, run "./configure", which is a configuration script
#	generated by the "autoconf" program (constructs like "@foo@" will get
#	replaced in the actual Makefile.
#
# Copyright (c) 1999 Scriptics Corporation.
# Copyright (c) 2002-2005 ActiveState Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: Makefile.in,v 1.7 2006/01/06 00:09:00 gregcouch Exp $

#========================================================================
# Add additional lines to handle any additional AC_SUBST cases that
# have been added in a customized configure script.
#========================================================================

#SAMPLE_NEW_VAR	= @SAMPLE_NEW_VAR@
SHLIB_SUFFIX	= .so
MATH_LIBS	= -lieee -lm
LIBGLU		= -lGLU

DEMO_SRCS	= double.c gears.c index.c overlay.c stereo.c texture.c
DEMO_OBJS	= $(DEMO_SRCS:.c=.$(OBJEXT))
DEMO_SHLIBS	= $(DEMO_SRCS:.c=$(SHLIB_SUFFIX))

#========================================================================
# Nothing of the variables below this line should need to be changed.
# Please check the TARGETS section below to make sure the make targets
# are correct.
#========================================================================



#========================================================================
# "PKG_LIB_FILE" refers to the library (dynamic or static as per
# configuration options) composed of the named objects.
#========================================================================

SHELL		= /bin/bash

srcdir		= .

top_builddir	= .

CC		= cc -pipe
CFLAGS_DEFAULT	= -O2 -fomit-frame-pointer
CFLAGS_WARNING	= -Wall -Wno-implicit-int
CLEANFILES	= pkgIndex.tcl so_locations $(DEMO_OBJS) $(DEMO_SHLIBS)
EXEEXT		= 
LDFLAGS_DEFAULT	=  -Wl,--export-dynamic
OBJEXT		= o
RANLIB		= :
RANLIB_STUB	= ranlib
SHLIB_CFLAGS	= -fPIC
SHLIB_LD	= cc -pipe -shared
SHLIB_LD_LIBS	= ${LIBS} -L/usr/lib -ltclstub8.4 -L/usr/lib -ltkstub8.4
STLIB_LD	= ${AR} cr
#TCL_DEFS	= -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DPEEK_XCLOSEIM=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_OPEN64=1 -DHAVE_LSEEK64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 
TCL_BIN_DIR	= /usr/lib/tcl8.4
TCL_SRC_DIR	= /usr/include/tcl8.4/tcl-private
#TK_BIN_DIR	= /usr/lib/tk8.4
#TK_SRC_DIR	= /usr/include/tcl8.4/tk-private

# Not used, but retained for reference of what libs Tcl required
#TCL_LIBS	= ${DL_LIBS} ${LIBS} ${MATH_LIBS}

#========================================================================
# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
# package without installing.  The other environment variables allow us
# to test against an uninstalled Tcl.  Add special env vars that you
# require for testing here (like TCLX_LIBRARY).
#========================================================================

#EXTRA_PATH	= $(top_builddir):$(TCL_BIN_DIR)
EXTRA_PATH	= $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR)
TCLLIBPATH	= $(top_builddir)
TCLSH_ENV	= TCL_LIBRARY=`echo $(TCL_SRC_DIR)/library` \
		  LD_LIBRARY_PATH="$(EXTRA_PATH):$(LD_LIBRARY_PATH)" \
		  PATH="$(EXTRA_PATH):$(PATH)" \
		  TCLLIBPATH="$(TCLLIBPATH)"
#		  TK_LIBRARY=`echo $(TK_SRC_DIR)/library`

TCLSH_PROG	= /usr/bin/tclsh8.4
TCLSH	= $(TCLSH_ENV) $(TCLSH_PROG)

WISH_PROG	= /usr/bin/wish8.4
WISH	= $(TCLSH_ENV) $(WISH_PROG)


SHARED_BUILD	= 1

#INCLUDES	=  -I"/usr/include/tcl8.4"
INCLUDES	=  -I"/usr/include/tcl8.4" \
                   -I"/usr/include/tcl8.4/tk-private/generic" \
		   -I"/usr/include/tcl8.4/tk-private/unix"

PKG_CFLAGS	=  

# TCL_DEFS is not strictly need here, but if you remove it, then you
# must make sure that configure.in checks for the necessary components
# that your library may use.  TCL_DEFS can actually be a problem if
# you do not compile with a similar machine setup as the Tcl core was
# compiled with.
#DEFS		= $(TCL_DEFS) -DPACKAGE_NAME=\"Togl\" -DPACKAGE_TARNAME=\"togl\" -DPACKAGE_VERSION=\"1.7\" -DPACKAGE_STRING=\"Togl\ 1.7\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1  $(PKG_CFLAGS)
DEFS		= -DPACKAGE_NAME=\"Togl\" -DPACKAGE_TARNAME=\"togl\" -DPACKAGE_VERSION=\"1.7\" -DPACKAGE_STRING=\"Togl\ 1.7\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DTCL_THREADS=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1  $(PKG_CFLAGS)

CONFIG_CLEAN_FILES = Makefile

CPPFLAGS	= 
LIBS		=  -lX11 -lGL -lXmu 
AR		= ar
CFLAGS		= -g -O2 -g -Wall -O2 ${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}
COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)

#========================================================================
# Start of user-definable TARGETS section
#========================================================================

#========================================================================
# TEA TARGETS.  Please note that the "libraries:" target refers to platform
# independent files, and the "binaries:" target inclues executable programs and
# platform-dependent libraries.  Modify these targets so that they install
# the various pieces of your package.  The make and install rules
# for the BINARIES that you specified above have already been done.
#========================================================================

all: demos

#========================================================================
# Demo section.  These are binaries because we don't want to install them.
# And they're not tests because we currently have no automatic way to see
# if they work.
#========================================================================

demos: $(DEMO_SHLIBS)

double$(SHLIB_SUFFIX): double.$(OBJEXT)
	$(SHLIB_LD) -o $@ double.$(OBJEXT) -lTogl $(SHLIB_LD_LIBS)

gears$(SHLIB_SUFFIX): gears.$(OBJEXT)
	$(SHLIB_LD) -o $@ gears.$(OBJEXT) -lTogl $(SHLIB_LD_LIBS) $(MATH_LIBS)

index$(SHLIB_SUFFIX): index.$(OBJEXT)
	$(SHLIB_LD) -o $@ index.$(OBJEXT) -lTogl $(SHLIB_LD_LIBS)

overlay$(SHLIB_SUFFIX): overlay.$(OBJEXT)
	$(SHLIB_LD) -o $@ overlay.$(OBJEXT) -lTogl $(SHLIB_LD_LIBS)

stereo$(SHLIB_SUFFIX): stereo.$(OBJEXT)
	$(SHLIB_LD) -o $@ stereo.$(OBJEXT) -lTogl $(SHLIB_LD_LIBS)

texture$(SHLIB_SUFFIX): texture.$(OBJEXT) image.$(OBJEXT)
	$(SHLIB_LD) -o $@ texture.$(OBJEXT) image.$(OBJEXT) \
	-lTogl $(LIBGLU) $(SHLIB_LD_LIBS)


#========================================================================
# We need to enumerate the list of .c to .o lines here.
#
# In the following lines, $(srcdir) refers to the toplevel directory
# containing your extension.  If your sources are in a subdirectory,
# you will have to modify the paths to reflect this:
#
# sample.$(OBJEXT): $(srcdir)/generic/sample.c
# 	$(COMPILE) -c `echo $(srcdir)/generic/sample.c` -o $@
#
# Setting the VPATH variable to a list of paths will cause the makefile
# to look into these paths when resolving .c to .obj dependencies.
# As necessary, add $(srcdir):$(srcdir)/compat:....
#========================================================================

VPATH = $(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win

.c.o:
	$(COMPILE) -c `echo $<` -o $@


#========================================================================
# Don't modify the file to clean here.  Instead, set the "CLEANFILES"
# variable in configure.in
#========================================================================

clean:  
	-test -z "$(BINARIES)" || rm -f $(BINARIES)
	-rm -f *.$(OBJEXT) core *.core
	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)


.PHONY: all demos clean depend 

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
