#
# tcl/unix/Makefile.in  --
#
# Makefile for Extended Tcl C sources. 
#------------------------------------------------------------------------------
# Copyright 1992-1999 Karl Lehenbauer and Mark Diekhans.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies.  Karl Lehenbauer and
# Mark Diekhans make no representations about the suitability of this
# software for any purpose.  It is provided "as is" without express or
# implied warranty.
#------------------------------------------------------------------------------
# $Id: Makefile.in,v 1.1.1.1 1999/06/28 20:35:30 damon Exp $
#------------------------------------------------------------------------------
#

#------------------------------------------------------------------------------
# Common and user-editable defines.
#
srcdir = @srcdir@
@MAKEINCLUDE@ @MAKEQUOTE@@bldbasedir@/unix/Common.mk@MAKEQUOTE@
@MAKEINCLUDE@ @MAKEQUOTE@@bldbasedir@/unix/Config.mk@MAKEQUOTE@

#------------------------------------------------------------------------------
# Local macros.
#
CC_SWITCHES = ${CPPFLAGS} ${XCFLAGS} ${CFLAGS} ${SYSCFLAGS} \
	      ${TCL_DEFS} ${TCLX_DEFS} \
	      -I${TCLX_GENERIC_DIR} -I${TCLX_UNIX_SRC_DIR} \
	      -I${TCLX_UNIX_BLD_DIR} \
	      -I${TCL_GENERIC_DIR} -I${TCL_UNIX_DIR}

LD_SWITCHES = ${LDFLAGS} ${TCL_LD_FLAGS} ${XLDFLAGS} ${XCFLAGS} ${CFLAGS}

LIBS = ${TCLX_LD_SEARCH_FLAGS} @SHARED_LIBS@

ALL_LIBS = ${TCLX_BUILD_LIB_SPEC} ${TCL_LIB} ${TCLX_LIBS} ${TCL_LIBS} \
	   ${XLDLIBS} ${TCLX_CC_SEARCH_FLAGS}

STATIC_LIBS = ${TCLX_STLIB_NAME} ${TCL_UNIX_DIR}/${TCL_STLIB_NAME} \
	     ${TCLX_LIBS} ${TCL_LIBS} ${XLDLIBS} ${TCLX_CC_SEARCH_FLAGS}

#------------------------------------------------------------------------------
# Source and target macros.
#
GENERIC_OBJS = \
    @TCLX_BUILD_STANDALONE@ \
    tclXbsearch.o    tclXchmod.o      tclXcmdInit.o    tclXcmdloop.o  \
    tclXdebug.o      tclXdup.o        tclXfcntl.o      tclXfilecmds.o \
    tclXfilescan.o   tclXflock.o      tclXfstat.o      tclXgeneral.o  \
    tclXhandles.o    tclXunixId.o     tclXinit.o       tclXkeylist.o  \
    tclXlib.o        tclXlist.o       tclXmath.o       tclXmsgcat.o   \
    tclXlibInit.o    tclXprocess.o    tclXprofile.o   \
    tclXselect.o     tclXunixSock.o   tclXsignal.o     tclXshell.o    \
    tclXstring.o     tclXsocket.o     tclXunixCmds.o   tclXutil.o     \
    tclXunixOS.o     tclXoscmds.o     tclXunixDup.o    tclXlgets.o

GENERIC_SOBJS = \
    @TCLX_BUILD_DUMMY_STANDALONE@ \
    tclXbsearch@SHOBJ_SUFFIX@    tclXchmod@SHOBJ_SUFFIX@    \
    tclXcmdInit@SHOBJ_SUFFIX@    tclXcmdloop@SHOBJ_SUFFIX@  \
    tclXdebug@SHOBJ_SUFFIX@      tclXdup@SHOBJ_SUFFIX@      \
    tclXfcntl@SHOBJ_SUFFIX@      tclXfilecmds@SHOBJ_SUFFIX@ \
    tclXfilescan@SHOBJ_SUFFIX@   tclXflock@SHOBJ_SUFFIX@    \
    tclXfstat@SHOBJ_SUFFIX@      tclXgeneral@SHOBJ_SUFFIX@  \
    tclXhandles@SHOBJ_SUFFIX@    tclXunixId@SHOBJ_SUFFIX@   \
    tclXinit@SHOBJ_SUFFIX@       tclXkeylist@SHOBJ_SUFFIX@  \
    tclXlib@SHOBJ_SUFFIX@        tclXlist@SHOBJ_SUFFIX@     \
    tclXmath@SHOBJ_SUFFIX@       tclXmsgcat@SHOBJ_SUFFIX@   \
    tclXlibInit@SHOBJ_SUFFIX@    tclXprocess@SHOBJ_SUFFIX@  \
    tclXprofile@SHOBJ_SUFFIX@    \
    tclXselect@SHOBJ_SUFFIX@     tclXunixSock@SHOBJ_SUFFIX@ \
    tclXsignal@SHOBJ_SUFFIX@     tclXshell@SHOBJ_SUFFIX@    \
    tclXstring@SHOBJ_SUFFIX@     tclXsocket@SHOBJ_SUFFIX@   \
    tclXunixCmds@SHOBJ_SUFFIX@   tclXutil@SHOBJ_SUFFIX@     \
    tclXunixOS@SHOBJ_SUFFIX@     tclXoscmds@SHOBJ_SUFFIX@   \
    tclXunixDup@SHOBJ_SUFFIX@    tclXlgets@SHOBJ_SUFFIX@

