# Generated automatically from Makefile.in by configure.
#
# This file is a Makefile for Tcl-DP.  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.

exec_prefix =   /usr/local
prefix =        /usr/local


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

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

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

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

# Top-level directory for manual entries:
MAN_DIR =	$(prefix)/man

# Directory in which to install manual entry for dpwish
MAN1_DIR =	$(MAN_DIR)/man1

# Directory in which to install manual entries for Tcl-DP's C library
# procedures:
MAN3_DIR =	$(MAN_DIR)/man3

# Directory in which to install manual entries for the built-in
# Tcl commands implemented by Tcl-DP:
MANN_DIR =	$(MAN_DIR)/mann

# The directory containing the Tcl sources and headers appropriate
# for this version of Tcl-DP ("." will be replaced or has already
# been replaced by the configure script):
#TCL_DIR =	./../tcl7.3
TCL_DIR = /usr/include/tcl

# The directory containing the Tk sources and headers appropriate
# for this version of Tcl-DP ("." will be replaced or has already
# been replaced by the configure script):
#TK_DIR =	./../tk3.6
TK_DIR = /usr/include/tcl

# The directory containing the Tcl library archive file appropriate
# for this version of Tcl-DP:
# TCL_BIN_DIR =	../tcl7.3
#TCL_BIN_DIR =	$(LIB_DIR)
TCL_BIN_DIR = /usr/lib

# The directory containing the Tk library archive file appropriate
# for this version of Tcl-DP:
# TK_BIN_DIR =	../tk3.6
#TK_BIN_DIR =	$(LIB_DIR)
TK_BIN_DIR = /usr/X11/lib

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

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

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

# Under HP/UX, reverse the comment characters on the following lines
# to enable the ansi HP compiler.  This may generate a few in dpnetwork.c,
# due to the inconsistent way the select() prototype is defined.
#HP_ANSI_FLAGS = -Aa -D_HPUX_SOURCE
HP_ANSI_FLAGS =

# 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_STDLIB_H=1 -DHAVE_UNISTD_H=1 -DUNIX_SOCKET=1
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 =		cc
CC_SWITCHES =	${CFLAGS} -I${SRC_DIR} -I${TCL_DIR} -I${TK_DIR} \
${AC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \
-DDP_LIBRARY=\"${DP_LIBRARY}\" ${X11_INCLUDES} ${HP_ANSI_FLAGS}

OBJS = dpnetInit.o dpnetwork.o dpaddress.o dprpc.o

all: libdpnetwork.a dpwish

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

dpwish: tkAppInit.o tkMain.o libdpnetwork.a
	$(CC) $(CC_SWITCHES) tkMain.o tkAppInit.o $(LIBS) -o dpwish

test: dpwish
	@cwd=`pwd`; \
	cd $(TCL_DIR); TCL_LIBRARY=`pwd`/library; export TCL_LIBRARY; \
	cd $$cwd; cd $(SRC_DIR); DP_LIBRARY=`pwd`/library; export DP_LIBRARY; \
	cd $$cwd; cd $(SRC_DIR)/tests; \
	( echo source all\; exit ) | $$cwd/dpwish -notk

install: install-binaries install-libraries install-man

install-binaries: libdpnetwork.a dpwish
	@for i in $(LIB_DIR) $(BIN_DIR) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@echo "Installing libdpnetwork.a"
	@$(INSTALL_DATA) libdpnetwork.a $(LIB_DIR)/libdpnetwork.a
	@$(RANLIB) $(LIB_DIR)/libdpnetwork.a
	@echo "Installing dpwish"
	@$(INSTALL_PROGRAM) dpwish $(BIN_DIR)/dpwish

install-libraries:
	@for i in $(prefix)/lib $(INCLUDE_DIR) $(DP_LIBRARY) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@echo "Installing dp.h"
	@$(INSTALL_DATA) $(SRC_DIR)/dp.h $(INCLUDE_DIR)
	@cd $(SRC_DIR)/library; for i in *.tcl tclIndex; \
	    do \
	    echo "Installing library/$$i"; \
	    $(INSTALL_DATA) $$i $(DP_LIBRARY); \
	    done;


install-man:
	@for i in $(MAN_DIR) $(MAN1_DIR) $(MAN3_DIR) $(MANN_DIR) ; \
	    do \
	    if [ ! -d $$i ] ; then \
		echo "Making directory $$i"; \
		mkdir $$i; \
		chmod 755 $$i; \
		else true; \
		fi; \
	    done;
	@cd $(SRC_DIR)/doc; for i in *.1; \
	    do \
	    echo "Installing doc/$$i"; \
	    rm -f $(MAN1_DIR)/$$i; \
	    cp $$i  $(MAN1_DIR)/$$i; \
	    chmod 444 $(MAN1_DIR)/$$i; \
	    done;
	@cd $(SRC_DIR)/doc; for i in *.3; \
	    do \
	    echo "Installing doc/$$i"; \
	    rm -f $(MAN3_DIR)/$$i; \
	    cp $$i  $(MAN3_DIR)/$$i; \
	    chmod 444 $(MAN3_DIR)/$$i; \
	    done;
	@cd $(SRC_DIR)/doc; for i in *.n; \
	    do \
	    echo "Installing doc/$$i"; \
	    rm -f $(MANN_DIR)/$$i; \
	    cp $$i  $(MANN_DIR)/$$i; \
	    chmod 444 $(MANN_DIR)/$$i; \
	    done;

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

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

distclean: clean
	rm -f Makefile config.status

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