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

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

MAJOR_VERSION = 3
MINOR_VERSION = 0
RELEASE_LEVEL = 0
VERSION = 3.0

#----------------------------------------------------------------
# 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 =		/opt/tcl803
exec_prefix =		/opt/tcl803

# 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

# Path to use at runtime to refer to LIB_INSTALL_DIR:
LIB_RUNTIME_DIR =	$(exec_prefix)/lib

# Directory in which to install the program wish:
BIN_INSTALL_DIR =	$(INSTALL_ROOT)$(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]:
TCL_SRC_DIR =		/dsk/data/de/src/tcl8.0.3

# The directory containing the Tcl library archive file appropriate
# for this version of [incr Tk]:
TCL_LIB_DIR =		@TCL_LIB_DIR@

# Library flags for Tcl library
TCL_LIB_FLAG =		-ltcl8.0${TCL_DBGX}

# Tcl libraries built with optimization switches have this additional extension
DBGX =			

# The directory containing the Tk sources and headers appropriate
# for this version of [incr Tk]:
TK_SRC_DIR =		/dsk/data/de/src/tk8.0.3

# The directory containing the Tk library archive file appropriate
# for this version of [incr Tk]:
TK_LIB_DIR =		/opt/tcl803/lib

# Library flags for Tk library
TK_LIB_FLAG =		-ltk8.0${TK_DBGX}

# The directory containing the [incr Tcl] sources and headers appropriate
# for this version of [incr Tk]:
ITCL_SRC_DIR =		/dsk/data/de/src/itcl3.0/itcl

# The directory containing the [incr Tcl] library archive file appropriate
# for this version of [incr Tk]:
ITCL_LIB_DIR =		/dsk/data/de/src/itcl3.0/itcl/unix

# 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/opt/X11R6.3/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/opt/X11R6.3/lib -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 = -L/opt/tcl803/lib -ltk8.0${TK_DBGX} $(X11_LIB_SWITCHES) \
	-L/dsk/data/de/src/itcl3.0/itcl/unix -litcl3.0 -L/opt/tcl803/lib -ltcl8.0${TCL_DBGX} \
	-ldl  -lsocket -lnsl -lm -ldl -lc

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

# 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

# If your X server is X11R4 or earlier, then you may wish to reverse
# the comment characters on the following two lines.  This will enable
# extra code to speed up XStringToKeysym.  In X11R5 and later releases
# XStringToKeysym is plenty fast, so you needn't define REDO_KEYSYM_LOOKUP.
KEYSYM_FLAGS =
#KEYSYM_FLAGS = -DREDO_KEYSYM_LOOKUP

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

# Tk 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 = $(TOP_DIR)/../config/install-sh -c
INSTALL_PROGRAM =	${INSTALL}
INSTALL_DATA =		${INSTALL} -m 644
MKINSTALLDIRS =		$(TOP_DIR)/../config/mkinstalldirs

# The symbols below provide support for dynamic loading and shared
# libraries.  The values of the symbols are normally set by the
# configure script.  You shouldn't normally need to modify any of
# these definitions by hand.

SHLIB_CFLAGS = -fPIC

LD_SEARCH_FLAGS = -R ${LIB_RUNTIME_DIR}

ITK_LIB_FILE = libitk3.0.so
#ITK_LIB_FILE = libitk.a

# The symbol below provides support for dynamic loading and shared
# libraries.  See configure.in for a description of what it means.
# The values of the symbolis normally set by the configure script.

SHLIB_LD = /usr/ccs/bin/ld -G -z text

#----------------------------------------------------------------
# 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 =		 -DHAVE_GETCWD=1 -DHAVE_UNISTD_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -DRETSIGTYPE=void -DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 
RANLIB =		:
TOP_DIR =		/dsk/data/de/src/itcl3.0/itk
GENERIC_DIR =		$(TOP_DIR)/generic
UNIX_DIR =		$(TOP_DIR)/unix

#----------------------------------------------------------------
# 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) $(SHLIB_CFLAGS) -I$(UNIX_DIR) -I$(GENERIC_DIR) \
-I$(TCL_SRC_DIR)/generic -I$(ITCL_SRC_DIR)/generic \
-I$(TK_SRC_DIR)/generic $(X11_INCLUDES) \
$(AC_FLAGS) $(PROTO_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) \
-DITK_LIBRARY=\"$(ITK_LIBRARY)\"

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

SRCS = $(GENERIC_DIR)/itk_cmds.c $(GENERIC_DIR)/itk_option.c \
	$(GENERIC_DIR)/itk_archetype.c $(GENERIC_DIR)/itk_util.c

all: itkwish

# The following target is configured by autoconf to generate either
# a shared library or non-shared library for [incr Tk].