COMPAT_OBJS = @LIBOBJS@

COMPAT_SOBJS = @LIBSOBJS@

OBJS= ${GENERIC_OBJS} ${COMPAT_OBJS}

SOBJS= ${GENERIC_SOBJS} ${COMPAT_SOBJS}

RUNTIME_DIR = ${srcbasedir}/tcl/runtime

TLIB_SRCS = \
    ${RUNTIME_DIR}/arrayprocs.tcl	${RUNTIME_DIR}/compat.tcl \
    ${RUNTIME_DIR}/convlib.tcl		${RUNTIME_DIR}/edprocs.tcl \
    ${RUNTIME_DIR}/events.tcl		${RUNTIME_DIR}/forfile.tcl \
    ${RUNTIME_DIR}/globrecur.tcl	${RUNTIME_DIR}/help.tcl \
    ${RUNTIME_DIR}/profrep.tcl		${RUNTIME_DIR}/pushd.tcl \
    ${RUNTIME_DIR}/setfuncs.tcl		${RUNTIME_DIR}/showproc.tcl \
    ${RUNTIME_DIR}/stringfile.tcl	${RUNTIME_DIR}/tcllib.tcl \
    ${RUNTIME_DIR}/fmath.tcl		${RUNTIME_DIR}/buildhelp.tcl

# C source optionally built by tcl2c
STANDALONE_SRCS = \
    arrayprocs.c     compat.c         convlib.c        edprocs.c \
    events.c         forfile.c        globrecur.c      help.c \
    profrep.c        pushd.c          setfuncs.c       showproc.c \
    stringfile.c     tcllib.c         fmath.c          buildhelp.c \
    buildidx.c       autoload.c       tclx.c

STANDALONE_OBJS = \
    arrayprocs.o     compat.o         convlib.o        edprocs.o \
    events.o         forfile.o        globrecur.o      help.o \
    profrep.o        pushd.o          setfuncs.o       showproc.o \
    stringfile.o     tcllib.o         fmath.o          buildhelp.o \
    buildidx.o       autoload.o       tclx.o

HELP_DIR = ${srcbasedir}/tcl/help

TEST_OBJS = tclTest.o tclTestObj.o tclUnixTest.o tclXtest.o \
	@TCL_THREAD_TEST@ tclXunixTest.o

TEST_SAOBJS = tclTest.o tclTestObj.o tclUnixTest.o tclXtest.o \
	@TCL_THREAD_TEST@ tclXunixTestSA.o

#------------------------------------------------------------------------------
# Dependencies for generating the libraries and linking the executable.
# If a link fails, purge the executable, as some systems leave invalid
# executables around.
#
all: binaries libraries doc

binaries: tcl checkup RUNTIME tclXtest

libraries: tcl.tndx tcl.tlib tclx.tcl buildidx.tcl

doc:

static:	tcl.static tclXtest.static

standalone: tcl.standalone tclXtest.standalone hello

tcl: tclXAppInit.o @TCLX_SHLIB_BUILD_REF@ @TCLX_STLIB_BUILD_REF@ Makefile
	${CC} ${LD_SWITCHES} tclXAppInit.o ${ALL_LIBS} \
	    -o $@ || (rm -f $@; exit 1)

tcl.static: tclXAppInit.o @TCLX_STLIB_BUILD_REF@ Makefile
	${CC} ${LD_SWITCHES} tclXAppInit.o ${STATIC_LIBS} \
	    -o $@ || (rm -f $@; exit 1)

