# 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.  You should normally set these to the
# same values you used in the tk installation.

exec_prefix =   /u1/new_tcl
prefix =        /u1/new_tcl

# 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 and dptcl:
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 header files (i.e., tcl.h) appropriate
# for this version of Tcl-DP.  If they're in a standard place, leave this
# blank
# TCL_INCLUDES = -I<./../tcl7.3
TCL_INCLUDES = -I$(prefix)/include

# The directory in which the library of Tcl scripts is installed.  This
# variable is only used for "make test"
# TCL_LIBRARY =   ./../tcl7.3/library
TCL_LIBRARY =   $(prefix)/lib/tcl

# The directory containing the Tcl header files (i.e., tcl.h) appropriate
# for this version of Tcl-DP.  If they're in a standard place, leave this
# blank
# TK_INCLUDES = -I./../tk3.6
TK_INCLUDES = -I$(prefix)/include

# The directory in which the library of Tk scripts is installed.  This
# variable is only used for "make test"
# TK_LIBRARY =   ./../tk3.6/library
TK_LIBRARY =   $(prefix)/lib/tcl

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

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

# 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

#----------------------------------------------------------------
# Most of the rest of these options you probably won't have to touch.
#----------------------------------------------------------------

# 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

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

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

# 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 -DUNIX_SOCKET=1 -DHAVE_ERRNO_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_MALLOC_H=1 -DHAVE_TOLOWER=1 -DHAVE_STRING_H=1
INSTALL =		cp
INSTALL_PROGRAM =	$(INSTALL)
INSTALL_DATA =		$(INSTALL)
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/usr/include -I${SRC_DIR} ${TCL_INCLUDES} \
${TK_INCLUDES} -I${INCLUDE_DIR} ${AC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \
-DDP_LIBRARY=\"${DP_LIBRARY}\" ${HP_ANSI_FLAGS} ${X11_INCLUDES}

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

TKNX_OBJS = tkArgv.o tkCmds.o tkBind.o tkPreserve.o tkEvent.o

all: dpwish dptcl

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

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

dptcl: dpwish
	rm -f dptcl
	ln -s dpwish dptcl

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

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
	@echo "Installing dptcl"
	@rm -f $(BIN_DIR)/dptcl
	@ln -s $(BIN_DIR)/dpwish $(BIN_DIR)/dptcl

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; tar cf - man1) | (cd $(MAN_DIR); tar xf -)
	@(cd $(SRC_DIR)/doc; tar cf - man3) | (cd $(MAN_DIR); tar xf -)
	@(cd $(SRC_DIR)/doc; tar cf - mann) | (cd $(MAN_DIR); tar xf -)

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

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

distclean: clean
	rm -f Makefile config.status

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