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

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

CC = acc
C++ = CC
exec_prefix =	/disk/tcl
prefix =	/disk/tcl

# Directory in which snmp include are 
SNMP_INCLUDE =	../snmplib/

# Directory in which to install the library of Tk scripts and demos
# (note: you can set the TK_LIBRARY environment variable at run-time to
# override the compiled-in location):
TK_LIBRARY =	$(prefix)/lib/tk

# Directory where libtcl.a , libtk.a and tree widget libraries are.  
LIB_DIR =	$(exec_prefix)/lib

# Directory in which to install the program wish:
BIN_DIR =	$(exec_prefix)/bin

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

TCL_LIBS = -L$(LIB_DIR) -ltcl

TK_LIBS = -L$(LIB_DIR) -ltktree -lOS -ltk -lXpm

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

# Libraries to use when linking:  must include at least Tk, Tcl, Xlib,
# and the math library (in that order).  The " -lnsl" part will be
# replaced (or has already been replaced) with relevant libraries as
# determined by the configure script.
LIBS = -L../lib/ -lsnmp $(X11_LIB_SWITCHES)  -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

# 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 =		 -DHAVE_UNISTD_H=1 -DNO_STDLIB_H=1
INSTALL =		/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_SWITCHES =	${CFLAGS} -I${SRC_DIR} -I${INCLUDE_DIR} -I${SNMP_INCLUDE} ${X11_INCLUDES} \
${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \
-DTK_LIBRARY=\"${TK_LIBRARY}\"

SNMPTCLOBJ = tcl_snmp.o tcl_mib.o
SNMPWISHOBJ = tcl_snmp.o tcl_mib.o tkMain.o

all: snmptcl snmpwish 

snmptcl: tclAppInit.o tcl_snmp.o tcl_mib.o
	echo $<
	$(C++) $(CC_SWITCHES) tclAppInit.o $(SNMPTCLOBJ)  ${EXTENSION_OBJS} ${EXTENSION_LIB} $(TCL_LIBS) $(LIBS) -o snmptcl

snmpwish: tkAppInit.o tkMain.o tcl_snmp.o tcl_mib.o
	$(C++) $(CC_SWITCHES) tkAppInit.o $(SNMPWISHOBJ) ${EXTENSION_OBJS} ${EXTENSION_LIB} $(LIBS) $(TCL_LIBS) $(TK_LIBS) -o snmpwish

install: install-binaries 

install-binaries: snmpwish snmptcl mib-tree
	@for i in $(BIN_DIR) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@echo "Installing snmpwish"
	@$(INSTALL_PROGRAM) snmpwish $(BIN_DIR)
	@echo "Installing snmptcl"
	@$(INSTALL_PROGRAM) snmpwish $(BIN_DIR)
	@echo "Installing mib-tree"
	@$(INSTALL_PROGRAM) mib-tree $(BIN_DIR)

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

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

distclean: clean
	rm -f Makefile config.status

%.o : %.c
	$(CC)  -c $(CC_SWITCHES) $(INCLUDES) $<
%.o : %.C
	$(C++) -c $(CC_SWITCHES) $(INCLUDES) $<
