# Generated automatically from Makefile.in by configure.
#
# This file is a Makefile for Tcl.  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.
#
# @(#) Makefile.in 1.24 95/07/27 12:40:13

# Current Tcl version;  used in various names.

VERSION = 7.4

#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
# site (you can make these changes in either Makefile.in or
# Makefile, but changes to Makefile will get lost if you re-run
# the configuration script).
#----------------------------------------------------------------

# Default top-level directories in which to install architecture-
# specific files (exec_prefix) and machine-independent files such
# as scripts (prefix).  The values specified here may be overridden
# at configure-time with the --exec-prefix and --prefix options
# to the "configure" script.

prefix =	/usr/local/coda/2.5/common
exec_prefix =	/usr/local/coda/2.5/Linux

# The following definition can be set to non-null for special systems
# like AFS with replication.  It allows the pathnames used for installation
# to be different than those used for actually reference files at
# run-time.  INSTALL_ROOT is prepended to $prefix and $exec_prefix
# when installing files.
INSTALL_ROOT =

# Directory from which applications will reference the library of Tcl
# scripts (note: you can set the TCL_LIBRARY environment variable at
# run-time to override this value):
TCL_LIBRARY =	$(prefix)/lib/tcl$(VERSION)

# Path name to use when installing library scripts:
SCRIPT_INSTALL_DIR =	$(INSTALL_ROOT)$(TCL_LIBRARY)

# Directory in which to install the archive libtcl.a:
LIB_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/lib

# Directory in which to install the program tclsh:
BIN_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/bin

# Directory in which to install the include file tcl.h:
INCLUDE_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/include

# Top-level directory in which to install manual entries:
MAN_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/man

# Directory in which to install manual entry for tclsh:
MAN1_INSTALL_DIR =	$(MAN_INSTALL_DIR)/man1

# Directory in which to install manual entries for Tcl's C library
# procedures:
MAN3_INSTALL_DIR =	$(MAN_INSTALL_DIR)/man3

# Directory in which to install manual entries for the built-in
# Tcl commands:
MANN_INSTALL_DIR =	$(MAN_INSTALL_DIR)/mann

# Additional libraries to use when linking.  The "LIBS" part will be
# replaced (or has already been replaced) with relevant libraries as
# determined by the configure script.
LIBS = 

# To change the compiler switches, for example to change from -O
# to -g, change the following line:
CFLAGS = 

# To disable ANSI-C procedure prototypes reverse the comment characters
# on the following lines:
PROTO_FLAGS =
#PROTO_FLAGS = -DNO_PROTOTYPE

# Mathematical functions like sin and atan2 are enabled for expressions
# by default.  To disable them, reverse the comment characters on the
# following pairs of lines:
MATH_FLAGS =
#MATH_FLAGS = -DTCL_NO_MATH
MATH_LIBS = -lieee -lm
#MATH_LIBS =

# To compile for non-UNIX systems (so that only the non-UNIX-specific
# commands are available), reverse the comment characters on the
# following pairs of lines.  In addition, you'll have to provide your
# own replacement for the "panic" procedure (see panic.c for what
# the current one does).
GENERIC_FLAGS =
#GENERIC_FLAGS = -DTCL_GENERIC_ONLY
UNIX_OBJS = panic.o tclEnv.o tclGlob.o tclMain.o tclMtherr.o \
	tclUnixAZ.o tclUnixStr.o tclUnixUtil.o 
#UNIX_OBJS =

# For the compiling of vxWorks, the following provides flags & inclcudes
VXWORKS_FLAGS = 
VXWORKS_INC   = 
COMPILE_TCLSH = ${CC} ${CC_SWITCHES}

# To enable memory debugging reverse the comment characters on the following
# lines.  Warning:  if you enable memory debugging, you must do it
# *everywhere*, including all the code that calls Tcl, and you must use
# ckalloc and ckfree everywhere instead of malloc and free.
MEM_DEBUG_FLAGS =
#MEM_DEBUG_FLAGS = -DTCL_MEM_DEBUG

# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:
SHELL =		/bin/sh

# Tcl used to let the configure script choose which program to use
# for installing, but there are just too many different versions of
# "install" around;  better to use the install-sh script that comes
# with the distribution, which is slower but guaranteed to work.

INSTALL = ./install-sh -c

#----------------------------------------------------------------
# The information below is modified by the configure script when
# Makefile is generated from Makefile.in.  You shouldn't normally
# modify any of this stuff by hand.
#----------------------------------------------------------------

