# 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.
#
# 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.15 2001/05/29 15:51:16 andreas_kupries Exp $


#========================================================================
# Edit the following few lines when writing a new extension
#========================================================================

#========================================================================
# Change the name of the variable "exampleA_LIB_FILE" to match the one
# used in the configure script.  This is the parameterized name of the
# library that we are building.
#========================================================================

STUB_LIB_BINARY=$(xotclstub_LIB_FILE)
lib_BINARIES=$(xotcl_LIB_FILE) $(STUB_LIB_BINARY)
BINARIES=$(lib_BINARIES) 

#========================================================================
# Enumerate the names of the source files included in this package.
# This will be used when a dist target is added to the Makefile.
#========================================================================

TOP_DIR=${srcdir}/..

WIN_DIR=$(TOP_DIR)/win
UNIX_DIR=$(TOP_DIR)/unix
PLATFORM_DIR=$(UNIX_DIR)

src_doc_dir = $(TOP_DIR)/doc
src_lib_dir = $(TOP_DIR)/library
src_test_dir = $(TOP_DIR)/tests
src_app_dir = $(TOP_DIR)/apps
src_man_dir = $(TOP_DIR)/man
src_config_dir = $(TOP_DIR)/config
src_generic_dir = $(TOP_DIR)/generic

WIN_SOURCES=$(PLATFORM_DIR)/dllEntryPoint.c
UNIX_SOURCES=

GENERIC_SOURCES_NO_STUBS = \
	$(src_generic_dir)/xotcl.c \
	$(src_generic_dir)/xotclError.c \
	$(src_generic_dir)/xotclMetaData.c \
	$(src_generic_dir)/xotclObjectData.c \
	$(src_generic_dir)/xotclProfile.c \
	$(src_generic_dir)/xotclTrace.c \
	$(src_generic_dir)/xotclUtil.c \
	$(src_generic_dir)/xotclShadow.c \
	$(src_generic_dir)/xotclCompile.c \
	$(src_generic_dir)/aolstub.c
STUB_SOURCES = $(src_generic_dir)/xotclStubInit.c \
	$(src_generic_dir)/xotclStubLib.c
GENERIC_SOURCES = $(STUB_SOURCES)

PLATFORM_SOURCES = $(UNIX_SOURCES)
SOURCES = $(PLATFORM_SOURCES) $(GENERIC_SOURCES)

#========================================================================
# Enumerate the names of the object files included in this package.
# These objects are created and linked into the final library.  In
# most cases these object files will correspond to the source files
# above.
#
#========================================================================

WIN_OBJECTS = dllEntryPoint.$(OBJEXT)
UNIX_OBJECTS =

STUB_OBJECTS = so/xotclStubInit.$(OBJEXT)
CONDITIONAL_STUB_OBJECTS = $(STUB_OBJECTS)
GENERIC_OBJECTS_NO_STUBS = \
	so/xotcl.$(OBJEXT) \
	so/xotclError.$(OBJEXT) \
	so/xotclMetaData.$(OBJEXT) \
	so/xotclObjectData.$(OBJEXT) \
	so/xotclProfile.$(OBJEXT) \
	so/xotclTrace.$(OBJEXT) \
	so/xotclUtil.$(OBJEXT) \
	so/xotclShadow.$(OBJEXT) \
	so/xotclCompile.$(OBJEXT) \
	so/aolstub.$(OBJEXT)
GENERIC_OBJECTS_NOT_SHARED = \
	o/xotcl.$(OBJEXT) \
	o/xotclError.$(OBJEXT) \
	o/xotclMetaData.$(OBJEXT) \
	o/xotclObjectData.$(OBJEXT) \
	o/xotclProfile.$(OBJEXT) \
	o/xotclTrace.$(OBJEXT) \
	o/xotclUtil.$(OBJEXT) \
	o/xotclShadow.$(OBJEXT) \
	o/xotclCompile.$(OBJEXT) \
	o/aolstub.$(OBJEXT)
GENERIC_OBJECTS = $(GENERIC_OBJECTS_NO_STUBS) $(STUB_OBJECTS)

