# Generated automatically from Makefile.in by configure.
#
# This file is a Makefile for 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.
#
# @(#) Makefile.in 1.25 95/03/24 09:38:39

#----------------------------------------------------------------
# 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
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 Tcl
# scripts (note: you can set the TK_LIBRARY environment variable at
# run-time to override the compiled-in location):
TK_LIBRARY =		$(prefix)/lib/tk

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

# Directory in which to install the archive libtk.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 tk.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 Tk ("." will be replaced or has already
# been replaced by the configure script):
TCL_DIR =		./../tcl7.4

# The directory containing the Tcl library archive file appropriate
# for this version of Tk:
TCL_BIN_DIR =		../tcl7.4

# 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/openwin/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/openwin/lib -lX11

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

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

# To turn off the security checks that disallow incoming sends when
# the X server appears to be insecure, reverse the comments on the
# following lines:
SECURITY_FLAGS =
#SECURITY_FLAGS = -DTK_NO_SECURITY

# 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 = install-sh -c

#----------------------------------------------------------------
# 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_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DSTDC_HEADERS=1 -DNEED_MATHERR=1 -DTK_FILE_COUNT=_cnt 
INSTALL_PROGRAM =	${INSTALL}
INSTALL_DATA =		${INSTALL} -m 644
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.
#----------------------------------------------------------------


CC =		cc
CC_SWITCHES =	${CFLAGS} -I../rivet -I${SRC_DIR} -I${TCL_DIR} ${X11_INCLUDES} \
${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \
${KEYSYM_FLAGS} -DTK_LIBRARY=\"${TK_LIBRARY}\"

WIDGOBJS = 

CANVOBJS = tkCanvArc.o tkCanvBmap.o tkCanvImg.o \
	tkCanvLine.o tkCanvPoly.o tkCanvText.o \
	tkCanvUtil.o tkCanvWind.o tkRectOval.o tkTrig.o

IMAGEOBJS = tkImgFmtPPM.o tkImgFmtGIF.o

TEXTOBJS = tkTextBTree.o tkTextIndex.o tkTextMark.o

OBJS = tk3d.o tkArgv.o tkAtom.o tkBitmap.o tkClipboard.o \
	tkColor.o tkCursor.o tkError.o  \
	tkFocus.o tkFont.o tkGet.o tkGC.o tkGeometry.o tkGrab.o \
	tkOption.o tkPack.o tkPlace.o \
	tkPreserve.o tkUtil.o tkUnix.o tkVisual.o \
	tkXEvent.o tkXId.o \
	$(WIDGOBJS) $(CANVOBJS) $(IMAGEOBJS) $(TEXTOBJS)

SRCS = tk3d.c tkArgv.c tkAtom.c tkBind.c tkBitmap.c tkClipboard.c \
	tkColor.c tkCursor.c tkError.c \
	tkFocus.c tkFont.c tkGet.c tkGC.c tkGeometry.c tkGrab.c \
	tkOption.c tkPack.c tkPlace.c \
	tkPreserve.c tkUtil.c tkUnix.c tkVisual.c \
	tkWm.c tkXEvent.c tkXId.c \
	tkCanvArc.c tkCanvBmap.c tkCanvImg.c \
	tkCanvLine.c tkCanvPoly.c tkCanvText.c \
	tkCanvUtil.c tkCanvWind.c tkRectOval.c tkTrig.c \
	tkImgFmtPPM.c tkImgFmtGIF.c \
	tkText.c tkTextBTree.c tkTextIndex.c \
	tkTextMark.c tkTextWind.c

HDRS = default.h ks_names.h patchlevel.h tk.h ../rivet/tkCanvas.h ../rivet/tkInt.h  \
	../rivet/tkPort.h ../rivet/tkText.h

DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget

all: $(OBJS)

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

wish: tkAppInit.o libtk.a $(TCL_BIN_DIR)/libtcl.a
	$(CC) $(CC_SWITCHES) tkAppInit.o $(LIBS) -o wish

tktest: tkTest.o tkSquare.o libtk.a $(TCL_BIN_DIR)/libtcl.a
	${CC} ${CC_SWITCHES} tkTest.o tkSquare.o $(LIBS) -o tktest

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

configInfo: Makefile
	@rm -f configInfo
	@echo "# Definitions and libraries needed to build Tk applications" >> configInfo
	@echo "# (generated by the configure script):" >> configInfo
	@echo "TK_CC_SWITCHES = ${AC_FLAGS} ${MEM_DEBUG_FLAGS}" >> configInfo
	@echo "TK_X11_INCLUDES = ${X11_INCLUDES}" >> configInfo
	@echo "TK_LIBS = ${X11_LIB_SWITCHES}  -lsocket -lnsl" >> configInfo

install: $(OBJS)
	cp $(OBJS) ../Obj
	( cd ../Obj; chmod 644 $(OBJS) )

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

clean:
	rm -f *.a *.o core errs *~ \#* TAGS *.E a.out errors tktest wish \
		config.info

distclean: clean
	rm -f Makefile config.status

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

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

#
# Target to check for proper usage of UCHAR macro.
#

checkuchar:
	-egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit $(SRCS) | grep -v UCHAR

#
# Target to make sure that only symbols with "Tk" prefixes are
# exported.
#

checkexports: libtk.a
	-nm -p libtk.a | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Tt]k'

