# Generated automatically from Makefile.in by configure.

# This is a Makefile for scotty. 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.

prefix =	/usr/local
exec_prefix =	${prefix}

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

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

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

# Directory in which to install the scotty startup files.
SCOTTY_DIR =	$(LIB_DIR)/scotty

# Directory in which to install the library of tkined scripts.
TKINED_DIR =	$(LIB_DIR)/tkined

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

# Comment the following lines to exclude icmp support (because 
# you have no ntping or no root permissions). NTPING should 
# contain the full path to the installed ntping binary.
NTPING = $(BIN_DIR)/ntping

# 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/X11R6/include

# A "-I" switch that can be used when compiling to make all the
# Tcl include files accessible (the configure script will try to
# set this value).
TCL_INCLUDES =	-I/usr/include/tcl

# Linker switch(es) to use to link with the Tcl library archive (the
# configure script will try to set this value automatically, but you
# can override it).
TCL_LIB =  /usr/lib/libtcl7.4.a

# A "-I" switch that can be used when compiling to make all the
# Tk include files accessible (the configure script will try to
# set this value).
TK_INCLUDES =	-I/usr/include/tcl

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

# Linker switch(es) to use to link with the Tk library archive (the
# configure script will try to set this value automatically, but you
# can override it).
TK_LIB = /usr/lib/libtk4.0.a

# A "-I" switch that can be used when compiling to make the msql 
# include files accessible (the configure script will try to
# set this value).
MSQL_INCLUDES =	

# Linker switch(es) to use to link with the msql library archive (the
# configure script will try to set this value automatically, but you
# can override it).
MSQL_LIB = 

# Linker switch(es) to use to link with the osimis library archive (the
# configure script will try to set this value automatically, but you
# can override it).
OSIMIS_LIBS = 

# Linker switch(es) to use to link with the gdmo library archive (the
# configure script will try to set this value automatically, but you
# can override it).
GDMO_LIBS = 

# Linker switch(es) to link platform depended library archives (the
# configure script will try to set this value automatically, but you
# can override it).
LIBS =  -lieee # -lresolv

# To disable ANSI-C procedure prototypes reverse the comment 
# characters on the following lines:
PROTO_FLAGS =
#PROTO_FLAGS = -DNO_PROTOTYPE

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

#----------------------------------------------------------------
# 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.  However, you can reverse the comments
# on the pairs of lines to force "no dynamic loading or shared
# libraries".
#----------------------------------------------------------------

# Flags to pass to cc when compiling the components of a shared
# library:
SHLIB_CFLAGS = 
#SHLIB_CFLAGS =

# Base command to use for combining object files into a shared
# library:
SHLIB_LD = 

# Suffix to use for the name of the shared library.  An empty string
# means we don't know how to use shared libraries on this platform.
SHLIB_SUFFIX = 
#SHLIB_SUFFIX = .a

# Library file(s) to include in tclsh and other base applications
# in order to provide facilities needed by DLOBJ above.
DL_LIBS = 
#DL_LIBS =

# Flags to pass to the compiler when linking object files into
# an executable wish or tktest binary.
LD_FLAGS = 
#LD_FLAGS =

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

INSTALL =		/usr/bin/install -c
INSTALL_PROGRAM =	${INSTALL}
INSTALL_DATA =		${INSTALL} -m 644
RPCGEN =		rpcgen
RANLIB =		ranlib
SUBDIRS =		tcpip ntping snmp
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
LD =		cc
CC_SWITCHES =	${CFLAGS} -I. -I${SRC_DIR} $(TCL_INCLUDES) $(TK_INCLUDES) $(X11_INCLUDES) $(MSQL_INCLUDES) ${PROTO_FLAGS}


ALLSUBDIRS = tcpip snmp ntping library tkined examples agents gdmo cmip bones doc

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

all: libscotty scotty scwish ntping

scotty: libscotty.a scotty.o 
	$(LD) -o scotty scotty.o libscotty.a $(TK_LIB) $(X11_LIBS) $(TCL_LIB) $(OSIMIS_LIBS) $(MSQL_LIB) $(GDMO_LIBS) $(LIBS) $(DL_LIBS) -lm

scwish:	libscotty.a tkAppInit.o 
	$(LD) -o scwish tkAppInit.o libscotty.a $(TK_LIB) $(X11_LIBS) $(TCL_LIB) $(OSIMIS_LIBS) $(MSQL_LIB) $(GDMO_LIBS) $(LIBS) $(DL_LIBS) -lm

