#
# This file is a Makefile for [incr Widgets].  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.17 2017/07/07 18:29:13 dgp Exp $

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

ITCL_VERSION = @itcl_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).
#----------------------------------------------------------------

# Pointer to lib dirs needed during testing:
TCL_SRC_DIR	= @TCL_SRC_DIR@
TK_SRC_DIR	= @TK_SRC_DIR@
ITCL_SRC_DIR	= @itcl_SRC_DIR@
ITK_SRC_DIR	= @ITK_SRC_DIR@

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

srcdir		= @srcdir@
prefix		= @prefix@
exec_prefix	= @exec_prefix@

bindir		= @bindir@
libdir		= @libdir@
datadir		= @datadir@
mandir		= @mandir@
includedir	= @includedir@

DESTDIR		=

PACKAGE_NAME	= @PACKAGE_NAME@
PACKAGE_VERSION	= @PACKAGE_VERSION@

top_builddir	= .

PKG_DIR		= $(PACKAGE_NAME)$(PACKAGE_VERSION)
pkgdatadir	= $(DESTDIR)$(datadir)/$(PKG_DIR)
pkglibdir	= $(DESTDIR)$(libdir)/$(PKG_DIR)
pkgincludedir	= $(DESTDIR)$(includedir)/$(PKG_DIR)

# Top-level directory in which to install manual entries:
MAN_INSTALL_DIR = $(DESTDIR)$(mandir)/mann

INSTALL		= @INSTALL@
INSTALL_PROGRAM	= @INSTALL_PROGRAM@
INSTALL_DATA	= @INSTALL_DATA@
INSTALL_SCRIPT	= @INSTALL_SCRIPT@
SHELL		= @SHELL@
TOP_DIR		= $(srcdir)
GENERIC_DIR	= $(TOP_DIR)/generic

EXTRA_PATH	= $(TCL_BIN_DIR):$(TK_BIN_DIR):$(ITCL_LIB_DIR):$(ITK_LIB_DIR)
TCLSH_ENV	= TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \
		  TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` \
		  ITCL_LIBRARY=`@CYGPATH@ @ITCL_LIB_DIR@` \
		  ITK_LIBRARY=`@CYGPATH@ @ITK_LIB_DIR@` \
		  IWIDGETS_LIBRARY=`@CYGPATH@ $(srcdir)` \
		  @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
		  PATH="$(EXTRA_PATH):$(PATH)" \
		  TCLLIBPATH="$(top_builddir)"
TCLSH_PROG	= @TCLSH_PROG@
WISH_PROG	= @WISH_PROG@
TCLSH		= $(TCLSH_ENV) $(TCLSH_PROG)
WISH		= $(TCLSH_ENV) $(WISH_PROG)

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

info:
	@echo "Please specify either 'make test' or 'make install'."

all:
	@echo "Nothing to make for target 'all'.  Run 'make test' to \
	test the distribution"
	@echo "and 'make install' to install it."

install: install-libraries install-doc install-demos

test:
	$(WISH) `@CYGPATH@ $(srcdir)/tests/all.tcl` -load "package require -exact Itcl $(ITCL_VERSION); package forget Itk; package forget itk; package require -exact Iwidgets $(PACKAGE_VERSION)" $(TESTFLAGS) | cat

shell: 
	@$(WISH) $(SCRIPT)

install-libraries:
	@mkdir -p $(pkglibdir)/scripts
	@echo "Installing source files from $(GENERIC_DIR) into $(pkglibdir)"
	@for i in $(GENERIC_DIR)/*.itk $(GENERIC_DIR)/*.itcl \
		$(GENERIC_DIR)/tclIndex $(GENERIC_DIR)/*.gif ; do \
	    $(INSTALL_DATA) $$i $(pkglibdir)/scripts; \
	done;
	@echo "Installing iwidgets.tcl and pkgIndex.tcl into $(pkglibdir)"
	@for i in iwidgets.tcl pkgIndex.tcl ; do \
	    $(INSTALL_DATA) $$i $(pkglibdir); \
	done;

install-demos:
	@mkdir -p $(pkglibdir)/demos/images
	@mkdir -p $(pkglibdir)/demos/html
	@echo "Installing demos from $(srcdir)/demos into $(pkglibdir)/demos"
	@for i in $(srcdir)/demos/*; do \
	    if test -f $$i ; then \
	        $(INSTALL_SCRIPT) $$i $(pkglibdir)/demos; \
	    fi; \
	done;
	@echo "Installing images from $(srcdir)/demos/images into $(pkglibdir)/demos/images"
	@for i in $(srcdir)/demos/images/*; do \
	    if test -f $$i ; then \
	        $(INSTALL_DATA) $$i $(pkglibdir)/demos/images; \
	    fi; \
	done;
	@echo "Installing html man pages from $(srcdir)/demos/html into $(pkglibdir)/demos/html"
	@for i in $(srcdir)/demos/html/*; do \
	    if test -f $$i ; then \
	        $(INSTALL_DATA) $$i $(pkglibdir)/demos/html; \
	    fi; \
	done;

install-doc:
	@mkdir -p $(MAN_INSTALL_DIR)
	@echo "Installing man pages from $(TOP_DIR)/doc into $(MAN_INSTALL_DIR)"
	@cd $(TOP_DIR)/doc; for i in *.n; do \
	    rm -f $(MAN_INSTALL_DIR)/`basename $$i`; \
	    rm -f $(MAN_INSTALL_DIR)/`basename iwidgets_$$i`; \
	    sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
	        $$i > $(MAN_INSTALL_DIR)/`basename iwidgets_$$i`; \
	    chmod 444 $(MAN_INSTALL_DIR)/`basename iwidgets_$$i`; \
	done;
	$(INSTALL_DATA) $(srcdir)/license.terms $(pkglibdir)

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

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

distclean: clean
	rm -f Makefile config.status config.cache config.log iwidgets.tcl pkgIndex.tcl

depend:

configure: configure.in
	autoconf

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