COMPAT_OBJS =		
AC_FLAGS =		 -DLINUX=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRERROR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_STRDUP=1 -DHAVE_STRCASECMP=1 -DHAVE_UNISTD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_FCNTL_H=1 -DNO_STREAM_H=1 -DNO_UN_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_TOLOWER=1 -DHAVE_NTOHL=1 -DSTDC_HEADERS=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_FLOAT_H=1 -DHAVE_MALLOC_H=1 -DHAVE_ERRNO_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MEMORY_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_WAIT_H=1 -DTIME_WITH_SYS_TIME=1 -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -DSVIPC_NO_UNION_SEMUN=1 -DTK_FILE_READ_PTR=1 
INSTALL_PROGRAM =	${INSTALL}
INSTALL_DATA =		${INSTALL} -m 644
RANLIB =		ranlib
SRC_DIR =		.

#----------------------------------------------------------------
# The information below should be usable as is.  The configure
# script won't modify it and you shouldn't need to modify it
# either.
#----------------------------------------------------------------


CC =		gcc
#CC = /usr/local/gcc-bounds/xgcc -B/usr/local/gcc-bounds/ -fbounds-checking
CPP =		cc -E
LD =		ld
AR =		ar
NM =		nm
LDFLAGS=	
LIBDIR=		-L.

CC_SWITCHES =	${CFLAGS} -I. -I${SRC_DIR} ${AC_FLAGS} ${MATH_FLAGS} \
${VXWORKS_INC} ${VXWORKS_FLAGS}	\
${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \
-DTCL_LIBRARY=\"${TCL_LIBRARY}\" -fwritable-strings -D_POSIX_THREADS

GENERIC_OBJS =	regexp.o tclAsync.o tclBasic.o tclCkalloc.o \
	tclCmdAH.o tclCmdIL.o tclCmdMZ.o tclCmdLv.o tclExpr.o tclGet.o \
	tclHash.o tclHistory.o tclLink.o tclParse.o tclProc.o \
	tclToCUtil.o tclUser.o tclUtil.o tclVar.o tclVarUtil.o \
	itcl_cmds.o itcl_ensemble.o itcl_namesp.o itcl_util.o \
	tclcTestInit.o 

SO_OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS}
OBJS = ${GENERIC_OBJS} ${UNIX_OBJS} ${COMPAT_OBJS}

SRCS= regexp.c tclAsync.c tclBasic.c tclCkalloc.c \
	tclCmdAH.c tclCmdIL.c tclCmdLv.c tclCmdMZ.c tclExpr.c tclGet.c \
	tclHash.c tclHistory.c tclLink.c tclParse.c tclProc.c \
	tclToCUtil.c tclUser.c tclUtil.c tclVar.c panic.c tclEnv.c \
	tclGlob.c tclMain.c \
	tclMtherr.c tclUnixAZ.c tclUnixStr.c tclUnixUtil.c \
	tclVarUtil.c itcl_cmds.c itcl_ensemble.c itcl_namesp.c itcl_util.c \
	tclTest.c tclAppInit.c tclcTestInit.c 

all: libtcl.a tclsh

libtcl.a: ${OBJS}
	rm -f libtcl.a
	$(AR) cr libtcl.a ${OBJS}
	$(RANLIB) libtcl.a

libtcl.so: ${SO_OBJS}
	rm -f libtcl.so
	ld -o libtcl.so $(SO_LDFLAGS) ${SO_OBJS}

libtcl.sa: tclMtherr.o
	rm -f libtcl.sa
	ar cr libtcl.sa tclMtherr.o
	$(RANLIB) libtcl.sa

tclsh: tclAppInit.o libtcl.a
	${COMPILE_TCLSH} tclAppInit.o libtcl.a ${LIB_DIR} ${LIBS} ${MATH_LIBS} -lm -lnsl -lresolv -ldl -o tclsh

tcl7.4.o: ${OBJS}
	${COMPILE_TCLSH} ${OBJS} -o tcl7.4.o

tcltest: tclTest.o libtcl.a
	${CC} ${CC_SWITCHES} -c -D__INTERNAL__ -o tclCmdLv.o tclCmdLv.c
	${CC} ${CC_SWITCHES} tclTest.o tclCmdLv.o libtcl.a ${MATH_LIBS} \
-o tcltest
	rm -f tclCmdLv.o

test: tcltest
	@cwd=`pwd`; \
	cd $(SRC_DIR); TCL_LIBRARY=`pwd`/library; export TCL_LIBRARY; \
	cd $$cwd; ( echo cd $(SRC_DIR)/tests\; source all ) | ./tcltest

test-noitcl: tcltest
	@cwd=`pwd`; \
	cd $(SRC_DIR); TCL_LIBRARY=`pwd`/library; export TCL_LIBRARY; \
	cd $$cwd; ( echo cd $(SRC_DIR)/tests.noitcl\; source all ) | ./tcltest

configInfo: Makefile
	@rm -f configInfo
	@echo "# Definitions and libraries needed to build Tcl applications" >> configInfo
	@echo "# (generated by the configure script):" >> configInfo
	@echo "TCL_CC_SWITCHES = ${AC_FLAGS} ${VXWORKS_FLAGS} ${MEM_DEBUG_FLAGS}" >> configInfo
	@echo "TCL_LIBS = ${LIBS} ${MATH_LIBS}" >> configInfo

install: install-binaries install-libraries install-man

install-binaries: libtcl.a tclsh
	@for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@echo "Installing libtcl.a"
	@$(INSTALL_DATA) libtcl.a $(LIB_INSTALL_DIR)/libtcl.a
	@echo "Installing libtcl$(VERSION).a"
	@$(INSTALL_DATA) libtcl.a $(LIB_INSTALL_DIR)/libtcl$(VERSION).a
	@$(RANLIB) $(LIB_INSTALL_DIR)/libtcl$(VERSION).a
	@echo "Installing tclsh$(VERSION)"
	@$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh$(VERSION)
	@echo "Installing tclsh"
	@$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh
	@echo "Installing tcl2c"
	@$(INSTALL_PROGRAM) tcl2c $(BIN_INSTALL_DIR)/tcl2c
#	@echo "Installing tcl7.4.o"
#	@$(INSTALL_PROGRAM) tcl7.4.o $(BIN_INSTALL_DIR)/tcl7.4.o

install-vxworks: libtcl.a tclsh
	@for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@echo "Installing libtcl.a"
	@$(INSTALL_DATA) libtcl.a $(LIB_INSTALL_DIR)/libtcl.a
	@echo "Installing libtcl$(VERSION).a"
	@$(INSTALL_DATA) libtcl.a $(LIB_INSTALL_DIR)/libtcl$(VERSION).a
	@$(RANLIB) $(LIB_INSTALL_DIR)/libtcl$(VERSION).a
	@echo "Installing tclsh$(VERSION)"
	@$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh$(VERSION)
	@echo "Installing tclsh"
	@$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh
	@echo "Installing tcl7.4.o"
	@$(INSTALL_PROGRAM) tcl7.4.o $(BIN_INSTALL_DIR)/tcl7.4.o

install-shared: libtcl.so libtcl.sa
	@echo "Installing libtcl.so"
	@$(INSTALL_DATA) libtcl.so $(LIB_INSTALL_DIR)
	@echo "Installing libtcl.sa"
	@$(INSTALL_DATA) libtcl.sa $(LIB_INSTALL_DIR)

install-libraries:
	@for i in $(INSTALL_ROOT)$(prefix)/lib $(INCLUDE_INSTALL_DIR) \
		$(SCRIPT_INSTALL_DIR) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@echo "Installing tcl.h in" $(INCLUDE_INSTALL_DIR)
	@$(INSTALL_DATA) $(SRC_DIR)/tcl.h $(INCLUDE_INSTALL_DIR)
	@echo "Installing tclInt.h"
	@$(INSTALL_DATA) $(SRC_DIR)/tclInt.h $(INCLUDE_INSTALL_DIR)
	@echo "Installing tclPort.h"
	@$(INSTALL_DATA) $(SRC_DIR)/tclPort.h $(INCLUDE_INSTALL_DIR)
	@echo "Installing tclRegexp.h"
	@$(INSTALL_DATA) $(SRC_DIR)/tclRegexp.h $(INCLUDE_INSTALL_DIR)
	@echo "Installing tclToCProto.h"
	@$(INSTALL_DATA) $(SRC_DIR)/tclToCProto.h $(INCLUDE_INSTALL_DIR)
	@echo "Installing tclToC.h.h"
	@$(INSTALL_DATA) $(SRC_DIR)/tclToC.h $(INCLUDE_INSTALL_DIR)
	@echo "Installing tclToCProto.h"
	@for i in $(SRC_DIR)/library/*.tcl $(SRC_DIR)/library/tclIndex $(SRC_DIR)/tclAppInit.c; \
	    do \
	    echo "Installing $$i"; \
	    $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
	    done;

install-man:
	@for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@cd $(SRC_DIR)/doc; for i in *.1; \
	    do \
	    echo "Installing doc/$$i"; \
	    rm -f $(MAN1_INSTALL_DIR)/$$i; \
	    sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
		    $$i > $(MAN1_INSTALL_DIR)/$$i; \
	    chmod 444 $(MAN1_INSTALL_DIR)/$$i; \
	    done;
	@cd $(SRC_DIR)/doc; for i in *.3; \
	    do \
	    echo "Installing doc/$$i"; \
	    rm -f $(MAN3_INSTALL_DIR)/$$i; \
	    sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
		    $$i > $(MAN3_INSTALL_DIR)/$$i; \
	    chmod 444 $(MAN3_INSTALL_DIR)/$$i; \
	    done;
	@cd $(SRC_DIR)/doc; for i in *.n; \
	    do \
	    echo "Installing doc/$$i"; \
	    rm -f $(MANN_INSTALL_DIR)/$$i; \
	    sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
		    $$i > $(MANN_INSTALL_DIR)/$$i; \
	    chmod 444 $(MANN_INSTALL_DIR)/$$i; \
	    done;

Makefile: $(SRC_DIR)/Makefile.in
	echo

clean:
	rm -f *.a *.o *.so *.sa core errs *~ \#* TAGS *.E a.out errors \
	tclsh tcltest config.info *pure*; cd tests; \
	$(MAKE) clean;

distclean: clean
	rm -f Makefile config.status config.cache

depend:
	makedepend -- $(CC_SWITCHES) -- $(SRCS)

fixstrtod.o: $(SRC_DIR)/compat/fixstrtod.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/fixstrtod.c

getcwd.o: $(SRC_DIR)/compat/getcwd.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/getcwd.c

opendir.o: $(SRC_DIR)/compat/opendir.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/opendir.c

strerror.o: $(SRC_DIR)/compat/strerror.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strerror.c

strncasecmp.o: $(SRC_DIR)/compat/strncasecmp.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strncasecmp.c

strstr.o: $(SRC_DIR)/compat/strstr.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strstr.c

strtod.o: $(SRC_DIR)/compat/strtod.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strtod.c

strtol.o: $(SRC_DIR)/compat/strtol.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strtol.c

strtoul.o: $(SRC_DIR)/compat/strtoul.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/strtoul.c

tmpnam.o: $(SRC_DIR)/compat/tmpnam.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/tmpnam.c

waitpid.o: $(SRC_DIR)/compat/waitpid.c
	$(CC) -c $(CC_SWITCHES) $(SRC_DIR)/compat/waitpid.c

.c.o:
	$(CC) -c $(CC_SWITCHES) $<

#
# Target to check for proper usage of UCHAR macro.
#

checkuchar:
	-egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit $(SRCS) | grep -v UCHAR

#
# Target to make sure that only symbols with "Tcl" prefixes are
# exported.
#

checkexports: libtcl.a
	-nm -p libtcl.a | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]cl'

#
# Target to create a proper Tcl distribution from information in the
# master source directory.  DISTDIR must be defined to indicate where
# to put the distribution.
#

configure: configure.in
	autoconf
dist: configure
	rm -rf $(DISTDIR)
	mkdir $(DISTDIR)
	cp Makefile.in $(DISTDIR)
	chmod 664 $(DISTDIR)/Makefile.in
	cp -p $(SRCS) $(DISTDIR)
	cp -p tclRegexp.h tcl.h tclInt.h tclPort.h patchlevel.h $(DISTDIR)
	cp configure configure.in $(DISTDIR)
	chmod 775 $(DISTDIR)/configure $(DISTDIR)/configure.in
	cp -p changes README porting.notes porting.old license.terms \
		install-sh $(DISTDIR)
	chmod +x $(DISTDIR)/install-sh
	mkdir $(DISTDIR)/library
	cp -p license.terms library/*.tcl library/tclIndex $(DISTDIR)/library
	mkdir $(DISTDIR)/doc
	cp -p license.terms doc/*.[13n] doc/man.macros $(DISTDIR)/doc
	mkdir $(DISTDIR)/compat
	cp -p license.terms compat/*.c compat/*.h compat/README \
		$(DISTDIR)/compat
	mkdir $(DISTDIR)/tests
	cp -p license.terms $(DISTDIR)/tests
	cp -p tests/*.test tests/README tests/all tests/defs $(DISTDIR)/tests

# DO NOT DELETE THIS LINE -- make depend depends on it.
