#
# 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.
#
# RCS: @(#) $Id: Makefile.in,v 1.13 1999/11/02 00:10:00 redman Exp $

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

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

jar_BINARIES= tclblend.jar tcljava.jar
lib_BINARIES=$(TCLBLEND_LIB_FILE)
BINARIES=$(lib_BINARIES) $(jar_BINARIES)

#========================================================================
# Enumerate the names of the source files included in this package.
# This is used when making a dist.
#========================================================================

tclblend_SOURCES = @TCLBLEND_PLATFORM@/@TCLBLEND_PLATFORM@Notifier.c \
	src/native/javaCmd.c \
	src/native/javaIdle.c \
	src/native/javaInterp.c \
	src/native/javaList.c \
	src/native/javaNotifier.c \
	src/native/javaObj.c \
	src/native/javaTimer.c \
	src/native/javaUtil.c

SOURCES = $(tclblend_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.
#========================================================================

tclblend_OBJECTS =  @TCLBLEND_PLATFORM@Notifier.$(OBJEXT) \
	javaCmd.$(OBJEXT) \
	javaIdle.$(OBJEXT) \
	javaInterp.$(OBJEXT) \
	javaList.$(OBJEXT) \
	javaNotifier.$(OBJEXT) \
	javaObj.$(OBJEXT) \
	javaTimer.$(OBJEXT) \
	javaUtil.$(OBJEXT) 

TCLBLEND_LIB_FILE = @TCLBLEND_LIB_FILE@
$(TCLBLEND_LIB_FILE)_OBJECTS = $(tclblend_OBJECTS)
OBJECTS = $(tclblend_OBJECTS)

TCLBLEND_CLASS_NAMES = \
	tcl.lang.CObject \
	tcl.lang.IdleHandler \
	tcl.lang.Interp \
	tcl.lang.Notifier \
	tcl.lang.TclList \
	tcl.lang.TimerHandler \
	tcl.lang.Util


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

GENERIC_HDRS= \
	$(srcdir)/src/native/javaNative.h \
	$(srcdir)/src/native/java.h

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

SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@

#========================================================================
# 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 = @SHELL@
PATH_SEP = @PATH_SEP@
SEP=@SEP@

srcdir = @srcdir@
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@

bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include

DESTDIR =

pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@

top_builddir = .

FULL_SRCDIR=@FULL_SRCDIR@
FULL_SRCDIR_NATIVE=@FULL_SRCDIR_NATIVE@
MISC_DIR = @MISC_DIR@
MISC_DIR_NATIVE = "`@CYGPATH@ @MISC_DIR@`"
TCLBLEND_SRC_DIR = $(FULL_SRCDIR)/src/tclblend
TCLJAVA_SRC_DIR = $(FULL_SRCDIR)/src/tcljava

BUILD_DIR=@BUILD_DIR@
BUILD_DIR_NATIVE=@BUILD_DIR_NATIVE@
TCLBLEND_BUILD_DIR = $(BUILD_DIR)/tclblend
TCLJAVA_BUILD_DIR = $(BUILD_DIR)/tcljava
TCLBLEND_BUILD_DIR_NATIVE = @TCLBLEND_BUILD_DIR_NATIVE@
TCLJAVA_BUILD_DIR_NATIVE = @TCLJAVA_BUILD_DIR_NATIVE@


TEST_BUILD_DIR=$(BUILD_DIR)/tests
TEST_BUILD_DIR_NATIVE=@TEST_BUILD_DIR_NATIVE@
TEST_SRC_DIR = $(FULL_SRCDIR)/src/tests
TEST_TCLJAVA_SRC_DIR = $(TEST_SRC_DIR)/tcljava
TEST_TCLBLEND_SRC_DIR = $(TEST_SRC_DIR)/tclblend

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_FLAG =
transform = @program_transform_name@

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

PACKAGE = @PACKAGE@
VERSION = @VERSION@
CC = @CC@
CFLAGS_DEBUG = @CFLAGS_DEBUG@
CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@
CLEANFILES = @CLEANFILES@
TCL_DBGX = @TCL_DBGX@
DL_LIBS = @DL_LIBS@
EXEEXT = @EXEEXT@
LDFLAGS_DEBUG = @LDFLAGS_DEBUG@
LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@
MAKE_LIB = @MAKE_LIB@
MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
MATH_LIBS = @MATH_LIBS@
OBJEXT = @OBJEXT@
RANLIB = @RANLIB@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_LD = @SHLIB_LD@
SHLIB_LDFLAGS = @SHLIB_LDFLAGS@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ @TCLBLEND_LIBS@
STLIB_LD = @STLIB_LD@
TCL_BIN_DIR = @TCL_BIN_DIR@
TCL_BUILD_LIB_SPEC = @TCL_BUILD_LIB_SPEC@
TCL_BUILD_STUB_LIB_SPEC = @TCL_BUILD_STUB_LIB_SPEC@
TCL_DEFS = @TCL_DEFS@
TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@
TCL_LD_FLAGS = @TCL_LD_FLAGS@
TCL_LIBS = @TCL_LIBS@
TCL_LIB_FILE = @TCL_LIB_FILE@
TCL_LIB_SPEC = @TCL_LIB_SPEC@
TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@
TCL_SRC_DIR = @TCL_SRC_DIR@
TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@
TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@
TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@
TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@
TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@
INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@
TK_BIN_DIR_NATIVE = @TK_BIN_DIR_NATIVE@
TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@
TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@
TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@
TK_LIB_FILE = @TK_LIB_FILE@
TK_SRC_DIR = @TK_SRC_DIR@
TCLSH_PROG = @TCLSH_PROG@

TCLJAVA            = @TCLJAVA@
JAVA_DIR           = @JAVA_DIR@
JAVA_DIR_NATIVE    = @JAVA_DIR_NATIVE@
JAVA               = @JAVA@
JAVAC              = @JAVAC@
JAVAH              = @JAVAH@
JAR                = @JAR@
JDB                = @JDB@

JAVA_FLAGS         = @JAVA_FLAGS@
JAVA_FLAGS_C       = @JAVA_FLAGS_C@
JAR_COMPRESS_FLAGS = -cf0M
JAR_EXTRACT_FLAGS  = -xf
JDB_FLAGS          =

JAVA_INCLUDE             = @JAVA_INCLUDE@
JAVA_INCLUDE_NATIVE      = @JAVA_INCLUDE_NATIVE@
JAVA_ARCH_INCLUDE_NATIVE = @JAVA_ARCH_INCLUDE_NATIVE@
JAVA_ARCH_NATIVE_RUNTIME_LIBS = @JAVA_ARCH_NATIVE_RUNTIME_LIBS@
JAVA_CLASSPATH           = @JAVA_CLASSPATH@

# Java sources

TCLBLEND_JAVA_FILES = \
	$(TCLBLEND_SRC_DIR)/tcl/lang/CObject.java \
	$(TCLBLEND_SRC_DIR)/tcl/lang/IdleHandler.java \
	$(TCLBLEND_SRC_DIR)/tcl/lang/Interp.java \
	$(TCLBLEND_SRC_DIR)/tcl/lang/NativeLock.java \
	$(TCLBLEND_SRC_DIR)/tcl/lang/Notifier.java \
	$(TCLBLEND_SRC_DIR)/tcl/lang/TclList.java \
	$(TCLBLEND_SRC_DIR)/tcl/lang/TimerHandler.java \
	$(TCLBLEND_SRC_DIR)/tcl/lang/Util.java

TCLJAVA_JAVA_FILES = \
	$(TCLJAVA_SRC_DIR)/tcl/lang/AdaptorClassLoader.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/AdaptorGen.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/ArrayObject.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/AssocData.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/BeanEvent.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/BeanEventMgr.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/BeanEventParamSet.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/BlendExtension.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/ClassRep.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/Command.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/CommandWithDispose.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/EventAdaptor.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/EventDeleter.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/Extension.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/FieldSig.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/FuncSig.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/InternalRep.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaBindCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaCallCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaCastCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaDefineClassCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaEventCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaFieldCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaGetInterpCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaInfoCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaInstanceofCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaInvoke.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaIsNullCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaLoadCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaNewCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaNullCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaPropCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaThrowCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/JavaTryCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/PropertySig.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/ReflectException.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/ReflectObject.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TCL.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclBoolean.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclClassLoader.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclDouble.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclEvent.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclException.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclIndex.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclInteger.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclNumArgsException.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclObject.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclPosixException.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclRuntimeError.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/TclString.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/UnsupportedJDetachCallCmd.java \
	$(TCLJAVA_SRC_DIR)/tcl/lang/VarTrace.java

TCLJAVA_REFLECT_JAVA_FILES = \
	$(TCLJAVA_SRC_DIR)/tcl/lang/reflect/PkgInvoker.java

TEST_TCLBLEND_JAVA_FILES = \
	$(TEST_TCLBLEND_SRC_DIR)/tcl/lang/NativeTestExtension.java \
	$(TEST_TCLBLEND_SRC_DIR)/tests/IdleHandlerTest.java \
	$(TEST_TCLBLEND_SRC_DIR)/tests/TestObjectCmd.java \
	$(TEST_TCLBLEND_SRC_DIR)/tests/TimerHandlerTest.java

TEST_TCLBLEND_FILE_PATTERN = \
	tests${SEP}*.java tcl${SEP}lang${SEP}*.java

TEST_TCLJAVA_JAVA_FILES = \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test10Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test1Cmd.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test1Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test2Cmd.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test2Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test3Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test4Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test5Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test6Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test7Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test8Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/javaload/Test9Extension.java \
	$(TEST_TCLJAVA_SRC_DIR)/pkg1/MyClass.java \
	$(TEST_TCLJAVA_SRC_DIR)/pkg2/MyClass.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/AdaptorGenTest.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/JtestCmd.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/NoEventBean.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/TclPkgInvoker.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/TestcompcodeCmd.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/Tester1Event.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/Tester1Listener.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/Tester2Event.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/Tester2Listener.java \
	$(TEST_TCLJAVA_SRC_DIR)/tcl/lang/TesterBean.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/Compare.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/ConvertTest.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/DownReference.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/JavaTest.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/JavaTestSub.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/LongConvert.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/RetArray.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/VarTraceTest.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/exec/ExecEmptyErr.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/exec/ExecEmptyErr2.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/exec/ExecErr.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/exec/ExecNoErr.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/exec/ExecNoErr2.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/exec/PWD.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/exec/PrintArgs.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/invoke/ArrayTestClass.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/invoke/IntA.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/invoke/IntC.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/invoke/PublicTester.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/javainfo/InfoTestClass.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/javainfo/SuperTestClass.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodFailure1.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodFailure2.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodFailure3.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodFailure4.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodFailure5.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodInvoker1.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodInvoker2.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodInvoker3.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodInvoker4.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodInvoker5.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/MethodInvoker6.java \
	$(TEST_TCLJAVA_SRC_DIR)/tests/signature/NullSignature.java

TEST_TCLJAVA_FILE_PATTERN = \
	pkg1${SEP}*.java \
	pkg2${SEP}*.java \
	tcl${SEP}lang${SEP}*.java \
	tests${SEP}*.java \
	tests${SEP}invoke${SEP}*.java \
	tests${SEP}javainfo${SEP}*.java \
	tests${SEP}signature${SEP}*.java \
	tests${SEP}exec${SEP}*.java

# AUX_CLASSPATH is used for Java Studio test coverage
# Note that AUX_CLASSPATH should have a leading colon (:),
# see the jstclblendTest rule for an example

EMPTY_JAR=@EMPTY_JAR@
TCLJAVA_JAR=@TCLJAVA_JAR@
TCLBLEND_JAR=@TCLBLEND_JAR@

TCLBLEND_CLASSPATH = $(TCLJAVA_BUILD_DIR_NATIVE)$(PATH_SEP)$(TCLBLEND_BUILD_DIR_NATIVE)$(PATH_SEP)$(JAVA_CLASSPATH)$(AUX_CLASSPATH)

#JACL_CLASSPATH = $(TCLJAVA_BUILD_DIR_NATIVE)$(PATH_SEP)$(JACL_BUILD_DIR_NATIVE)$(PATH_SEP)$(JAVA_CLASSPATH)$(AUX_CLASSPATH)

TCLJAVA_CLASSPATH = $(TCLJAVA_BUILD_DIR_NATIVE)$(PATH_SEP)$(EMPTY_JAR)$(PATH_SEP)$(JAVA_CLASSPATH)$(AUX_CLASSPATH)
DEMOS_CLASSPATH	= $(TCLBLEND_JAR)$(PATH_SEP)$(TCLJAVA_JAR)$(PATH_SEP)$(JAVA_CLASSPATH)$(AUX_CLASSPATH)

TEST_CLASSPATH = $(JAVA_CLASSPATH)$(PATH_SEP)$(TEST_BUILD_DIR_NATIVE)$(PATH_SEP)$(TCLBLEND_JAR)$(PATH_SEP)$(TCLJAVA_JAR)$(AUX_CLASSPATH)


AUTOCONF = autoconf

LDFLAGS = $(LDFLAGS_DEFAULT)

# Change the following if you require the Tcl private includes.
# 

INCLUDES = \
    -I$(TCL_PLATFORM_DIR_NATIVE) \
    -I$(TCL_GENERIC_DIR_NATIVE) \
    -I$(TCL_BMAP_DIR_NATIVE) \
    -I$(JAVA_INCLUDE_NATIVE) \
    -I$(JAVA_ARCH_INCLUDE_NATIVE) \
    -I$(INCLUDE_DIR_NATIVE) \
    -I$(FULL_SRCDIR_NATIVE)/@TCLBLEND_PLATFORM@ \
    -I$(FULL_SRCDIR_NATIVE)/src/native 

EXTRA_CFLAGS = $(TCL_DEFS) $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS)

DEFS = @DEFS@ $(EXTRA_CFLAGS)

ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES = mkIndex.tcl

CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@ $(TCLBLEND_LIBS)
AR = ar
CFLAGS = @CFLAGS@
COMPILE = $(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
# independant files, and the "binaries:" target inclues executable programs and
# platform-dependant 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

binaries: $(BINARIES) pkgIndex.tcl

libraries:

doc:

install: all install-binaries install-libraries install-doc

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

#========================================================================
# 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.
#========================================================================

install-lib-binaries: installdirs
	@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_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \
	        $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \
		lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
		if test -f $$lib; then \
		    echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib"; \
	            $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \
		fi; \
	    else \
		echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
	        $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
	    fi; \
	  else :; fi; \
	done
	@list='$(lib_BINARIES)'; for p in $$list; do \
	  if test -f $$p; then \
	    echo " $(RANLIB) $(DESTDIR)$(bindir)/$$p"; \
	    $(RANLIB) $(DESTDIR)$(bindir)/$$p; \
	  else :; fi; \
	done
	@list='$(jar_BINARIES)'; for p in $$list; do \
	  $(INSTALL_DATA) $$p $(DESTDIR)$(pkglibdir)/$$p; \
	done
	$(INSTALL_DATA) pkgIndex.tcl $(pkglibdir)


#========================================================================
# Install binary executables (e.g. .exe files)
#========================================================================

install-bin-binaries: installdirs
	@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; \
	  else :; fi; \
	done

install-libraries: libraries
	$(mkinstalldirs) $(includedir)
	$(mkinstalldirs) $(pkglibdir)
	@echo "Installing header files in $(includedir)"
	@for i in $(GENERIC_HDRS) ; do \
	    $(INSTALL_DATA) $$i $(includedir) ; \
	done;

install-doc: doc
	$(mkinstalldirs) $(prefix)/doc/@PACKAGE@/TclJava
	$(mkinstalldirs) $(prefix)/doc/@PACKAGE@/TclJavaLib
	$(mkinstalldirs) $(prefix)/doc/@PACKAGE@/Keywords
	@echo "Installing HTML docs"
	@for i in $(srcdir)/docs/*.htm* ; do \
	    $(INSTALL_DATA) $$i $(prefix)/doc/@PACKAGE@ ; \
	done;
	@for i in $(srcdir)/docs/Keywords/*.htm* ; do \
	    $(INSTALL_DATA) $$i $(prefix)/doc/@PACKAGE@/Keywords ; \
	done;
	@for i in $(srcdir)/docs/TclJava/*.htm* ; do \
	    $(INSTALL_DATA) $$i $(prefix)/doc/@PACKAGE@/TclJava ; \
	done;
	@for i in $(srcdir)/docs/TclJavaLib/*.htm* ; do \
	    $(INSTALL_DATA) $$i $(prefix)/doc/@PACKAGE@/TclJavaLib ; \
	done;


test: test_$(TCLJAVA)

# Run extra tests, some which won't pass with TclBlend, but
# needed to compare against Jacl.
test.all: test_$(TCLJAVA).all

test_tclblend: $(BINARIES) tests/tclblend
	(  echo \
	  set auto_path [concat [pwd] [set auto_path]]\; \
	  cd \{$(FULL_SRCDIR_NATIVE)/tests\}\; \
	  puts \"pwd is [pwd]\"\; \
	  puts \"CLASSPATH is [set env\(CLASSPATH\)]\"\; \
	  puts \"auto_path is [set auto_path]\"\; \
	  source all\; \
	  puts \"Tests done.\"\; \
          exit; ) | \
	LD_PRELOAD=$(TCLBLEND_LD_PRELOAD) \
	LD_BIND_NOW=$(TCLBLEND_LD_BIND_NOW) \
	LD_LIBRARY_PATH=$(BUILD_DIR):$(TCL_BIN_DIR):$(JAVA_ARCH_NATIVE_RUNTIME_LIBS):$(LD_LIBRARY_PATH) \
	PATH="$(BUILD_DIR)":"$(TCL_BIN_DIR)":"$(PATH)" \
	TCLBLEND_SHLIB_NAMES=$(TCLBLEND_SHLIB_NAMES) \
	TCL_LIBRARY=$(TCL_LIBRARY_DIR) \
	CLASSPATH=$(TEST_CLASSPATH) \
	JAVA=$(JAVA) \
	BUILD_DIR=$(BUILD_DIR_NATIVE) \
	$(TCLSH_PROG)


# Run extra tests, some which won't pass with TclBlend, but
# needed to compare against Jacl.
test_tclblend.all: $(BINARIES) tests/tclblend
	(  echo \
	  set auto_path [concat [pwd] [set auto_path]]\; \
	  cd \{$(FULL_SRCDIR_NATIVE)/tests\}\; \
	  puts \"pwd is [pwd]\"\; \
	  puts \"CLASSPATH is [set env\(CLASSPATH\)]\"\; \
	  puts \"auto_path is [set auto_path]\"\; \
	  source all\; \
	  puts \"Tests done.\"\; \
          exit; ) | \
	TCLBLEND_RUN_ALL_TESTS=1 \
	LD_PRELOAD=$(TCLBLEND_LD_PRELOAD) \
	LD_BIND_NOW=$(TCLBLEND_LD_BIND_NOW) \
	LD_LIBRARY_PATH=$(BUILD_DIR):$(TCL_BIN_DIR):$(JAVA_ARCH_NATIVE_RUNTIME_LIBS):$(LD_LIBRARY_PATH) \
	PATH="$(BUILD_DIR)":"$(TCL_BIN_DIR)":"$(PATH)" \
	TCLBLEND_SHLIB_NAMES=$(TCLBLEND_SHLIB_NAMES) \
	TCL_LIBRARY=$(TCL_LIBRARY_DIR) \
	CLASSPATH=$(TEST_CLASSPATH) \
	JAVA=$(JAVA) \
	BUILD_DIR=$(BUILD_DIR_NATIVE) \
	$(TCLSH_PROG)

depend:

clean:  
	-test -z "$(BINARIES)" || rm -f $(BINARIES)
	-rm -f *.o core *.core Test.class Test.h Test.tcl pkgIndex.tcl
	-rm -f *.$(OBJEXT)
	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
	-rm -rf $(TCLJAVA_BUILD_DIR) $(TCLBLEND_BUILD_DIR)
	-rm -rf $(TEST_BUILD_DIR) META-INF

distclean: clean
	-rm -f *.tab.c
	-rm -f Makefile $(CONFIG_CLEAN_FILES)
	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
	-rm -f config.status

#========================================================================
# 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.
#========================================================================

$(TCLBLEND_LIB_FILE): $(tclblend_OBJECTS)
	-rm -f $(TCLBLEND_LIB_FILE)
	@MAKE_LIB@
	$(RANLIB) $(TCLBLEND_LIB_FILE)

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

@TCLBLEND_PLATFORM@Notifier.$(OBJEXT): \
	    $(srcdir)/@TCLBLEND_PLATFORM@/@TCLBLEND_PLATFORM@Notifier.c \
	    $(GENERIC_HDRS)
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/@TCLBLEND_PLATFORM@/@TCLBLEND_PLATFORM@Notifier.c` -o $@

javaCmd.$(OBJEXT): $(srcdir)/src/native/javaCmd.c $(GENERIC_HDRS)
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/src/native/javaCmd.c` -o $@

javaIdle.$(OBJEXT): $(srcdir)/src/native/javaIdle.c $(GENERIC_HDRS)
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/src/native/javaIdle.c` -o $@

javaInterp.$(OBJEXT): $(srcdir)/src/native/javaInterp.c $(GENERIC_HDRS)
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/src/native/javaInterp.c` -o $@

javaList.$(OBJEXT): $(srcdir)/src/native/javaList.c $(GENERIC_HDRS)
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/src/native/javaList.c` -o $@

javaNotifier.$(OBJEXT): $(srcdir)/src/native/javaNotifier.c $(GENERIC_HDRS)
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/src/native/javaNotifier.c` -o $@

javaObj.$(OBJEXT): $(srcdir)/src/native/javaObj.c $(GENERIC_HDRS)
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/src/native/javaObj.c` -o $@

javaTimer.$(OBJEXT): $(srcdir)/src/native/javaTimer.c $(GENERIC_HDRS)
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/src/native/javaTimer.c` -o $@

javaUtil.$(OBJEXT): $(srcdir)/src/native/javaUtil.c $(GENERIC_HDRS)
	$(COMPILE) -c `@CYGPATH@ $(srcdir)/src/native/javaUtil.c` -o $@

$(srcdir)/src/native/javaNative.h: tcljava tclblend
	CLASSPATH=$(TCLBLEND_CLASSPATH) \
	  $(JAVAH) -jni -o $(FULL_SRCDIR_NATIVE)/src/native/javaNative.h \
          $(TCLBLEND_CLASS_NAMES)

#----------------------------------------------------------------
# Build Tcl Blend
#----------------------------------------------------------------

JAVA_COMPILE_TCLBLEND = \
	cd $(TCLBLEND_SRC_DIR) ; \
	CLASSPATH=$(TCLBLEND_CLASSPATH) \
	$(JAVAC) $(JAVA_FLAGS_C) \
		-d $(TCLBLEND_BUILD_DIR_NATIVE) 

$(TCLBLEND_BUILD_DIR):
	$(mkinstalldirs) $(TCLBLEND_BUILD_DIR)

tclblend.jar: $(TCLBLEND_BUILD_DIR) $(TCLBLEND_JAVA_FILES) tcljava.jar
	rm -rf $(TCLBLEND_BUILD_DIR)/*
	$(JAVA_COMPILE_TCLBLEND) tcl${SEP}lang${SEP}*.java
	cd $(TCLBLEND_BUILD_DIR) ;\
	CLASSPATH=$(JAVA_CLASSPATH) \
	$(JAR) $(JAR_COMPRESS_FLAGS) $(BUILD_DIR_NATIVE)/tclblend.jar tcl

pkgIndex.tcl : $(FULL_SRCDIR)/src/pkgIndex.tcl
	$(INSTALL_DATA) $(MISC_DIR_NATIVE)/pkgIndex.tcl $(BUILD_DIR)

tclblend: tclblend.jar

#----------------------------------------------------------------
# Build the TclJava Package.
#----------------------------------------------------------------

JAVA_COMPILE_TCLJAVA = \
	cd $(TCLJAVA_SRC_DIR) ; \
	CLASSPATH=$(TCLJAVA_CLASSPATH) \
	$(JAVAC) $(JAVA_FLAGS_C) \
		-d $(TCLJAVA_BUILD_DIR_NATIVE) 

$(TCLJAVA_BUILD_DIR):
	$(mkinstalldirs) $(TCLJAVA_BUILD_DIR)
	$(mkinstalldirs) $(TCLJAVA_BUILD_DIR)/tcl
	$(mkinstalldirs) $(TCLJAVA_BUILD_DIR)/tcl/lang

$(TCLJAVA_BUILD_DIR)/tcl/lang/library: $(TCLJAVA_SRC_DIR)/tcl/lang/library
	cp -rf $(TCLJAVA_SRC_DIR)/tcl/lang/library $@

tcljava.jar: $(TCLJAVA_BUILD_DIR) \
		$(TCLJAVA_REFLECT_JAVA_FILES) \
		$(TCLJAVA_JAVA_FILES) \
		$(TCLJAVA_BUILD_DIR)/tcl/lang/library
	rm -rf $(TCLJAVA_BUILD_DIR)/tcl/lang/*.class
	rm -rf $(TCLJAVA_BUILD_DIR)/tcl/lang/reflect/*.class
	$(JAVA_COMPILE_TCLJAVA) tcl${SEP}lang${SEP}reflect${SEP}*.java
	$(JAVA_COMPILE_TCLJAVA) tcl${SEP}lang${SEP}*.java
	cd $(TCLJAVA_BUILD_DIR) ;\
	CLASSPATH=$(JAVA_CLASSPATH) \
	$(JAR) $(JAR_COMPRESS_FLAGS) $(TCLJAVA_JAR) tcl

tcljava: tcljava.jar

#----------------------------------------------------------------
# Build the TclBlend Test Package.
#----------------------------------------------------------------
$(TEST_BUILD_DIR) :
	$(mkinstalldirs) $(TEST_BUILD_DIR)

JAVA_COMPILE_TCLBLEND_TEST = \
	cd $(TEST_TCLBLEND_SRC_DIR) ; \
	CLASSPATH=$(TEST_CLASSPATH) \
	$(JAVAC) $(JAVA_FLAGS_C) \
		-d $(TEST_BUILD_DIR_NATIVE) 

$(TEST_BUILD_DIR)/tclblend: \
		tests/tcljava \
		$(TEST_BUILD_DIR) \
		$(TEST_TCLBLEND_JAVA_FILES) \
		tclblend.jar \
		tcljava.jar
	$(JAVA_COMPILE_TCLBLEND_TEST) $(TEST_TCLBLEND_FILE_PATTERN)
	touch $@

tests/tclblend: $(TEST_BUILD_DIR)/tclblend

#----------------------------------------------------------------
# Build the TclJava Test Package.
#----------------------------------------------------------------

JAVA_COMPILE_TCLJAVA_TEST = \
	cd $(TEST_TCLJAVA_SRC_DIR) ; \
	CLASSPATH=$(TEST_CLASSPATH) \
	$(JAVAC) $(JAVA_FLAGS_C) \
		-d $(TEST_BUILD_DIR_NATIVE)

JAVA_COMPILE_TCLJAVA_TEST_JAVALOAD = \
	cd $(TEST_TCLJAVA_SRC_DIR) ; \
	CLASSPATH=$(TEST_CLASSPATH) \
	$(JAVAC) $(JAVA_FLAGS_C) \
		-d $(TEST_BUILD_DIR_NATIVE)/javaload

$(TEST_BUILD_DIR)/tcljava: \
		$(TEST_BUILD_DIR) \
		$(TEST_TCLJAVA_JAVA_FILES) \
		tcljava.jar
	$(JAVA_COMPILE_TCLJAVA_TEST) $(TEST_TCLJAVA_FILE_PATTERN)
	$(mkinstalldirs) $(TEST_BUILD_DIR)/javaload
	@# workaround for bug in jikes (extra mkdir)
	$(mkinstalldirs) $(TEST_BUILD_DIR)/javaload/tests/javaload
	@# workaround for bug in jikes (extra dir on CLASSPATH)
	$(JAVA_COMPILE_TCLJAVA_TEST_JAVALOAD) javaload${SEP}*.java
	cd $(TEST_BUILD_DIR)/javaload; \
		CLASSPATH=$(JAVA_CLASSPATH) \
		$(JAR) $(JAR_COMPRESS_FLAGS) test9.jar Test9Extension.class; \
	rm Test9Extension.class
	cd $(TEST_BUILD_DIR)/javaload; \
		CLASSPATH=$(JAVA_CLASSPATH) \
		$(JAR) $(JAR_COMPRESS_FLAGS) test10.jar \
			Test10Extension.class; \
		rm Test10Extension.class
	touch $@

tests/tcljava: $(TEST_BUILD_DIR)/tcljava

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


.SUFFIXES: .c .o .obj

Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
	cd $(top_builddir) \
	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status

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

installdirs:
	$(mkinstalldirs)  $(DESTDIR)$(libdir)
	$(mkinstalldirs)  $(DESTDIR)$(bindir)
	$(mkinstalldirs)  $(DESTDIR)$(pkglibdir)

.PHONY: all binaries clean depend distclean doc install installdirs \
libraries test

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


