# Indicate your system:
OS=sun4.1
# Available choices are :
#	4.4bsd 4.3reno 4.3tahoe 4.3bsd
#	unicos5.0 unicos5.1 unicos6.0 unicos6.1 unicos7.0
#	sun3.5 sun4.0 sun4.0.3c sun4.1
#	dynix3.0.12 dynix3.0.17
#	ultrix3.1 ultrix4.0
#	next1.0
#	convex
#	irix4
# If your system is not on this list, either pick one that's closest
# and try it, or creat a new entry in the file Config.local.

# Directory into which rtelnet program will be installed:
BIN_DEST_DIR=/usr/local/bin

# Directory into which rtelnet's man page file will be installed:
MAN_DEST_DIR=/usr/local/man/man1

# Define RESOLV_LIB if your system (e.g., SunOS before 4.1.1)
# doesn't search resolver library automatically.
# Leave it undefined otherwise.
#RESOLV_LIB=-lresolv
# If your compiler or loader complains about _res_init being
# an undefined symbol, then you must define RESOLV_LIB.
#
# IRIX should use the next two lines:
#RESOLV_LIB=-lsun
#CCKR=-cckr

SOCKS_LIB=../../lib/libsocks.a

# The 'install' command is assumed to be the BSD variety (using -m to
# set the file mode). If the default 'install' on your system doesn't
# do that, you have to either specify an alternative one in the line below
# (e.g., /usr/ucb/install) or modify the install instructions.
INSTALL= install

#=======================================================
all: echocwd
	cd libtelnet; ${MAKE} ${OS} CC="${CC}" CCKR=$(CCKR) SOCKS_LIB=${SOCKS_LIB} RESOLV_LIB=${RESOLV_LIB}
	cd telnet; ${MAKE} ${OS} CC="${CC}" CCKR=$(CCKR) SOCKS_LIB=${SOCKS_LIB} RESOLV_LIB=${RESOLV_LIB}

install:  echocwd rtelnet
	$(INSTALL) -s -o bin -g bin -m 111 rtelnet ${BIN_DEST_DIR}

install.man: echocwd telnet/rtelnet.1
	$(INSTALL) -c -o bin -g bin -m 444 telnet/rtelnet.1 ${MAN_DEST_DIR}

clean: echocwd
	rm -f rtelnet
	cd libtelnet; ${MAKE} -f Makefile.generic clean
	cd telnet; ${MAKE} -f Makefile.generic clean

echocwd:
	@pwd

.DEFAULT:
	cd libtelnet; ${MAKE} ${OS} WHAT=${WHAT} CC="${CC}" SOCKS_LIB=${SOCKS_LIB} RESOLV_LIB=${RESOLV_LIB}
	cd telnet; ${MAKE} ${OS} WHAT=${WHAT} CC="${CC}" SOCKS_LIB=${SOCKS_LIB} RESOLV_LIB=${RESOLV_LIB}