tcl.standalone: tclXAppInitSA.o @TCLX_STLIB_BUILD_REF@ Makefile
	${CC} ${LD_SWITCHES} tclXAppInitSA.o ${STATIC_LIBS} \
	    -o $@ || (rm -f $@; exit 1)

${TCLX_STLIB_NAME}: ${OBJS}
	${AR} cr ${TCLX_STLIB_NAME} ${OBJS}
	${RANLIB} ${TCLX_STLIB_NAME}

@TCLX_SHLIB_BUILD_TARGET@: ${SOBJS}
	rm -f ${TCLX_SHLIB_NAME}
	PATH=${TCL_UNIX_DIR}:${PATH}; export PATH; \
	TCL_LIBRARY=${TCL_UNIX_DIR}/../library; export TCL_LIBRARY; \
	LD_LIBRARY_PATH=${TCL_UNIX_DIR}:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; \
	${TCL_SHLIB_LD} -o ${TCLX_SHLIB_NAME} ${SOBJS} ${TCL_SHLIB_LD_LIBS}

hello:	hello.c
	${CC} ${LD_SWITCHES} -o $@ hello.c ${STATIC_LIBS}

#------------------------------------------------------------------------------
# Do some special checks to make sure TclX is built ok.

checkup: checkup.done

checkup.done: tcl tcl.tlib tcl.tndx tclx.tcl buildidx.tcl autoload.tcl
	${RUNTCL} -q ${srcbasedir}/unix/tools/checkup.tcl
	touch checkup.done

#------------------------------------------------------------------------------
# Generate the runtime .tlib library in the current directory.  Copy other
# runtime files into this directory so it can be used as a temporary runtime
# directory before installation.  Also need a "help" directory here so that
# the help command will work before installation.  Normally just symlink,
# unless we don't have them.
#
RUNTIME: tcl.tlib tcl.tndx tclx.tcl buildidx.tcl autoload.tcl help.tmp \
         dltest.tmp checkup

tcl.tlib: ${TLIB_SRCS} autoload.tcl
	-rm -f tcl.tlib tcl.tndx
	cat ${TLIB_SRCS} | grep -v '^#[^@].*' | grep -v '#$$' > $@

tcl.tndx: tcl.tlib tclx.tcl buildidx.tcl
	${GENTNDX} tcl.tlib

tclx.tcl: ${RUNTIME_DIR}/tclx.tcl
	rm -f tclx.tcl
	cp ${RUNTIME_DIR}/tclx.tcl tclx.tcl

buildidx.tcl: ${RUNTIME_DIR}/buildidx.tcl
	rm -f buildidx.tcl
	cp ${RUNTIME_DIR}/buildidx.tcl buildidx.tcl

autoload.tcl: ${RUNTIME_DIR}/autoload.tcl
	rm -f autoload.tcl
	cp ${RUNTIME_DIR}/autoload.tcl autoload.tcl

help.tmp:
	if [ "@HAVE_SYML@" = "YES" ] ; then \
	    rm -rf help ;\
	    ln -s ${HELP_DIR} help ;\
	else \
	    rm -rf help ;\
	    (cd ${HELP_DIR}; tar -cf - help) | tar -xf - ;\
	fi
	touch help.tmp

#------------------------------------------------------------------------------
# Generate the test programs.
#
tclXtest: ${TEST_OBJS} ${TCLX_LIB_NAME}
	${CC} ${LD_SWITCHES} ${TEST_OBJS} ${ALL_LIBS} \
	    -o $@ || (rm -f $@; exit 1)

tclXtest.static: ${TEST_OBJS} ${TCLX_STLIB_NAME}
	${CC} ${LD_SWITCHES} ${TEST_OBJS} ${STATIC_LIBS} \
	    -o $@ || (rm -f $@; exit 1)

tclXtest.standalone: ${TEST_SAOBJS} ${TCLX_STLIB_NAME}
	${CC} ${LD_SWITCHES} ${TEST_SAOBJS} ${STATIC_LIBS} \
	    -o $@ || (rm -f $@; exit 1)

tclXtest.o: ${TCLX_GENERIC_DIR}/tclXtest.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXtest.c

tclXunixTest.o: ${TCLX_UNIX_SRC_DIR}/tclXunixTest.c
	${CC} -c ${CC_SWITCHES} ${TCLX_UNIX_SRC_DIR}/tclXunixTest.c

tclXunixTestSA.o: tclXunixTestSA.c
	${CC} -c ${CC_SWITCHES} tclXunixTestSA.c

tclXunixTestSA.c: ${TCLX_UNIX_SRC_DIR}/tclXunixTest.c
	sed -e s/Tcl_Init/Tcl_InitStandAlone/ \
	    -e s/Tclx_Init/Tclx_InitStandAlone/ \
	    ${TCLX_UNIX_SRC_DIR}/tclXunixTest.c > tclXunixTestSA.c

tclTest.o: ${TCL_SRC}/generic/tclTest.c
	${CC} -c ${CC_SWITCHES} ${TCL_SRC}/generic/tclTest.c

tclTestObj.o: ${TCL_SRC}/generic/tclTestObj.c
	${CC} -c ${CC_SWITCHES} ${TCL_SRC}/generic/tclTestObj.c

tclUnixTest.o: ${TCL_SRC}/unix/tclUnixTest.c
	${CC} -c ${CC_SWITCHES} ${TCL_SRC}/unix/tclUnixTest.c

tclThreadTest.o: ${TCL_SRC}/generic/tclThreadTest.c
	${CC} -c ${CC_SWITCHES} ${TCL_SRC}/generic/tclThreadTest.c

dltest.tmp: dltest
	touch dltest.tmp

dltest:
	if [ "@HAVE_SYML@" = "YES" -a -r ${TCL_BUILD}/unix/dltest ]; then \
	    rm -rf dltest ;\
	    ln -s `cd ${TCL_BUILD}/unix/dltest; pwd` dltest ;\
	else \
	    touch dltest ;\
	fi

#------------------------------------------------------------------------------
# Run the UCB and Extended Tcl tests.

test: ucbtests testx

test.static: ucbtests.static testx.static

test.standalone: ucbtests.standalone testx.standalone

test.verbose: ucbtests.verbose testx.verbose

ucbtests: all
	./runtest ${srcbasedir}/tcl/tests/ucbtests.tcl ${TCL_SRC}

ucbtests.static: all
	./runtest.static ${srcbasedir}/tcl/tests/ucbtests.tcl ${TCL_SRC}

ucbtests.standalone: all
	./runtest.standalone ${srcbasedir}/tcl/tests/ucbtests.tcl ${TCL_SRC}

testx: all
	./runtest -c "cd ${srcbasedir}/tcl/tests; source all"

testx.static: all
	./runtest.static -c "cd ${srcbasedir}/tcl/tests; source all"

testx.standalone: all
	./runtest.standalone -c "cd ${srcbasedir}/tcl/tests; source all"

testx.verbose: all
	./runtest -c "set VERBOSE 1;cd ${srcbasedir}/tcl/tests; source all"

#------------------------------------------------------------------------------
# Build help for Tcl & TclX.  These files are normally part of the
# distribution and not rebuilt by users.
#
buildhelp: tcl tcl.tndx
	rm -rf ${HELP_DIR} help help.tmp
	mkdir ${HELP_DIR}
	${BLDMANHELP} ${TCL_SRC}/doc ${srcbasedir}/unix/tools/tclmanpages \
	    ${HELP_DIR} Tcl.brf
	${RUNTCL} -c "buildhelp ${HELP_DIR} TclX.brf ${srcbasedir}/doc/TclX.n"

#------------------------------------------------------------------------------

install: install-binaries install-libraries install-doc

install-binaries: install-exec

install-libraries: install-runtime install-misc

install-doc:

install-misc:
	${INSTCOPY} ${TCLX_GENERIC_DIR}/tclExtend.h \
	    ${INSTALL_ROOT}${TCLX_INST_INCL}
	${INSTCOPY} ${TCLX_UNIX_SRC_DIR}/tclXAppInit.c \
	    ${INSTALL_ROOT}${TCLX_INST_RUNTIME}
	${INSTCOPY} ${HELP_DIR} ${INSTALL_ROOT}${TCLX_INST_RUNTIME}/help

install-runtime:
	${INSTCOPY} tclx.tcl tcl.tlib tcl.tndx buildidx.tcl autoload.tcl \
	    ${INSTALL_ROOT}${TCLX_INST_RUNTIME}

install-exec:
	${INSTCOPY} tcl ${INSTALL_ROOT}${TCLX_INST_BIN}
	${STRIP} ${INSTALL_ROOT}${TCLX_INST_BIN}/tcl
	if test "X@TCLX_STLIB_BUILD_REF@" != "X"; then \
	    ${INSTCOPY} ${TCLX_STLIB_NAME} ${INSTALL_ROOT}${TCLX_INST_LIB}; \
	    ${RANLIB} ${INSTALL_ROOT}${TCLX_INST_LIB}/${TCLX_STLIB_NAME}; \
	fi
	${INSTCOPY} tclxConfig.sh ${INSTALL_ROOT}${TCLX_INST_LIB}
	if test "@SHARED_BUILD@" = "1"; then \
	    ${INSTCOPY} ${TCLX_SHLIB_NAME} ${INSTALL_ROOT}${TCLX_INST_LIB} ;\
	    ${INSTCOPY} pkgIndex.tcl ${INSTALL_ROOT}${TCLX_EXEC_RUNTIME} ;\
	fi

#------------------------------------------------------------------------------
config:
	(cd ../../unix && configure)

#------------------------------------------------------------------------------

clean:
	-rm -f tclXAppInit.o ${OBJS} ${SOBJS} ${TEST_OBJS} ${TEST_SAOBJS}
	-rm -f tcl tcl.static tcl.standalone tclXAppInitSA.o
	-rm -f tclXtest tclXtest.static tclXtest.standalone
	-rm -f ${TCLX_STLIB_NAME} ${TCLX_SHLIB_NAME}
	-rm -f ${STANDALONE_SRCS} ${STANDALONE_OBJS} tclXAppInitSA.c
	-rm -f tcl.tlib tcl.tndx tclx.tcl buildidx.tcl autoload.tcl
	-rm -rf help help.tmp dltest dltest.tmp checkup.done
	-rm -f hello hello.c

#------------------------------------------------------------------------------
# Restore to the distributed state.

distclean: clean
	rm -f Makefile tclxConfig.sh pkgIndex.tcl runtest runtest.static \
	    runtest.standalone

# Disable Sun's parallel make, it doesn't get the dependencies right.
.NO_PARALLEL:

#==============================================================================
# Repetitive rules below:

#------------------------------------------------------------------------------
# Dependencies for generating objects.
#
tclXlibInit.o: ${TCLX_GENERIC_DIR}/tclXlibInit.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXlibInit.c

tclXcmdInit.o: ${TCLX_GENERIC_DIR}/tclXcmdInit.c
	${CC} -c ${CC_SWITCHES}  ${TCLX_GENERIC_DIR}/tclXcmdInit.c

tclXAppInit.o: ${TCLX_UNIX_SRC_DIR}/tclXAppInit.c
	${CC} -c ${CC_SWITCHES} ${TCLX_UNIX_SRC_DIR}/tclXAppInit.c

tclXbsearch.o: ${TCLX_GENERIC_DIR}/tclXbsearch.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXbsearch.c

tclXcmdloop.o: ${TCLX_GENERIC_DIR}/tclXcmdloop.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXcmdloop.c

tclXdebug.o: ${TCLX_GENERIC_DIR}/tclXdebug.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXdebug.c

tclXdup.o: ${TCLX_GENERIC_DIR}/tclXdup.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXdup.c

tclXfcntl.o: ${TCLX_GENERIC_DIR}/tclXfcntl.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXfcntl.c

tclXfilecmds.o: ${TCLX_GENERIC_DIR}/tclXfilecmds.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXfilecmds.c

tclXfilescan.o: ${TCLX_GENERIC_DIR}/tclXfilescan.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXfilescan.c

tclXflock.o: ${TCLX_GENERIC_DIR}/tclXflock.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXflock.c

tclXfstat.o: ${TCLX_GENERIC_DIR}/tclXfstat.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXfstat.c

tclXgeneral.o: ${TCLX_GENERIC_DIR}/tclXgeneral.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXgeneral.c

tclXhandles.o: ${TCLX_GENERIC_DIR}/tclXhandles.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXhandles.c

tclXinit.o: ${TCLX_GENERIC_DIR}/tclXinit.c Makefile
	${CC} -c ${CC_SWITCHES} -DTCLX_LIBRARY=\"${TCLX_LIBRARY_PATH}\" \
	    ${TCLX_GENERIC_DIR}/tclXinit.c

tclXinitSA.o: ${TCLX_GENERIC_DIR}/tclXinitSA.c ${STANDALONE_SRCS}
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXinitSA.c

