# Generated automatically from Makefile.in by configure.
#
# This file is a Makefile for [incr 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.
#
# RCS: $Id: Makefile.in,v 1.6 1998/11/06 15:19:48 timmer Exp $

# Current [incr Tcl] version;  used in various names.

MAJOR_VERSION = 2
MINOR_VERSION = 0
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION)

#----------------------------------------------------------------
# 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
# [incr Tcl] scripts (note: you can set the ITCL_LIBRARY environment
# variable at run-time to override this value):
ITCL_LIBRARY = $(prefix)/lib/itcl$(VERSION)

# Path name to use when installing library scripts:
SCRIPT_INSTALL_DIR =	$(INSTALL_ROOT)$(ITCL_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 itcl.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 itclsh:
MAN1_INSTALL_DIR =	$(MAN_INSTALL_DIR)/man1

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

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

# Tcl source directory is included in this distribution:
TCL_DIR = ./../tcl7.4

# The directory containing the Tcl library archive file appropriate
# for this version of [incr Tcl]:
TCL_LIB_DIR = $(exec_prefix)/lib
TCL_INCLUDE = $(prefix)/include

# 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.
MATH_LIBS = -lieee -lm
LIBS = $(TCL_LIB_DIR)/libtcl.a  $(MATH_LIBS) -lm -lnsl -lresolv -ldl

# 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

# 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

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

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
INSTALL =		/usr/bin/install -c
RANLIB =		ranlib
SRC_DIR =		.

SHLIB_CCFLAGS  = -fpic
SHLIB_LDFLAGS  = -shared
SHLIB_LD       = gcc
SHLIB_SUFFIX   = .so.$(MAJOR_VERSION)
SHARED_LIB     = libitcl$(SHLIB_SUFFIX)

#----------------------------------------------------------------
# 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
CC_SWITCHES = $(CFLAGS) -I. -I$(SRC_DIR) -I$(TCL_INCLUDE) \
	$(AC_FLAGS) $(PROTO_FLAGS) $(MEM_DEBUG_FLAGS) \
	-DITCL_LIBRARY=\"$(ITCL_LIBRARY)\"

SRCS = itcl_bicmds.c itcl_class.c itcl_cmds.c itcl_linkage.c \
	itcl_methods.c itcl_objects.c itcl_obsolete.c itcl_parse.c \
	itcl_util.c tclAppInit.c

OBJS = itcl_bicmds.o itcl_class.o itcl_cmds.o itcl_linkage.o \
	itcl_methods.o itcl_objects.o itcl_obsolete.o itcl_parse.o \
	itcl_util.o

SHOBJS = itcl_bicmds.so itcl_class.so itcl_cmds.so itcl_linkage.so \
	itcl_methods.so itcl_objects.so itcl_obsolete.so itcl_parse.so \
	itcl_util.so

all: libitcl.a itclsh

libitcl.a: $(OBJS)
	rm -f $@
	ar cr $@ $(OBJS)
	$(RANLIB) $@

$(SHARED_LIB): $(SHOBJS)
	rm -f $@
	$(SHLIB_LD) $(SHLIB_LDFLAGS) -o $@ $(SHOBJS)

itclsh: tclAppInit.o libitcl.a
	$(CC) $(CC_SWITCHES) tclAppInit.o libitcl.a $(LIBS) -lm -lnsl -lresolv -ldl -o itclsh

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

shared: $(SHARED_LIB)
	@for i in $(LIB_INSTALL_DIR) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@echo "Installing $(SHARED_LIB)"
	@$(INSTALL_DATA) $(SHARED_LIB) $(LIB_INSTALL_DIR)

install: install-binaries install-libraries install-man

install-binaries: libitcl.a itclsh
	@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 libitcl$(VERSION).a in " $(LIB_INSTALL_DIR)
	@$(INSTALL_DATA) libitcl.a $(LIB_INSTALL_DIR)/libitcl$(VERSION).a
	@$(RANLIB) $(LIB_INSTALL_DIR)/libitcl$(VERSION).a
	@echo "Installing itclsh$(VERSION) in" $(BIN_INSTALL_DIR)
	@$(INSTALL_PROGRAM) itclsh $(BIN_INSTALL_DIR)/itclsh$(VERSION)
	@rm -f $(BIN_INSTALL_DIR)/itclsh
	@ln -s $(BIN_INSTALL_DIR)/itclsh$(VERSION) $(BIN_INSTALL_DIR)/itclsh

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 itcl.h in" $(INCLUDE_INSTALL_DIR)
	@$(INSTALL_DATA) $(SRC_DIR)/itcl.h $(INCLUDE_INSTALL_DIR)
	@echo "Installing itclInt.h in" $(INCLUDE_INSTALL_DIR)
	@$(INSTALL_DATA) $(SRC_DIR)/itclInt.h $(INCLUDE_INSTALL_DIR)
	@for i in $(SRC_DIR)/library/*.* $(SRC_DIR)/tclAppInit.c; \
	    do \
	    echo "Installing $$i in" $(SCRIPT_INSTALL_DIR); \
	    $(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 *.so.* core errs *~ \#* TAGS *.E a.out errors \
	rm -f itclsh *pure*

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

pure: tclAppInit.o libitcl.a
	purify $(CC) $(CC_SWITCHES) tclAppInit.o libitcl.a $(LIBS) -o itclsh

profile: tclAppInit.o libitcl.a
	quantify $(CC) $(CC_SWITCHES) tclAppInit.o libitcl.a $(LIBS) -o itclsh

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

configure: configure.in
	autoconf

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

.SUFFIXES:	.so $(SUFFIXES)
.c.so:
	@rm -f $@
	$(CC) -c $(CC_SWITCHES) $(SHLIB_CCFLAGS) $<
	mv $*.o $@

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