# $Id: Makefile,v 2.2 90/07/11 13:11:12 mbp Exp Locker: mbp $

#################################
#  Begin configuration section  #
#################################

# The following must be hard-coded if not using csh; if not using csh,
# remove the comment char (#) from the beginning of the next line and
# replace the path with the complete pathname of the dir that this
# makefile is in:
#PWD=/u/yourlogin/src/bothpipe

# Compiler options.
OPTIONS=-g

# The next four macros should give the pathnames of the system header
# files
#		<sys/types.h>
#		<sys/socket.h>
#		<netinet/in.h>
#		<netdb.h>
# We do this via macros because on some systems these files have
# pathnames other than these.  (For example, on the IRIS they are
# <bsd/sys/types.h>, <bsd/sys/socket.h>, <bsd/netinet/in.h>, and
# <bsd/netdb.h>).
SYS_TYPES_H=<sys/types.h>
SYS_SOCKET_H=<sys/socket.h>
NETINET_IN_H=<netinet/in.h>
NETDB_H=<netdb.h>

# BOTHPIPEDIR should be the pathname of the 'bothpipe' dir.
BOTHPIPEDIR=../bothpipe

# LIBS should give any libraries that must be loaded.  On BSD
# systems this should be left blank.  On the IRIS, it should
# be LIBS=-lbsd
LIBS=

# BINDIR should be the directory in which you want to install the
# executable file (used only by 'make install').
BINDIR=$(HOME)/bin/$(CPUTYPE)

# CP = copying command to use when installing files
CP=ln

####################################
#    End configuration section     #
# don't change anything below here #
####################################

SHELL=/bin/sh

MAKEFILE = Makefile

INSTALL_BIN = instl

INSTALL = $(INSTALL_BIN) -cp "$(CP)"

BOTHPIPE.o=$(BOTHPIPEDIR)/bothpipe.o
BOTHPIPE.h=$(BOTHPIPEDIR)/bothpipe.h

elbowd:	elbowd.o $(BOTHPIPE.o)
	cd $(BOTHPIPEDIR) ;			\
	  $(MAKE) PWD=$(BOTHPIPEDIR)		\
	       OPTIONS="$(OPTIONS)"		\
	       SYS_TYPES_H='$(SYS_TYPES_H)'	\
	       SYS_SOCKET_H='$(SYS_SOCKET_H)'	\
	       NETINET_IN_H='$(NETINET_IN_H)'	\
	       NETDB_H='$(NETDB_H)'		\
	    bothpipe.o
	cc $(OPTIONS) \
	  -o elbowd elbowd.o $(BOTHPIPE.o) $(LIBS)

elbowd.o:	elbowd.c $(BOTHPIPE.h)
	cc -c $(OPTIONS)			\
	  -DBOTHPIPE_H='"$(BOTHPIPE.h)"' 	\
	  -DSYS_TYPES_H='$(SYS_TYPES_H)'	\
	  -DSYS_SOCKET_H='$(SYS_SOCKET_H)'	\
	  -DNETINET_IN_H='$(NETINET_IN_H)'	\
	  -DNETDB_H='$(NETDB_H)'		\
	  -o elbowd.o elbowd.c

$(BOTHPIPE.o):
	#

echotest:	echotest.c
	cc $(OPTIONS) -o echotest echotest.c

install:	elbowd
	strip elbowd
	$(INSTALL) '$(BINDIR)' elbowd

clean:
	/bin/rm -f *~ *.o ;
	cd $(BOTHPIPEDIR) ; make clean

veryclean:	clean
	/bin/rm -f elbowd ;
	cd $(BOTHPIPEDIR) ; make veryclean

distclean:	veryclean

# for backwards compatibility with older versions of other makefiles
# which call this one:
install_quietly:	install