tclXAppInitSA.c: ${TCLX_UNIX_SRC_DIR}/tclXAppInit.c
	rm -f tclXAppinitSA.c
	sed -e s/Tclx_Init/Tclx_InitStandAlone/ \
	    -e s/Tcl_Init/Tcl_InitStandAlone/ \
	    ${TCLX_UNIX_SRC_DIR}/tclXAppInit.c >tclXAppInitSA.c

tclXinitDSA.o: ${TCLX_GENERIC_DIR}/tclXinitDSA.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXinitDSA.c

tclXkeylist.o: ${TCLX_GENERIC_DIR}/tclXkeylist.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXkeylist.c

tclXlgets.o: ${TCLX_GENERIC_DIR}/tclXlgets.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXlgets.c

tclXlib.o: ${TCLX_GENERIC_DIR}/tclXlib.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXlib.c

tclXlist.o: ${TCLX_GENERIC_DIR}/tclXlist.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXlist.c

tclXmath.o: ${TCLX_GENERIC_DIR}/tclXmath.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXmath.c

tclXmsgcat.o: ${TCLX_GENERIC_DIR}/tclXmsgcat.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXmsgcat.c

tclXprocess.o: ${TCLX_GENERIC_DIR}/tclXprocess.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXprocess.c

tclXprofile.o: ${TCLX_GENERIC_DIR}/tclXprofile.c tclxConfig.sh
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXprofile.c

tclXselect.o: ${TCLX_GENERIC_DIR}/tclXselect.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXselect.c

tclXshell.o: ${TCLX_GENERIC_DIR}/tclXshell.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXshell.c

tclXsignal.o: ${TCLX_GENERIC_DIR}/tclXsignal.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXsignal.c

tclXsocket.o: ${TCLX_GENERIC_DIR}/tclXsocket.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXsocket.c

tclXstring.o: ${TCLX_GENERIC_DIR}/tclXstring.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXstring.c

tclXoscmds.o: ${TCLX_GENERIC_DIR}/tclXoscmds.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXoscmds.c

tclXutil.o: ${TCLX_GENERIC_DIR}/tclXutil.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXutil.c

tclXchmod.o: ${TCLX_GENERIC_DIR}/tclXchmod.c
	${CC} -c ${CC_SWITCHES} ${TCLX_GENERIC_DIR}/tclXchmod.c

tclXunixDup.o: ${TCLX_UNIX_SRC_DIR}/tclXunixDup.c
	${CC} -c ${CC_SWITCHES} ${TCLX_UNIX_SRC_DIR}/tclXunixDup.c

tclXid.o: ${TCLX_UNIX_SRC_DIR}/tclXid.c
	${CC} -c ${CC_SWITCHES} ${TCLX_UNIX_SRC_DIR}/tclXid.c

tclXunixCmds.o: ${TCLX_UNIX_SRC_DIR}/tclXunixCmds.c
	${CC} -c ${CC_SWITCHES} ${TCLX_UNIX_SRC_DIR}/tclXunixCmds.c

tclXunixOS.o: ${TCLX_UNIX_SRC_DIR}/tclXunixOS.c
	${CC} -c ${CC_SWITCHES} ${TCLX_UNIX_SRC_DIR}/tclXunixOS.c

tclXunixId.o: ${TCLX_UNIX_SRC_DIR}/tclXunixId.c
	${CC} -c ${CC_SWITCHES} ${TCLX_UNIX_SRC_DIR}/tclXunixId.c

tclXunixSock.o: ${TCLX_UNIX_SRC_DIR}/tclXunixSock.c
	${CC} -c ${CC_SWITCHES} ${TCLX_UNIX_SRC_DIR}/tclXunixSock.c

random.o: ${COMPAT_DIR}/random.c
	${CC} -c ${CC_SWITCHES} ${COMPAT_DIR}/random.c

rename.o: ${COMPAT_DIR}/rename.c
	${CC} -c ${CC_SWITCHES} ${COMPAT_DIR}/rename.c

#------------------------------------------------------------------------------
# Dependencies for generating objects (position independant versions).
#
tclXlibInit..o: ${TCLX_GENERIC_DIR}/tclXlibInit.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXlibInit.c
	@OBJ_RESTORE@

tclXcmdInit..o: ${TCLX_GENERIC_DIR}/tclXcmdInit.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	     ${TCLX_GENERIC_DIR}/tclXcmdInit.c
	@OBJ_RESTORE@

tclXAppInit..o: ${TCLX_GENERIC_DIR}/tclXAppInit.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXAppInit.c
	@OBJ_RESTORE@