PLATFORM_OBJECTS = $(UNIX_OBJECTS)
xotclstub_OBJECTS = so/xotclStubLib.$(OBJEXT)
xotcl_OBJECTS = $(PLATFORM_OBJECTS) $(GENERIC_OBJECTS) $(STORE_OBJECTS)
OBJECTS = $(xotcl_OBJECTS) $(xotclstub_OBJECTS)

XOTCL_DECLS = $(src_generic_dir)/xotcl.decls $(src_generic_dir)/xotclInt.decls
libdirs = comm lib COPYRIGHT pkgIndex.tcl serialize actiweb rdf registry store xml patterns
appdirs = comm COPYRIGHT scripts utils actiweb persistence

DOC_SOURCE = \
	$(src_doc_dir)/langRef.xotcl \
	$(src_lib_dir)/lib/*.xotcl \
	$(src_lib_dir)/store/*.xotcl \
	$(src_lib_dir)/serialize/Serializer.xotcl \
	$(src_test_dir)/*.xotcl \
	$(src_app_dir)/scripts/*.xotcl \
	$(src_app_dir)/comm/[flsw]*.xotcl \
	$(src_app_dir)/actiweb/univ/UNIVERSAL.xotcl \
	$(src_app_dir)/utils/xo-*[a-z0-9] 

#========================================================================
# The substitution of "exampleA_LIB_FILE" into the variable name below
# let's us refer to the objects for the library without knowing the name
# of the library in advance.  It also lets us use the "$@" variable in
# the rule for building the library, so we can refer to both the list of 
# objects and the library itself in a platform-independent manner.
#========================================================================

xotcl_LIB_FILE = libxotcl1.2.so
libxotcl1.2.so_OBJECTS = $(xotcl_OBJECTS)

xotclstub_LIB_FILE = libxotclstub1.2.a
libxotclstub1.2.a_OBJECTS = $(xotclstub_OBJECTS)

#======================================================================
# This is a list of header files to be installed
#========================================================================

GENERIC_HDRS= \
	$(TOP_DIR)/generic/xotcl.h \
	$(TOP_DIR)/generic/xotclDecls.h \
	$(TOP_DIR)/generic/xotclInt.h \
	$(TOP_DIR)/generic/xotclAccessInt.h \
	$(TOP_DIR)/generic/xotclIntDecls.h

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

XOTCL_GENERIC_DIR_NATIVE = ./../generic
XOTCL_UNIX_DIR_NATIVE = ./../unix
XOTCL_WIN_DIR_NATIVE = ./../win

#export TCLLIBPATH=$(TOP_DIR)/unix $(TOP_DIR)/library
export TCLLIBPATH=..

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

SHELL = /bin/sh

srcdir = .
top_srcdir = .
prefix = /usr
exec_prefix = /usr

bindir = ${exec_prefix}/bin
libdir = ${exec_prefix}/lib
mandir = ${prefix}/man
includedir = ${prefix}/include
pkglibdir = $(libdir)/xotcl1.2
top_builddir = .

subdirs =  ../library/store/XOTclSdbm/ ../library/store/XOTclGdbm/ ../library/xml/TclExpat-1.1/
DESTDIR =

INSTALL = $(TCLSH_PROG) `echo $(src_config_dir)/installFile.tcl` -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
transform = s,x,x,

NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :

PACKAGE = xotcl
VERSION = 1.2
PATCHLEVEL = .0
FULLVERSION= 1.2.0
CC = cc
CFLAGS_DEBUG = -g
CFLAGS_DEFAULT = -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES
CFLAGS_OPTIMIZE = -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES
CFLAGS_WARNING =
CLEANFILES = *.o *.so *~ core gmon.out config.*
EXEEXT = 
LDFLAGS_DEBUG = 
LDFLAGS_DEFAULT = 
LDFLAGS_OPTIMIZE = 
MAKE_LIB = ${SHLIB_LD} -o $@ $($@_OBJECTS) ${SHLIB_LDFLAGS} ${SHLIB_LD_LIBS}
MAKE_SHARED_LIB = ${SHLIB_LD} -o $@ $($@_OBJECTS) ${SHLIB_LDFLAGS} ${SHLIB_LD_LIBS}
MAKE_STATIC_LIB = ${STLIB_LD} $@ $($@_OBJECTS)
OBJEXT = o
RANLIB = :
RANLIB_STUB = ranlib
SHLIB_CFLAGS = -fPIC
SHLIB_LD = gcc -pipe -shared
SHLIB_LDFLAGS = 
SHLIB_LD_LIBS = -L/home/neumann/tcl8.4.5/unix -L/usr/lib -ltclstub8.4${TCL_DBGX}
SHLIB_SUFFIX=  .so
STLIB_LD = ${AR} cr
TCL_BIN_DIR = /home/neumann/tcl8.4.5/unix
TCL_DEFS =  -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=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_UNISTD_H=1 -DHAVE_SYS_PARAM_H=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 -DPEEK_XCLOSEIM=1 -DHAVE_SYS_IOCTL_H=1 
TCL_EXTRA_CFLAGS = 
TCL_EXTRA_CFLAGS = #
TCL_LD_FLAGS = -rdynamic
TCL_LIBS = -ldl  -lieee -lm
TCL_INCLUDES = -I$(TCL_TOP_DIR_NATIVE)/generic -I$(TCL_TOP_DIR_NATIVE)/unix
TK_INCLUDES = -I"/usr/include"
TCL_SHLIB_LD_LIBS = ${LIBS}
TCL_SRC_DIR = /home/neumann/tcl8.4.5
TCL_DBGX = 
TCL_STUB_LIB_FILE = libtclstub8.4${TCL_DBGX}.a
TCL_STUB_LIB_SPEC = -L/usr/lib -ltclstub8.4${TCL_DBGX}
TCL_TOOL_DIR_NATIVE = $(TCL_TOP_DIR_NATIVE)/tools
TCL_TOP_DIR_NATIVE = $(TCL_SRC_DIR)
TCL_UNIX_DIR_NATIVE = $(TCL_TOP_DIR_NATIVE)/unix
TCL_WIN_DIR_NATIVE = $(TCL_TOP_DIR_NATIVE)/win
INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@
TCL_BMAP_DIR_NATIVE = $(TCL_TOP_DIR_NATIVE)/bitmaps
TCL_PLATFORM_DIR_NATIVE = $(TCL_TOP_DIR_NATIVE)/unix
TCL_GENERIC_DIR_NATIVE = $(TCL_TOP_DIR_NATIVE)/generic
TCLSH_PROG = /usr/bin/tclsh8.4
XOTCL_INCLUDES = -I"./../generic" -I"./../unix"
TCL_LIB_SPEC = -L/usr/lib -ltcl8.4${TCL_DBGX}
TK_LIB_SPEC = -L/usr/lib -ltk8.4
XOTCLSH=xotclsh
XOWISH=xowish

AUTOCONF = autoconf

LDFLAGS = $(LDFLAGS_DEFAULT)
INCLUDES = -I$(TCL_TOP_DIR_NATIVE)/generic -I$(TCL_TOP_DIR_NATIVE)/unix -I"./../generic" -I"./../unix" 
EXTRA_CFLAGS = $(AC_FLAGS) $(PROTO_FLAGS) $(MEM_DEBUG_FLAGS) $(NO_DEPRECATED_FLAGS) $(TCL_EXTRA_CFLAGS)

AOL_DEFINES		= 
HAVE_TCL_COMPILE_H	= -DHAVE_TCL_COMPILE_H=1
DEFS = -DPACKAGE_NAME=\"XOTcl\" -DPACKAGE_TARNAME=\"xotcl\" -DPACKAGE_VERSION=\"1.2.0\" -DPACKAGE_STRING=\"XOTcl\ 1.2.0\" -DPACKAGE_BUGREPORT=\"\" -DVERSION=\"1.2\" -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 -DCOMPILE_XOTCL_STUBS=1  $(EXTRA_CFLAGS) \
  $(AOL_DEFINES) $(HAVE_TCL_COMPILE_H) \
  -DTCL_SHLIB_EXT=\"${SHLIB_SUFFIX}\"

DEFS_WITH_STUBS = -DUSE_TCL_STUBS $(DEFS)
ACLOCAL_M4 = $(srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(src_config_dir)/mkinstalldirs
CPPFLAGS = 
LIBS = 
AR = ar
CFLAGS=		${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} -g  \
			-DXOTCLVERSION=\"$(VERSION)\"  \
			-DXOTCLPATCHLEVEL=\"$(PATCHLEVEL)\"  \
			$(DMALLOC_DEFINES)
COMPILE = $(CC) $(DEFS_WITH_STUBS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
COMPILE_NO_STUBS = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@

#========================================================================
# 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: binaries libraries doc end

#========================================================================
# The binaries target builds executable programs, Windows .dll's, unix
# shared/static libraries, and any other platform-dependent files.
# The list of targets to build for "binaries:" is specified at the top
# of the Makefile, in the "BINARIES" variable.
#========================================================================

binaries: $(BINARIES) $(XOTCLSH) $(XOWISH) pkgIndex.tcl 
	@if test ! "x$(subdirs)" = "x" ; then \
	for dir in $(subdirs) ; do \
	   if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \
	done; fi;

libraries: 
	@if test ! "x$(subdirs)" = "x" ; then \
	for dir in $(subdirs) ; do \
	   if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \
	done; fi;
	@$(TCLSH_PROG) $(src_lib_dir)/lib/make.xotcl -dir $(src_lib_dir) -all

# use language reference as sample file to trigger generation of documentation files
doc: $(src_doc_dir)/langRef-xotcl.html

$(src_doc_dir)/langRef-xotcl.html: $(src_doc_dir)/langRef.xotcl $(DOC_SOURCE)
	@$(TCLSH_PROG) $(src_lib_dir)/lib/makeDoc.xotcl $(src_doc_dir) $(DOC_SOURCE)

pdf:
	-(cd $(src_doc_dir); htmldoc --webpage --format pdf14 --title \
		-f tutorial.pdf tutorial.html )
	-(cd $(src_doc_dir); htmldoc --webpage --format pdf14  \
		-f langRef-xotcl.pdf langRef-xotcl.html )

install: install-binaries install-shells install-libraries install-doc
	@if test ! "x$(subdirs)" = "x" ; then \
	for dir in $(subdirs) ; do \
	   if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \
	done; fi;

install-binaries: binaries install-lib-binaries install-bin-binaries install-pkgIndex

install-aol: install-binaries install-libraries
	$(INSTALL) $(src_generic_dir)/aol-xotcl.tcl \
		$(DESTDIR)/usr/local/aolserver/modules/tcl/xotcl.tcl


#========================================================================
# This rule installs platform-independent files, such as header files.
#========================================================================
install-libraries: libraries $(DESTDIR)$(includedir) $(DESTDIR)$(pkglibdir)
	@echo "Installing header files in $(DESTDIR)$(includedir)"
	@for i in $(GENERIC_HDRS) ; do \
	    echo "Installing $$i" ; \
	    $(INSTALL_DATA) $$i $(DESTDIR)$(includedir) ; \
	done;
	@for i in $(libdirs) ; do \
	    echo "Installing $$i" ; \
	    rm -rf $(DESTDIR)$(pkglibdir)/$$i ; \
	    $(INSTALL) $(src_lib_dir)/$$i $(DESTDIR)$(pkglibdir) ; \
	done;
	cat pkgIndex.unix >> $(DESTDIR)$(pkglibdir)/pkgIndex.tcl
	@for i in $(appdirs) ; do \
	    echo "Installing $$i" ; \
	    rm -rf $(DESTDIR)$(pkglibdir)/apps/$$i ; \
	    $(INSTALL) $(src_app_dir)/$$i $(DESTDIR)$(pkglibdir)/apps ; \
	done;
	@rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclGdbm
	@rm -rf $(DESTDIR)$(pkglibdir)/store/XOTclSdbm
	@rm -rf $(DESTDIR)$(pkglibdir)/xml/TclExpat-1.1

#========================================================================
# Install documentation.  Unix manpages should go in the $(DESTDIR)$(mandir)
# directory.
#========================================================================

install-doc: doc
	@$(mkinstalldirs) $(DESTDIR)$(mandir)/man1
	@$(mkinstalldirs) $(DESTDIR)$(mandir)/man3
	@$(mkinstalldirs) $(DESTDIR)$(mandir)/mann
	@if test ! "x$(XOTCLSH)" = "x" ; then \
	(cd $(src_man_dir)/ ; \
	 for i in *.1; do \
	    echo "Installing $$i"; \
	    rm -f $(DESTDIR)$(mandir)/man1/$$i; \
	    sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
		    $$i > $(DESTDIR)$(mandir)/man1/$$i; \
	    chmod 444 $(DESTDIR)$(mandir)/man1/$$i; \
	    done) ; \
	fi

test: binaries libraries test-core test-actiweb

#TESTFLAGS = -srcdir $(srcdir)
test-core: $(TCLSH_PROG)
	$(TCLSH_PROG) `echo $(TOP_DIR)/tests/testx.xotcl` \
		-libdir `echo $(PLATFORM_DIR)` $(TESTFLAGS)
	$(TCLSH_PROG) `echo $(TOP_DIR)/tests/testo.xotcl` \
		-libdir `echo $(PLATFORM_DIR)` $(TESTFLAGS)
	$(TCLSH_PROG) `echo $(TOP_DIR)/tests/speedtest.xotcl` \
		-libdir `echo $(PLATFORM_DIR)` $(TESTFLAGS)
	$(TCLSH_PROG) `echo $(TOP_DIR)/tests/xocomm.test` \
		-libdir `echo $(PLATFORM_DIR)` $(TESTFLAGS)
test-actiweb: $(TCLSH_PROG)
	$(TCLSH_PROG) `echo $(TOP_DIR)/tests/actiweb.test` \
		-libdir `echo $(PLATFORM_DIR)` $(TESTFLAGS)
	$(TCLSH_PROG) `echo $(TOP_DIR)/tests/persistence.test` \
		-libdir `echo $(PLATFORM_DIR)` $(TESTFLAGS)
	$(TCLSH_PROG) `echo $(TOP_DIR)/tests/UNIVERSAL.test` \
		-libdir `echo $(PLATFORM_DIR)` $(TESTFLAGS)
	$(TCLSH_PROG) `echo $(TOP_DIR)/tests/xoRDF.test` \
		-libdir `echo $(PLATFORM_DIR)` $(TESTFLAGS)
	@rm -rf receiver

depend:

#========================================================================
# Enumerate the names of the object files included in this package.
# These objects are created and linked into the final library.  In
# most cases these object files will correspond to the source files
# above.
#
# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable
# at the top of the Makefile.  That will ensure that this target is built
# when you run "make binaries".
#
# You shouldn't need to modify this target, except to change the package
# name from "exampleA" to your package's name.
#========================================================================

$(xotcl_LIB_FILE): $(xotcl_OBJECTS) $(STUB_LIB_BINARY)
	@if test ! -d so; then mkdir so; fi
	-rm -f $(xotcl_LIB_FILE)
	${SHLIB_LD} -o $@ $($@_OBJECTS) ${SHLIB_LDFLAGS} ${SHLIB_LD_LIBS}
	$(RANLIB) $(xotcl_LIB_FILE)

$(xotclstub_LIB_FILE): $(xotclstub_OBJECTS)
	@if test ! -d so; then mkdir so; fi
	-rm -f $(xotclstub_LIB_FILE)
	${STLIB_LD} $@ $($@_OBJECTS)
	$(RANLIB_STUB) $(xotclstub_LIB_FILE)

#========================================================================
# xotcl shells
#========================================================================

pkgIndex.tcl: $(xotcl_LIB_FILE)
	@echo package ifneeded XOTcl $(VERSION) [list load [file join \$$dir . $(xotcl_LIB_FILE)] XOTcl] > pkgIndex.tcl

#$(src_lib_dir)/pkgIndex.tcl:
#	cp $(src_lib_dir)/pkgIndex.unix $(src_lib_dir)/pkgIndex.tcl

install-pkgIndex:
#	@echo package ifneeded XOTcl $(VERSION) [list load [file join \$$dir .. "$(xotcl_LIB_FILE)"] XOTcl] > "$(pkglibdir)/pkgIndex.tcl"

xotclsh: o/tclAppInit.o $(GENERIC_OBJECTS_NOT_SHARED) $(CONDITIONAL_STUB_OBJECTS)
	$(CC) -rdynamic -o $@ o/tclAppInit.o \
		$(GENERIC_OBJECTS_NOT_SHARED) \
		$(CFLAGS)  $(TCL_LIB_SPEC) \
		$(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS)

xowish: o/tkAppInit.o $(GENERIC_OBJECTS_NOT_SHARED) $(CONDITIONAL_STUB_OBJECTS)
	$(CC) -rdynamic -o $@ o/tkAppInit.o \
		$(GENERIC_OBJECTS_NOT_SHARED) \
		$(CFLAGS)  $(TCL_LIB_SPEC) $(TK_LIB_SPEC) \
		$(DMALLOC_LIB) $(CONDITIONAL_STUB_OBJECTS)

install-shells:
	chmod +x xotclsh xowish 
	@if test -e xotclsh; then \
		$(INSTALL_PROGRAM) xotclsh $(DESTDIR)$(bindir); \
	fi
	@if test -e xowish; then \
		$(INSTALL_PROGRAM) xowish $(DESTDIR)$(bindir); \
	fi

#========================================================================
# We need to enumerate the list of .c to .o lines here.
# Unfortunately, there does not seem to be any other way to do this
# in a Makefile-independent way.  We can't use VPATH because it picks up
# object files that may be located in the source directory.
#
# 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:
#
# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c
# 	$(COMPILE) -c `echo $(srcdir)/src/win/exampleA.c` -o $@
#========================================================================

$(src_generic_dir)/predefined.h: $(src_generic_dir)/mk_predefined.xotcl $(src_generic_dir)/predefined.xotcl
	(cd $(src_generic_dir); $(TCLSH_PROG) mk_predefined.xotcl > predefined.h)

so/dllEntryPoint.$(OBJEXT): $(WIN_DIR)/dllEntryPoint.c
	$(COMPILE) -c `echo $(WIN_DIR)/dllEntryPoint.c` -o $@

o/tkAppInit.$(OBJEXT): $(PLATFORM_DIR)/tkAppInit.c
	@if test ! -d o; then mkdir o; fi
	$(COMPILE_NO_STUBS) $(TK_INCLUDES) -c `echo $<` -o $@

o/%.$(OBJEXT): $(PLATFORM_DIR)/%.c
	@if test ! -d o; then mkdir o; fi
	$(COMPILE_NO_STUBS) -c `echo $<` -o $@

o/%.$(OBJEXT): $(src_generic_dir)/%.c $(GENERIC_HDRS)
	@if test ! -d o; then mkdir o; fi
	$(COMPILE_NO_STUBS) -c `echo $<` -o $@

so/%.o: $(src_generic_dir)/%.c $(GENERIC_HDRS)
	@if test ! -d so; then mkdir so; fi
	$(COMPILE) -c `echo $<` -o $@

so/xotclStubInit.$(OBJEXT): $(GENERIC_HDRS)
so/xotclStubLib.$(OBJEXT): $(src_generic_dir)/xotclStubLib.c $(GENERIC_HDRS)
so/xotcl.$(OBJEXT): $(src_generic_dir)/xotcl.c $(src_generic_dir)/predefined.h $(GENERIC_HDRS)
so/xotclError.$(OBJEXT): $(src_generic_dir)/xotclError.c $(GENERIC_HDRS)
so/xotclMetaData.$(OBJEXT): $(src_generic_dir)/xotclMetaData.c $(GENERIC_HDRS)
so/xotclObjectData.$(OBJEXT): $(src_generic_dir)/xotclObjectData.c $(GENERIC_HDRS)
so/xotclProfile.$(OBJEXT): $(src_generic_dir)/xotclProfile.c $(GENERIC_HDRS)
so/xotclTrace.$(OBJEXT): $(src_generic_dir)/xotclTrace.c $(GENERIC_HDRS)
so/xotclUtil.$(OBJEXT): $(src_generic_dir)/xotclUtil.c $(GENERIC_HDRS)
so/xotclShadow.$(OBJEXT): $(src_generic_dir)/xotclShadow.c $(GENERIC_HDRS)
so/aolstub.$(OBJEXT): $(src_generic_dir)/aolstub.c $(GENERIC_HDRS)

o/xotclStubInit.$(OBJEXT): $(GENERIC_HDRS)
o/xotclStubLib.$(OBJEXT): $(src_generic_dir)/xotclStubLib.c $(GENERIC_HDRS)
o/xotcl.$(OBJEXT): $(src_generic_dir)/xotcl.c $(src_generic_dir)/predefined.h $(GENERIC_HDRS)
o/xotclError.$(OBJEXT): $(src_generic_dir)/xotclError.c $(GENERIC_HDRS)
o/xotclMetaData.$(OBJEXT): $(src_generic_dir)/xotclMetaData.c $(GENERIC_HDRS)
o/xotclObjectData.$(OBJEXT): $(src_generic_dir)/xotclObjectData.c $(GENERIC_HDRS)
o/xotclProfile.$(OBJEXT): $(src_generic_dir)/xotclProfile.c $(GENERIC_HDRS)
o/xotclTrace.$(OBJEXT): $(src_generic_dir)/xotclTrace.c $(GENERIC_HDRS)
o/xotclUtil.$(OBJEXT): $(src_generic_dir)/xotclUtil.c $(GENERIC_HDRS)
o/xotclShadow.$(OBJEXT): $(src_generic_dir)/xotclShadow.c $(GENERIC_HDRS)
o/aolstub.$(OBJEXT): $(src_generic_dir)/aolstub.c $(GENERIC_HDRS)

#
# Target to regenerate header files and stub files from the *.decls tables.
#

genstubs:
	$(TCLSH_PROG) $(TCL_TOOL_DIR_NATIVE)/genStubs.tcl $(src_generic_dir) \
		$(src_generic_dir)/xotcl.decls $(src_generic_dir)/xotclInt.decls

#
# Target to check that all exported functions have an entry in the stubs
# tables.
#

checkstubs:
	-@for i in `nm -p $(xotcl_LIB_FILE) | awk '$$2 ~ /T/ { print $$3 }' \
		| sort -n`; do \
		match=0; \
		for j in $(TCL_DECLS); do \
		    if [ `grep -c $$i $$j` -gt 0 ]; then \
			match=1; \
		    fi; \
		done; \
		if [ $$match -eq 0 ]; then echo $$i; fi \
	done

#========================================================================
# End of user-definable section
#========================================================================

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

clean:  
	-rm -rf $(BINARIES) $(CLEANFILES) xotclsh xowish so o pkgIndex.tcl ./receiver
	@if test ! "x$(subdirs)" = "x" ; then \
	for dir in $(subdirs) ; do \
	   if (cd $$dir; $(MAKE) $@) ; then true ; else exit 1 ; fi ; \
	done; fi

distclean: clean
	-rm -f Makefile $(CONFIG_CLEAN_FILES) config.*

#========================================================================
# Install binary object libraries.  On Windows this includes both .dll and
# .lib files.  Because the .lib files are not explicitly listed anywhere,
# we need to deduce their existence from the .dll file of the same name.
# Additionally, the .dll files go into the bin directory, but the .lib
# files go into the lib directory.  On Unix platforms, all library files
# go into the lib directory.  In addition, this will generate the pkgIndex.tcl
# file in the install location (assuming it can find a usable tclsh8.2 shell)
#
# You should not have to modify this target.
#========================================================================

install-lib-binaries: $(DESTDIR)$(bindir) $(DESTDIR)$(libdir)
	@list='$(lib_BINARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    ext=`echo $$p|sed -e "s/.*\.//"`; \
	    if test "x$$ext" = "xdll"; then \
	        echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
	        $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
		lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
		if test -f $$lib; then \
		    echo " $(INSTALL_PROGRAM) $$lib $(DESTDIR)$(libdir)/$$lib"; \
	            $(INSTALL_PROGRAM) $$lib $(DESTDIR)$(libdir)/$$lib; \
		fi; \
	    else \
		echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p"; \
	        $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p; \
	    fi; \
	  fi; \
	done
	@list='$(lib_BINARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
	    if test "x$$stub" = "xstub"; then \
		    echo " $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p"; \
		    $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p; \
	    else \
		    echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \
		    $(RANLIB) $(DESTDIR)$(libdir)/$$p; \
	    fi; \
	  fi; \
	done

#========================================================================
# Install binary executables (e.g. .exe files)
#
# You should not have to modify this target.
#========================================================================

install-bin-binaries: $(DESTDIR)$(bindir)
	@list='$(bin_BINARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \
	    $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \
	  fi; \
	done

.SUFFIXES: .c .o .obj

uninstall-binaries:
	@$(NORMAL_UNINSTALL)
	list='$(BINARIES)'; for p in $$list; do \
	  rm -f $(DESTDIR)$(libdir)/$$p; \
	done

$(DESTDIR)$(includedir):
	$(mkinstalldirs) $@
$(DESTDIR)$(bindir):
	$(mkinstalldirs)  $@
$(DESTDIR)$(libdir):
	$(mkinstalldirs)  $@
$(DESTDIR)$(pkglibdir):
	$(mkinstalldirs)  $@
$(DESTDIR)$(pkglibdir)/apps: $(DESTDIR)$(pkglibdir)
	$(mkinstalldirs)  $@






end:
	@echo "" 
	@echo "************************************************************"
	@echo " Make completed. In order to test XOTcl, invoke:"
	@echo "   make test"
	@echo ""
	@echo " In order install XOTcl, invoke:"
	@echo "   make install"
	@echo ""
	@echo " In order to install XOTcl for AOLserver 4.x, invoke:"
	@echo "   make install-aol"
	@echo "" 
	@echo " In order to invoke XOTcl interactively (before install), use:" 
	@echo "   export TCLLIBPATH=\"$(TCLLIBPATH)\"   or    " 
	@echo "   setenv TCLLIBPATH \"$(TCLLIBPATH)\""
	@echo " and"
	@if test "x$(XOTCLSH)" = "x" ; then \
	  echo "   /usr/bin/tclsh8.4" ; \
	  echo "   package require XOTcl; namespace import -force xotcl::*" ; \
	  echo " or" ; \
	  echo "   put the 'package require' line into your ~/.tclshrc" ; \
	else \
	  echo "   xotclsh" ; \
	fi
	@echo "************************************************************"

RPMSOURCES=/usr/src/redhat/SOURCES
RPMSPECS=/usr/src/redhat/SPECS

rpm: tar
	@if test ! -d $(RPMSOURCES); then mkdir -p $(RPMSOURCES); fi
	@if test ! -d $(RPMSPECS); then mkdir -p $(RPMSPECS); fi
	cp ../../xotcl-$(FULLVERSION).tar.gz $(RPMSOURCES)
	cp xotcl.spec $(RPMSPECS)/xotcl-$(FULLVERSION).spec
	rpmbuild -ba $(RPMSPECS)/xotcl-$(FULLVERSION).spec

bin-tar: 
	(cd ../..; tar zcvf xotcl-$(FULLVERSION)-bin-linux-i686-glibc.tar.gz \
                `find $(exec_prefix)/bin/xotclsh $(exec_prefix)/bin/xowish \
		  $(prefix)/include/xotcl*.h \
                  $(prefix)/lib/$(xotcl_LIB_FILE) \
                  $(prefix)/lib/$(xotclstub_LIB_FILE) \
                  $(DESTDIR)$(pkglibdir) $(prefix)/man/man1/xo* \
                -type f -o -type l | fgrep -v CVS | fgrep -v SCCS | fgrep -v .junk| fgrep -v .db | fgrep -v "~" | fgrep -v "#" | fgrep -v /receiver/` \
	)


tar: clean
	(cd ../..; tar zcvf ./xotcl-$(FULLVERSION).tar.gz \
		`find ./xotcl-$(FULLVERSION) -type f -o -type l| fgrep -v CVS | fgrep -v SCCS | fgrep -v Attic | fgrep -v "autom4te"| fgrep -v config\.status | fgrep -v "~"|fgrep -v .db | fgrep -v .junk | fgrep -v "#" | grep -v "/o$$"`)

.PHONY: all binaries clean depend distclean doc install libraries \
	test test-core test-actiweb 

# 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:
