# 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.2 1996/02/29 20:45:22 mulferts Exp $

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

MAJOR_VERSION = 2
MINOR_VERSION = 0
SUBMINOR_VERSION = 1
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 =	/net/gnu
exec_prefix =	${prefix}

# 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):
IWIDGETS_LIBRARY = $(prefix)/lib/iwidgets$(VERSION).$(SUBMINOR_VERSION)

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

# Directory containing the installation of [incr Tk] scripts.
# The "init.iwidgets" file is put here to automatically bootstrap
# [incr Widgets] upon startup.
ITK_LIBRARY = $(prefix)/lib/itk$(VERSION)

# Path name to use when installing library scripts:
ITK_SCRIPT_INSTALL_DIR =	$(INSTALL_ROOT)$(ITK_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

# Directory in which to install html version of manual entries:
HTML_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/doc

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

# Tk source directory is included in this distribution:
TK_DIR = ./../tk4.1

# [incr Tcl] source directory is included in this distribution:
ITCL_DIR = ./../itcl

# [incr Tk] source directory is included in this distribution:
ITK_DIR = ./../itk

# 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 =		 
INSTALL_PROGRAM =	${INSTALL}
INSTALL_DATA =		${INSTALL} -m 644
INSTALL =		/usr/local/bin/install -c
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.
#----------------------------------------------------------------

all: init-iwidgets

init-iwidgets:
	@rm -f init.iwidgets
	cat $(SRC_DIR)/init.iwidgets.in \
		| sed -e "s#@IWIDGETS_LIBRARY@#$(IWIDGETS_LIBRARY)#g" \
		> init.iwidgets

test: ../itk/itkwish
	@cwd=`pwd`; \
	cd $$cwd; 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 $(ITK_DIR); ITK_LIBRARY=`pwd`/library; export ITK_LIBRARY; \
	cd $$cwd; cd $(SRC_DIR); IWIDGETS_LIBRARY=`pwd`; export IWIDGETS_LIBRARY; \
	cd $$cwd; ( echo source init.iwidgets\; cd $(SRC_DIR)/tests\; source all\; exit ) | $$cwd/../itk/itkwish

install: install-libraries install-demos install-tests install-man

install-libraries:
	@for i in $(INSTALL_ROOT)$(prefix)/lib $(SCRIPT_INSTALL_DIR) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@for i in $(SRC_DIR)/*.itk $(SRC_DIR)/*.itcl $(SRC_DIR)/tclIndex ; \
	    do \
	    echo "Installing $$i"; \
	    $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
	    done;
	@for i in init.iwidgets ; \
	    do \
	    echo "Installing $$i"; \
	    $(INSTALL_DATA) $$i $(ITK_SCRIPT_INSTALL_DIR); \
	    done;

install-demos:
	@for i in $(INSTALL_ROOT)$(prefix)/lib $(SCRIPT_INSTALL_DIR) \
		$(SCRIPT_INSTALL_DIR)/demos; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@for i in $(SRC_DIR)/demos/*; \
	    do \
	    if [ -f $$i ] ; then \
		echo "Installing $$i"; \
		$(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/demos; \
	    fi; \
	    done;
	@for i in $(SCRIPT_INSTALL_DIR)/demos/*; \
	    do \
		chmod 755 $$i; \
	    done;

install-tests:
	@for i in $(INSTALL_ROOT)$(prefix)/lib $(SCRIPT_INSTALL_DIR) \
		$(SCRIPT_INSTALL_DIR)/tests; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@for i in $(SRC_DIR)/tests/*; \
	    do \
	    if [ -f $$i ] ; then \
		echo "Installing $$i"; \
		$(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/tests; \
	    fi; \
	    done;

install-man:
	@for i in $(MAN_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 *.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;

install-html:
	@for i in $(HTML_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 *.n; \
	    do \
	    echo "Generating $(HTML_INSTALL_DIR)/$$i.html"; \
	    rm -f $(HTML_INSTALL_DIR)/$$i.html; \
            $(SRC_DIR)/tk2html $(MANN_INSTALL_DIR)/$$i > $(HTML_INSTALL_DIR)/$$i.html; \
	    chmod 444 $(HTML_INSTALL_DIR)/$$i.html; \
	    done;

Makefile: $(SRC_DIR)/Makefile.in
	$(SHELL) config.status

clean:
	rm -f core errs *~ \#* TAGS *.E a.out errors
	rm -f init.iwidgets

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

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

configure: configure.in
	autoconf

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