tclXbsearch..o: ${TCLX_GENERIC_DIR}/tclXbsearch.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXbsearch.c
	@OBJ_RESTORE@

tclXcmdloop..o: ${TCLX_GENERIC_DIR}/tclXcmdloop.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXcmdloop.c
	@OBJ_RESTORE@

tclXdebug..o: ${TCLX_GENERIC_DIR}/tclXdebug.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXdebug.c
	@OBJ_RESTORE@

tclXdup..o: ${TCLX_GENERIC_DIR}/tclXdup.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXdup.c
	@OBJ_RESTORE@

tclXfcntl..o: ${TCLX_GENERIC_DIR}/tclXfcntl.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXfcntl.c
	@OBJ_RESTORE@

tclXfilecmds..o: ${TCLX_GENERIC_DIR}/tclXfilecmds.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXfilecmds.c
	@OBJ_RESTORE@

tclXfilescan..o: ${TCLX_GENERIC_DIR}/tclXfilescan.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXfilescan.c
	@OBJ_RESTORE@

tclXflock..o: ${TCLX_GENERIC_DIR}/tclXflock.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXflock.c
	@OBJ_RESTORE@

tclXfstat..o: ${TCLX_GENERIC_DIR}/tclXfstat.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXfstat.c
	@OBJ_RESTORE@

tclXgeneral..o: ${TCLX_GENERIC_DIR}/tclXgeneral.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXgeneral.c
	@OBJ_RESTORE@

tclXhandles..o: ${TCLX_GENERIC_DIR}/tclXhandles.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXhandles.c
	@OBJ_RESTORE@

tclXinit..o: ${TCLX_GENERIC_DIR}/tclXinit.c Makefile
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    -DTCLX_LIBRARY=\"${TCLX_LIBRARY_PATH}\" \
	    ${TCLX_GENERIC_DIR}/tclXinit.c
	@OBJ_RESTORE@

tclXinitDSA..o: ${TCLX_GENERIC_DIR}/tclXinitDSA.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXinitDSA.c
	@OBJ_RESTORE@

tclXkeylist..o: ${TCLX_GENERIC_DIR}/tclXkeylist.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXkeylist.c
	@OBJ_RESTORE@

tclXlgets..o: ${TCLX_GENERIC_DIR}/tclXlgets.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXlgets.c
	@OBJ_RESTORE@

tclXlib..o: ${TCLX_GENERIC_DIR}/tclXlib.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXlib.c
	@OBJ_RESTORE@

tclXlist..o: ${TCLX_GENERIC_DIR}/tclXlist.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXlist.c
	@OBJ_RESTORE@

tclXmath..o: ${TCLX_GENERIC_DIR}/tclXmath.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXmath.c
	@OBJ_RESTORE@

tclXmsgcat..o: ${TCLX_GENERIC_DIR}/tclXmsgcat.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXmsgcat.c
	@OBJ_RESTORE@

tclXprocess..o: ${TCLX_GENERIC_DIR}/tclXprocess.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXprocess.c
	@OBJ_RESTORE@

tclXprofile..o: ${TCLX_GENERIC_DIR}/tclXprofile.c tclxConfig.sh
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXprofile.c
	@OBJ_RESTORE@

tclXselect..o: ${TCLX_GENERIC_DIR}/tclXselect.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXselect.c
	@OBJ_RESTORE@

tclXshell..o: ${TCLX_GENERIC_DIR}/tclXshell.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXshell.c
	@OBJ_RESTORE@

tclXsignal..o: ${TCLX_GENERIC_DIR}/tclXsignal.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXsignal.c
	@OBJ_RESTORE@

tclXsocket..o: ${TCLX_GENERIC_DIR}/tclXsocket.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXsocket.c
	@OBJ_RESTORE@

tclXstring..o: ${TCLX_GENERIC_DIR}/tclXstring.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXstring.c
	@OBJ_RESTORE@

tclXoscmds..o: ${TCLX_GENERIC_DIR}/tclXoscmds.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXoscmds.c
	@OBJ_RESTORE@

tclXutil..o: ${TCLX_GENERIC_DIR}/tclXutil.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXutil.c
	@OBJ_RESTORE@

tclXchmod..o: ${TCLX_GENERIC_DIR}/tclXchmod.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_GENERIC_DIR}/tclXchmod.c
	@OBJ_RESTORE@

