# Generated automatically from Makefile.in by configure.
#
# This file is a Makefile for [incr Tk].  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/09 15:37:04 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 Tcl
# scripts (note: you can set the ITK_LIBRARY environment variable at
# run-time to override the compiled-in location):
ITK_LIBRARY = $(prefix)/lib/itk$(VERSION)

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

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

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

# Directory from which the program wish should be referenced by scripts:
BIN_DIR =		$(exec_prefix)/bin

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

# Top-level directory for manual entries:
MAN_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/man

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

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

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

# The directory containing the Tcl sources and headers appropriate
# for this version of [incr Tk] ("srcdir" will be replaced or has already
# been replaced by the configure script):
TCL_DIR =		./../tcl7.4
TCL_INC =		$(prefix)/include

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

# The directory containing the Tk sources and headers appropriate
# for this version of [incr Tk] ("srcdir" will be replaced or has
# already been replaced by the configure script):
TK_DIR =		./../tk4.0

# The directory containing the Tk library archive file appropriate
# for this version of [incr Tk]:
TK_LIB_DIR =		$(exec_prefix)/lib

# The directory containing the [incr Tcl] sources and headers appropriate
# for this version of [incr Tk] ("srcdir" will be replaced or has already
# been replaced by the configure script):
ITCL_DIR =		./../itcl

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

# A "-I" switch that can be used when compiling to make all of the
# X11 include files accessible (the configure script will try to
# set this value, and will cause it to be an empty string if the
# include files are accessible via /usr/include).
X11_INCLUDES =		-I/usr/X11R6/include

# Linker switch(es) to use to link with the X11 library archive (the
# configure script will try to set this value automatically, but you
# can override it).
X11_LIB_SWITCHES =	-L/usr/X11R6/lib -lXpm -lXext -lXt -lX11

# Libraries to use when linking:  must include at least Tk, Tcl, Xlib,
# and the math library (in that order).  The "LIBS" part will be
# replaced (or has already been replaced) with relevant libraries as
# determined by the configure script.
LIBS = libitk.a $(TK_LIB_DIR)/libtk.a \
	$(ITCL_LIB_DIR)/libitcl2.0.a $(TCL_LIB_DIR)/libtcl.a \
	$(X11_LIB_SWITCHES)  -lm -lnsl -lresolv -ldl -lieee -lm

# 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     = libitk$(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_SWITCHES = $(CFLAGS) -I$(SRC_DIR) -I$(TCL_INC) \
$(X11_INCLUDES) $(AC_FLAGS) $(PROTO_FLAGS) $(MEM_DEBUG_FLAGS) \
-DITK_LIBRARY=\"$(ITK_LIBRARY)\"

SRCS = itk_cmds.c itk_option.c itk_archetype.c itk_util.c

OBJS = itk_cmds.o itk_option.o itk_archetype.o itk_util.o

SHOBJS = itk_cmds.so itk_option.so itk_archetype.so itk_util.so

all: libitk.a itkwish

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

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

itkwish: tkAppInit.o libitk.a
	$(CC) $(CC_SWITCHES) tkAppInit.o $(LIBS) -lm -lnsl -lresolv -ldl -o itkwish

test: itkwish
	@cwd=`pwd`; \
	cd $(TCL_DIR); TCL_LIBRARY=`pwd`/library; export TCL_LIBRARY; \
	cd $$cwd; cd $(ITCL_DIR); ITCL_LIBRARY=`pwd`/library; export ITCL_LIBRARY; \
	cd $$cwd; cd $(TK_DIR); TK_LIBRARY=`pwd`/library; export TK_LIBRARY; \
	cd $$cwd; cd $(SRC_DIR); ITK_LIBRARY=`pwd`/library; export ITK_LIBRARY; \
	cd $$cwd; ( echo cd $(SRC_DIR)/tests\; source all\; exit ) | ./itkwish

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

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 itk.h in" $(INCLUDE_INSTALL_DIR)
	@$(INSTALL_DATA) $(SRC_DIR)/itk.h $(INCLUDE_INSTALL_DIR)
	for i in $(SRC_DIR)/library/*.* $(SRC_DIR)/library/tclIndex $(SRC_DIR)/tkAppInit.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 itkwish *pure*

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

pure: tkAppInit.o libitk.a
	purify $(CC) $(CC_SWITCHES) tkAppInit.o libitk.a $(LIBS) -lm -lnsl -lresolv -ldl -o itkwish

profile: tkAppInit.o libitk.a
	quantify $(CC) $(CC_SWITCHES) tkAppInit.o libitk.a $(LIBS) -lm -lnsl -lresolv -ldl -o itkwish

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.