libitk3.0.so: ${OBJS}
	rm -f $(ITK_LIB_FILE)
	$(SHLIB_LD) -o libitk3.0.so $(OBJS) ${LIBS} $(LD_SEARCH_FLAGS)
	$(RANLIB) $(ITK_LIB_FILE)

itkwish: tkAppInit.o $(ITK_LIB_FILE)
	$(CC)  tkAppInit.o -L/dsk/data/de/src/itcl3.0/itk/unix -litk3.0 \
		$(LIBS) $(LD_SEARCH_FLAGS) -o itkwish

# Note, in the target below TCL_LIBRARY needs to be set or else
# "make test" won't work in the case where the compilation directory
# isn't the same as the source directory.

test: itkwish
	TCLLIBPATH="`pwd` $(TK_LIB_DIR) $(ITCL_LIB_DIR) $(TCL_LIB_DIR)"; export TCLLIBPATH; \
	LD_LIBRARY_PATH=`pwd`:$(ITCL_LIB_DIR):$(TK_LIB_DIR):$(TCL_LIB_DIR):$(LD_LIBRARY_PATH); export LD_LIBRARY_PATH; \
	TCL_LIBRARY=$(TCL_SRC_DIR)/library; export TCL_LIBRARY; \
	TK_LIBRARY=$(TK_SRC_DIR)/library; export TK_LIBRARY; \
	ITCL_LIBRARY=$(ITCL_SRC_DIR)/library; export ITCL_LIBRARY; \
	ITK_LIBRARY=$(TOP_DIR)/library; export ITK_LIBRARY; \
	( echo cd $(TOP_DIR)/tests\; source all\; exit ) \
	| ./itkwish -geometry +0+0

install: install-binaries install-libraries install-man

install-binaries: $(ITK_LIB_FILE) itkwish
	@$(MKINSTALLDIRS) $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR)
	@echo "Installing $(ITK_LIB_FILE)"
	@$(INSTALL_DATA) $(ITK_LIB_FILE) $(LIB_INSTALL_DIR)
	@(cd $(LIB_INSTALL_DIR); $(RANLIB) $(ITK_LIB_FILE))
	@chmod 555 $(LIB_INSTALL_DIR)/$(ITK_LIB_FILE)
	@echo "Installing itkwish"
	$(INSTALL_PROGRAM) itkwish $(BIN_INSTALL_DIR)/itkwish$(VERSION)
	@echo "Installing itkConfig.sh"
	@$(INSTALL_DATA) itkConfig.sh $(LIB_INSTALL_DIR)/itkConfig.sh

install-libraries:
	@$(MKINSTALLDIRS) $(INCLUDE_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)
	@echo "Installing itk.h"
	@$(INSTALL_DATA) $(GENERIC_DIR)/itk.h $(INCLUDE_INSTALL_DIR)
	@for i in $(TOP_DIR)/library/*.* $(TOP_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \
	    do \
	    echo "Installing $$i"; \
	    $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
	    done;
	@echo "Installing pkgIndex.tcl"
	@$(INSTALL_DATA) pkgIndex.tcl $(SCRIPT_INSTALL_DIR)

install-man:
	@$(MKINSTALLDIRS) $(MAN1_INSTALL_DIR) $(MANN_INSTALL_DIR)
	@cd $(TOP_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 $(TOP_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: $(UNIX_DIR)/Makefile.in
	$(SHELL) config.status

clean:
	rm -f *.a *.o core errs *~ \#* TAGS *.E a.out errors \
	rm -f itkwish* libitk* *pure* *% ../tests/core

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

pure: tkAppInit.o $(ITK_LIB_FILE)
	purify $(CC)  tkAppInit.o -L/dsk/data/de/src/itcl3.0/itk/unix -litk3.0 \
		$(LIBS) $(LD_SEARCH_FLAGS) -o itkwish.pure

profile: tkAppInit.o $(ITK_LIB_FILE)
	quantify $(CC)  tkAppInit.o -L/dsk/data/de/src/itcl3.0/itk/unix -litk3.0 \
		$(LIBS) $(LD_SEARCH_FLAGS) -o itkwish.pure

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

configure: configure.in
	autoconf

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

tkAppInit.o:	$(UNIX_DIR)/tkAppInit.c Makefile
	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkAppInit.c

itk_cmds.o:	$(GENERIC_DIR)/itk_cmds.c Makefile
	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_cmds.c

itk_option.o:	$(GENERIC_DIR)/itk_option.c
	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_option.c

itk_archetype.o:	$(GENERIC_DIR)/itk_archetype.c
	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_archetype.c

itk_util.o:	$(GENERIC_DIR)/itk_util.c
	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_util.c

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