# Generated automatically from Makefile.in by configure.
# ---------------------------------------------------------------------------
#           [incr Tcl] - Object-oriented programming in Tcl
# ---------------------------------------------------------------------------
# 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.
# ---------------------------------------------------------------------------
ROOTNAME = itcl
VERSION  = 1.5
PACKAGE  = $(ROOTNAME)-$(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.)
# ---------------------------------------------------------------------------
# INSTALLATION DIRECTORIES
# ---------------------------------------------------------------------------

# Top-level directory in which to install architecture-specific files:
prefix = /usr/local
exec_prefix = $(prefix)

# Directory in which to install the archive libitcl.a:
LIB_DIR = $(exec_prefix)/lib

# Directory in which to install the include file itcl.h:
INCLUDE_DIR = $(exec_prefix)/include

# Directory in which to install the programs (itcl_wish and itcl_sh):
BIN_DIR = $(exec_prefix)/bin

# ---------------------------------------------------------------------------
# COMPILATION SOURCES/LIBRARIES
# ---------------------------------------------------------------------------

# Tcl source directory (must contain tclInt.h)
# (the configure script should find it; if not, edit below)
TCL_INC = -I.

# Tk include directory
# (the configure script should find it; if not, edit below)
TK_INC = -I/usr/include/tcl

# X11 include directory
# (the configure script should find it; if it is /usr/include,
# it will be commented out)
X11_INC =	 -I/usr/X11R6/include

# Tcl library
# (the configure script should find it; if not, edit below)
TCL_LIB = /usr/lib/libtcl.a

# Tk library
# (the configure script should find it; if not, edit below)
TK_LIB = /usr/lib/libtk.a

# 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 = -L/usr/X11R6/lib -lX11

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

# Composite list of include files
INCS = -I$(SRC_DIR) $(TCL_INC) $(TK_INC) $(X11_INC)

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

# 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

# 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 =		/usr/bin/install -c
INSTALL_PROGRAM =	$(INSTALL)
INSTALL_DATA =		$(INSTALL) -m 644
RANLIB =		ranlib
SRC_DIR =		.
VPATH =			.

# ---------------------------------------------------------------------------
# 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) $(INCS) $(AC_FLAGS) $(PROTO_FLAGS) \
	$(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS)

SRCS = itcl_class.c itcl_core.c \
	itcl_methods.c itcl_objects.c itcl_vars.c \
	itcl_util.c

OBJS = itcl_class.o itcl_core.o \
	itcl_methods.o itcl_objects.o itcl_vars.o \
	itcl_util.o

SOBJS = itcl_class.so itcl_core.so \
	itcl_methods.so itcl_objects.so itcl_vars.so \
	itcl_util.so

all:  libitcl.a itcl_wish itcl_sh

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

libitcl: $(SOBJS)
	rm -f libitcl
	  -o $@ $(SOBJS)

itcl_wish: tkAppInit.o libitcl.a
	$(CC) $(CC_SWITCHES) tkAppInit.o libitcl.a $(LIBS) -o itcl_wish

itcl_sh: tclAppInit.o libitcl.a
	$(CC) $(CC_SWITCHES) tclAppInit.o libitcl.a $(TCL_LIB) -lm -o itcl_sh

test: itcl_sh
	@( echo cd $(SRC_DIR)/../tests\; source all\; exit ) | ./itcl_sh

pure: tclAppInit.o tkAppInit.o libitcl.a
	purify $(CC) $(CC_SWITCHES) tclAppInit.o libitcl.a $(TCL_LIB) -lm \
		-o itcl_sh.pure
	purify $(CC) $(CC_SWITCHES) tkAppInit.o libitcl.a $(LIBS) \
		-o itcl_wish.pure

install:  libitcl.a itcl_wish itcl_sh
	@for i in $(INCLUDE_DIR) $(LIB_DIR) $(BIN_DIR) ; do \
	    if [ ! -d $$i ] ; then \
			echo "Making directory $$i"; \
			mkdir $$i; \
			chmod 755 $$i; \
		else true; \
		fi; \
	done;
	@echo "Installing itcl.h"
	@$(INSTALL_DATA) itcl.h $(INCLUDE_DIR)
	@echo "Installing libitcl.a"
	@$(INSTALL_DATA) libitcl.a $(LIB_DIR)
	@$(RANLIB) $(LIB_DIR)/libitcl.a
	@if [ -n "" ] ; then \
		echo "Installing "; \
		$(INSTALL_DATA)  $(LIB_DIR); \
	fi;
	@echo "Installing itcl_wish"
	@$(INSTALL_PROGRAM) itcl_wish $(BIN_DIR)
	@echo "Installing itcl_sh"
	@$(INSTALL_PROGRAM) itcl_sh $(BIN_DIR)

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

clean:
	rm -f *.o *.a *.so *.so.* core errs *~ \#* TAGS *.E a.out errors
	rm -f itcl_wish itcl_sh *pure*

distclean: clean
	rm -f Makefile config.status

lint:
	$(LINT) $(INCS) $(SRCS)

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

.SUFFIXES: .so $(SUFFIXES)
.c.so:
	$(CC) -c $(CC_SWITCHES)  $<
	mv $*.o $@

$(OBJS): itcl_class.h itcl_core.h \
	itcl_methods.h itcl_objects.h itcl_vars.h \
	itcl_util.h