#
# Target to create a proper Tk distribution from information in the
# master source directory.  DISTDIR must be defined to indicate where
# to put the distribution.
#

TCLDIR	  = ../tcl
configure: configure.in
	autoconf
dist:   configure
	rm -rf $(DISTDIR)
	mkdir $(DISTDIR)
	cp license.terms Makefile.in $(DISTDIR)
	chmod 664 $(DISTDIR)/Makefile.in
	cp -p $(SRCS) tkAppInit.c tkSquare.c tkTest.c $(HDRS) $(DISTDIR)
	mkdir $(DISTDIR)/bitmaps
	@for i in bitmaps/* ; do \
	    if [ -f $$i ] ; then \
		sed -e 's/static char/static unsigned char/' \
		       $$i > $(DISTDIR)/$$i; \
	    fi; \
	done;
	mkdir $(DISTDIR)/compat
	cp -p license.terms $(TCLDIR)/compat/unistd.h \
		$(TCLDIR)/compat/stdlib.h $(DISTDIR)/compat
	cp -p README ToDo changes porting.notes porting.old $(DISTDIR)
	cp -p configure configure.in $(TCLDIR)/install-sh $(DISTDIR)
	chmod 775 $(DISTDIR)/configure $(DISTDIR)/configure.in
	chmod +x $(DISTDIR)/install-sh
	mkdir $(DISTDIR)/library
	cp -p license.terms library/*.tcl library/tclIndex $(DISTDIR)/library
	cp -p library/prolog.ps $(DISTDIR)/library
	mkdir $(DISTDIR)/library/demos
	cp -pr library/demos/*.tcl \
		library/demos/tclIndex library/demos/browse \
		library/demos/hello library/demos/ixset \
		library/demos/rmt library/demos/rolodex \
		library/demos/square \
		library/demos/tcolor library/demos/timer \
		library/demos/widget library/demos/README \
		license.terms $(DISTDIR)/library/demos
	mkdir $(DISTDIR)/library/demos/images
	@for i in library/demos/images/* ; do \
	    if [ -f $$i ] ; then \
		cp $$i $(DISTDIR)/$$i; \
	    fi; \
	done;
	mkdir $(DISTDIR)/doc
	cp -p license.terms doc/*.[13n] doc/man.macros $(DISTDIR)/doc
	mkdir $(DISTDIR)/tests
	cp -p license.terms tests/*.test tests/visual tests/*.tcl \
		tests/README tests/all tests/defs tests/option.file* \
		$(DISTDIR)/tests

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