tclXid..o: ${TCLX_UNIX_SRC_DIR}/tclXid.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_UNIX_SRC_DIR}/tclXid.c
	@OBJ_RESTORE@

tclXunixCmds..o: ${TCLX_UNIX_SRC_DIR}/tclXunixCmds.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_UNIX_SRC_DIR}/tclXunixCmds.c
	@OBJ_RESTORE@

tclXunixDup..o: ${TCLX_UNIX_SRC_DIR}/tclXunixDup.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_UNIX_SRC_DIR}/tclXunixDup.c
	@OBJ_RESTORE@

tclXunixOS..o: ${TCLX_UNIX_SRC_DIR}/tclXunixOS.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_UNIX_SRC_DIR}/tclXunixOS.c
	@OBJ_RESTORE@

tclXunixId..o: ${TCLX_UNIX_SRC_DIR}/tclXunixId.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_UNIX_SRC_DIR}/tclXunixId.c
	@OBJ_RESTORE@

tclXunixSock..o: ${TCLX_UNIX_SRC_DIR}/tclXunixSock.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${TCLX_UNIX_SRC_DIR}/tclXunixSock.c
	@OBJ_RESTORE@

random..o: ${COMPAT_DIR}/random.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${COMPAT_DIR}/random.c
	@OBJ_RESTORE@

rename..o: ${COMPAT_DIR}/rename.c
	@OBJ_SAVE@
	${CC} -c ${CC_SHOBJ_FLAG} ${CC_SWITCHES} ${TCL_SHLIB_CFLAGS} \
	    ${COMPAT_DIR}/rename.c
	@OBJ_RESTORE@

#------------------------------------------------------------------------------
# Rules to build standalone .c files using tcl2c.  Explicit rules are required,
# as not all makes can handle cross-directory rules.

arrayprocs.c: ${RUNTIME_DIR}/arrayprocs.tcl
	${TCL2C} -o $@ -a -n $@ $<
compat.c: ${RUNTIME_DIR}/compat.tcl
	${TCL2C} -o $@ -a -n $@ $<
convlib.c: ${RUNTIME_DIR}/convlib.tcl
	${TCL2C} -o $@ -a -n $@ $<
edprocs.c: ${RUNTIME_DIR}/edprocs.tcl
	${TCL2C} -o $@ -a -n $@ $<
events.c: ${RUNTIME_DIR}/events.tcl
	${TCL2C} -o $@ -a -n $@ $<
forfile.c: ${RUNTIME_DIR}/forfile.tcl
	${TCL2C} -o $@ -a -n $@ $<
globrecur.c: ${RUNTIME_DIR}/globrecur.tcl
	${TCL2C} -o $@ -a -n $@ $<
help.c: ${RUNTIME_DIR}/help.tcl
	${TCL2C} -o $@ -a -n $@ $<
profrep.c: ${RUNTIME_DIR}/profrep.tcl
	${TCL2C} -o $@ -a -n $@ $<
pushd.c: ${RUNTIME_DIR}/pushd.tcl
	${TCL2C} -o $@ -a -n $@ $<
setfuncs.c: ${RUNTIME_DIR}/setfuncs.tcl
	${TCL2C} -o $@ -a -n $@ $<
showproc.c: ${RUNTIME_DIR}/showproc.tcl
	${TCL2C} -o $@ -a -n $@ $<
stringfile.c: ${RUNTIME_DIR}/stringfile.tcl
	${TCL2C} -o $@ -a -n $@ $<
tcllib.c: ${RUNTIME_DIR}/tcllib.tcl
	${TCL2C} -o $@ -a -n $@ $<
fmath.c: ${RUNTIME_DIR}/fmath.tcl
	${TCL2C} -o $@ -a -n $@ $<
buildhelp.c: ${RUNTIME_DIR}/buildhelp.tcl
	${TCL2C} -o $@ -a -n $@ $<
buildidx.c: ${RUNTIME_DIR}/buildidx.tcl
	${TCL2C} -o $@ -a -n $@ $<
autoload.c: ${RUNTIME_DIR}/autoload.tcl
	${TCL2C} -o $@ -a -n $@ $<
tclx.c: ${RUNTIME_DIR}/tclx.tcl
	${TCL2C} -o $@ -a -n $@ $<
hello.c: ${TCLX_GENERIC_DIR}/hello.tcl
	${TCL2C} -o $@ -tclx $<
.c.o:
	${CC} -c ${CC_SWITCHES} $<