libscotty: 
	@for i in $(SUBDIRS) ; do ( cd $$i; $(MAKE) ) ; done

dynamic:
	@for i in $(SUBDIRS) ; do ( cd $$i; $(MAKE) dynamic ) ; done
	${SHLIB_LD} */*.so -o scotty${SHLIB_SUFFIX} $(LIBS)

test:
	@echo
	@echo "The test suite requires that you first install scotty using"
	@echo "make install and make sinstall. To run the test suite, type"
	@echo "make installcheck."
	@echo

installcheck:
	@pwd=`pwd`; cd $(SRC_DIR)/tests; $$pwd/scotty -nf all

install: scotty scwish
	@if [ ! -d $(BIN_DIR) ] ; then \
		mkdir -p $(BIN_DIR); \
	else true; \
	fi
	rm -f $(BIN_DIR)/scotty
	$(INSTALL_PROGRAM) scotty $(BIN_DIR)
	rm -f $(BIN_DIR)/scwish
	$(INSTALL_PROGRAM) scwish $(BIN_DIR)
	@if [ ! -d $(SCOTTY_DIR) ] ; then \
		mkdir -p $(SCOTTY_DIR); \
	else true; \
	fi
	@if [ ! -d $(SCOTTY_DIR)/site ] ; then \
		mkdir -p $(SCOTTY_DIR)/site; \
	else true; \
	fi
	$(INSTALL_DATA) $(SRC_DIR)/init.tcl $(SCOTTY_DIR)
	@if [ ! -d $(INCLUDE_DIR) ] ; then \
		mkdir -p $(INCLUDE_DIR); \
	else true; \
	fi
	$(INSTALL_DATA) $(SRC_DIR)/scotty.h $(INCLUDE_DIR)
	@if [ ! -d $(LIB_DIR) ] ; then \
		mkdir -p $(LIB_DIR); \
	else true; \
	fi
	$(INSTALL_DATA) libscotty.a $(LIB_DIR)
	$(RANLIB) $(LIB_DIR)/libscotty.a
	( cd doc;      $(MAKE) install )
	( cd library;  $(MAKE) install )
	( cd tkined;   $(MAKE) install )
	( cd agents;   $(MAKE) install )
	( cd gdmo;     $(MAKE) install )
	( cd snmp;     $(MAKE) install )
	( cd ntping;   $(MAKE) install )

sinstall:
	( cd snmp;   $(MAKE) sinstall )
	( cd ntping; $(MAKE) sinstall )

depend:
	@for i in $(SUBDIRS) ; do ( cd $$i; $(MAKE) depend ) ; done
	cp Makefile Makefile.bak
	sed -e '/^# DO NOT DELETE THIS LINE/,$$d' < Makefile.bak > Makefile
	echo '# DO NOT DELETE THIS LINE' >> Makefile
	echo ' ' >> Makefile
	$(CC) -MM $(CC_SWITCHES) scotty.c >> Makefile

clean:
	@echo "making clean in ."
	@rm -f scotty scwish libscotty.a scotty$(SHLIB_SUFFIX)
	@rm -f core *.o *~ *.bak lmake.???
	@for i in $(ALLSUBDIRS) ; do \
		( echo "making clean in $$i"; cd $$i; $(MAKE) clean ) ; \
	done

distclean: clean
	@echo "making distclean in ."
	@rm -f Makefile TAGS config.log config.cache config.status config.h
	@for i in $(ALLSUBDIRS) ; do \
		( echo "making distclean in $$i"; cd $$i; $(MAKE) distclean ) ; \
	done

diff:
	new=2.0.2; \
	old=2.0.1; \
	src=/tmp/scotty-$$old; \
	diff=scotty-$$old-$$new.diff; \
	diff -N -c -r $$src . > /tmp/$$diff; \
	mv /tmp/$$diff . ; \
	gzip -v -9 $$diff

tar: distclean
	rm -f scotty-?.*.tar.gz
	pwd=`pwd`; \
	pwd=`basename $$pwd`; \
	cd ..; tar cvf /tmp/$$pwd.tar $$pwd/???*; \
	mv /tmp/$$pwd.tar $$pwd; \
	gzip -v -9 $$pwd/$$pwd.tar

# DO NOT DELETE THIS LINE
