# Don't edit Makefile! Use conf-* for configuration.

SHELL=/bin/sh

default: it

addcr: \
load addcr.o substdio.a error.a str.a
	./load addcr substdio.a error.a str.a 

addcr.0: \
addcr.1
	nroff -man addcr.1 > addcr.0

addcr.o: \
compile addcr.c substdio.h subfd.h substdio.h exit.h
	./compile addcr.c

alloc.0: \
alloc.3
	nroff -man alloc.3 > alloc.0

alloc.a: \
makelib alloc.o alloc_re.o
	./makelib alloc.a alloc.o alloc_re.o

alloc.o: \
compile alloc.c alloc.h error.h
	./compile alloc.c

alloc_re.o: \
compile alloc_re.c alloc.h byte.h
	./compile alloc_re.c

argv0: \
load argv0.o strerr.a substdio.a error.a str.a
	./load argv0 strerr.a substdio.a error.a str.a 

argv0.0: \
argv0.1
	nroff -man argv0.1 > argv0.0

argv0.o: \
compile argv0.c strerr.h
	./compile argv0.c

auto-str: \
load auto-str.o substdio.a error.a str.a
	./load auto-str substdio.a error.a str.a 

auto-str.o: \
compile auto-str.c substdio.h readwrite.h exit.h
	./compile auto-str.c

auto_home.c: \
auto-str conf-home
	./auto-str auto_home `head -1 conf-home` > auto_home.c

auto_home.o: \
compile auto_home.c
	./compile auto_home.c

byte_chr.o: \
compile byte_chr.c byte.h
	./compile byte_chr.c

byte_copy.o: \
compile byte_copy.c byte.h
	./compile byte_copy.c

byte_cr.o: \
compile byte_cr.c byte.h
	./compile byte_cr.c

byte_diff.o: \
compile byte_diff.c byte.h
	./compile byte_diff.c

byte_rchr.o: \
compile byte_rchr.c byte.h
	./compile byte_rchr.c

byte_zero.o: \
compile byte_zero.c byte.h
	./compile byte_zero.c

case.0: \
case.3
	nroff -man case.3 > case.0

case.a: \
makelib case_lowers.o
	./makelib case.a case_lowers.o

case_lowers.o: \
compile case_lowers.c case.h
	./compile case_lowers.c

cdb.0: \
cdb.3
	nroff -man cdb.3 > cdb.0

cdb.a: \
makelib cdb_hash.o cdb_unpack.o cdb_seek.o
	./makelib cdb.a cdb_hash.o cdb_unpack.o cdb_seek.o

cdb_hash.o: \
compile cdb_hash.c cdb.h uint32.h
	./compile cdb_hash.c

cdb_seek.o: \
compile cdb_seek.c cdb.h uint32.h
	./compile cdb_seek.c

cdb_unpack.o: \
compile cdb_unpack.c cdb.h uint32.h
	./compile cdb_unpack.c

cdbmake.a: \
makelib cdbmake_pack.o cdbmake_hash.o cdbmake_add.o
	./makelib cdbmake.a cdbmake_pack.o cdbmake_hash.o \
	cdbmake_add.o

cdbmake_add.o: \
compile cdbmake_add.c cdbmake.h uint32.h
	./compile cdbmake_add.c

cdbmake_hash.o: \
compile cdbmake_hash.c cdbmake.h uint32.h
	./compile cdbmake_hash.c

cdbmake_pack.o: \
compile cdbmake_pack.c cdbmake.h uint32.h
	./compile cdbmake_pack.c

cdbmss.o: \
compile cdbmss.c readwrite.h seek.h alloc.h cdbmss.h cdbmake.h \
uint32.h substdio.h
	./compile cdbmss.c

check: \
it instcheck
	./instcheck

compile: \
warn-auto.sh conf-cc
	( cat warn-auto.sh; \
	echo exec "`head -1 conf-cc`" '-c $${1+"$$@"}' \
	) > compile
	chmod 755 compile

date@: \
warn-auto.sh date@.sh conf-home
	cat warn-auto.sh date@.sh \
	| sed s}HOME}"`head -1 conf-home`"}g \
	> date@
	chmod 755 date@

date@.0: \
date@.1
	nroff -man date@.1 > date@.0

delcr: \
load delcr.o substdio.a error.a str.a
	./load delcr substdio.a error.a str.a 

delcr.0: \
delcr.1
	nroff -man delcr.1 > delcr.0

delcr.o: \
compile delcr.c substdio.h subfd.h substdio.h exit.h
	./compile delcr.c

dns.lib: \
tryrsolv.c compile load socket.lib
	( ( ./compile tryrsolv.c && ./load tryrsolv \
	-lresolv `cat socket.lib` ) >/dev/null 2>&1 \
	&& echo -lresolv || exit 0 ) > dns.lib
	rm -f tryrsolv.o tryrsolv

dns.o: \
compile dns.c ip.h ipalloc.h ip.h gen_alloc.h fmt.h alloc.h str.h \
stralloc.h gen_alloc.h dns.h case.h
	./compile dns.c

env.0: \
env.3
	nroff -man env.3 > env.0

env.a: \
makelib env.o envread.o
	./makelib env.a env.o envread.o

env.o: \
compile env.c str.h alloc.h env.h
	./compile env.c

envread.o: \
compile envread.c env.h str.h
	./compile envread.c

error.0: \
error.3
	nroff -man error.3 > error.0

error.a: \
makelib error.o error_str.o
	./makelib error.a error.o error_str.o

error.o: \
compile error.c error.h
	./compile error.c

error_str.0: \
error_str.3
	nroff -man error_str.3 > error_str.0

error_str.o: \
compile error_str.c error.h
	./compile error_str.c

fd.a: \
makelib fd_copy.o fd_move.o
	./makelib fd.a fd_copy.o fd_move.o

fd_copy.0: \
fd_copy.3
	nroff -man fd_copy.3 > fd_copy.0

fd_copy.o: \
compile fd_copy.c fd.h
	./compile fd_copy.c

fd_move.0: \
fd_move.3
	nroff -man fd_move.3 > fd_move.0

fd_move.o: \
compile fd_move.c fd.h
	./compile fd_move.c

finger@: \
warn-auto.sh finger@.sh conf-home
	cat warn-auto.sh finger@.sh \
	| sed s}HOME}"`head -1 conf-home`"}g \
	> finger@
	chmod 755 finger@

finger@.0: \
finger@.1
	nroff -man finger@.1 > finger@.0

fixcr: \
load fixcr.o substdio.a error.a str.a
	./load fixcr substdio.a error.a str.a 

fixcr.0: \
fixcr.1
	nroff -man fixcr.1 > fixcr.0

fixcr.o: \
compile fixcr.c substdio.h subfd.h substdio.h exit.h
	./compile fixcr.c

fmt_str.o: \
compile fmt_str.c fmt.h
	./compile fmt_str.c

fmt_ulong.o: \
compile fmt_ulong.c fmt.h
	./compile fmt_ulong.c

fs.a: \
makelib fmt_str.o fmt_ulong.o scan_ulong.o
	./makelib fs.a fmt_str.o fmt_ulong.o scan_ulong.o

getln.0: \
getln.3
	nroff -man getln.3 > getln.0

getln.a: \
makelib getln.o getln2.o
	./makelib getln.a getln.o getln2.o

getln.o: \
compile getln.c substdio.h byte.h stralloc.h gen_alloc.h getln.h
	./compile getln.c

getln2.0: \
getln2.3
	nroff -man getln2.3 > getln2.0

getln2.o: \
compile getln2.c substdio.h stralloc.h gen_alloc.h byte.h getln.h
	./compile getln2.c

getopt.a: \
makelib subgetopt.o sgetopt.o
	./makelib getopt.a subgetopt.o sgetopt.o

hassgact.h: \
trysgact.c compile load
	( ( ./compile trysgact.c && ./load trysgact ) >/dev/null \
	2>&1 \
	&& echo \#define HASSIGACTION 1 || exit 0 ) > hassgact.h
	rm -f trysgact.o trysgact

hassgprm.h: \
trysgprm.c compile load
	( ( ./compile trysgprm.c && ./load trysgprm ) >/dev/null \
	2>&1 \
	&& echo \#define HASSIGPROCMASK 1 || exit 0 ) > hassgprm.h
	rm -f trysgprm.o trysgprm

haswaitp.h: \
trywaitp.c compile load
	( ( ./compile trywaitp.c && ./load trywaitp ) >/dev/null \
	2>&1 \
	&& echo \#define HASWAITPID 1 || exit 0 ) > haswaitp.h
	rm -f trywaitp.o trywaitp

hier.o: \
compile hier.c auto_home.h
	./compile hier.c

http@: \
warn-auto.sh http@.sh conf-home
	cat warn-auto.sh http@.sh \
	| sed s}HOME}"`head -1 conf-home`"}g \
	> http@
	chmod 755 http@

http@.0: \
http@.1
	nroff -man http@.1 > http@.0

install: \
load install.o hier.o auto_home.o strerr.a substdio.a open.a error.a \
str.a
	./load install hier.o auto_home.o strerr.a substdio.a \
	open.a error.a str.a 

install.o: \
compile install.c substdio.h strerr.h error.h open.h readwrite.h \
exit.h
	./compile install.c

instcheck: \
load instcheck.o hier.o auto_home.o strerr.a substdio.a error.a str.a
	./load instcheck hier.o auto_home.o strerr.a substdio.a \
	error.a str.a 

instcheck.o: \
compile instcheck.c strerr.h error.h readwrite.h exit.h
	./compile instcheck.c

ip.o: \
compile ip.c fmt.h scan.h ip.h
	./compile ip.c

ipalloc.o: \
compile ipalloc.c alloc.h gen_allocdefs.h ip.h ipalloc.h ip.h \
gen_alloc.h
	./compile ipalloc.c

it: \
man prog install instcheck

load: \
warn-auto.sh conf-ld
	( cat warn-auto.sh; \
	echo 'main="$$1"; shift'; \
	echo exec "`head -1 conf-ld`" \
	'-o "$$main" "$$main".o $${1+"$$@"}' \
	) > load
	chmod 755 load

makelib: \
warn-auto.sh systype
	( cat warn-auto.sh; \
	echo 'main="$$1"; shift'; \
	echo 'rm -f "$$main"'; \
	echo 'ar cr "$$main" $${1+"$$@"}'; \
	case "`cat systype`" in \
	sunos-5.*) ;; \
	unix_sv*) ;; \
	irix64-*) ;; \
	irix-*) ;; \
	dgux-*) ;; \
	hp-ux-*) ;; \
	sco*) ;; \
	*) echo 'ranlib "$$main"' ;; \
	esac \
	) > makelib
	chmod 755 makelib

man: \
tcpclient.0 tcpserver.0 tcprules.0 tcprulescheck.0 tcp-environ.0 \
who@.0 date@.0 finger@.0 http@.0 tcpcat.0 mconnect.0 fixcr.0 addcr.0 \
delcr.0 argv0.0 recordio.0 error.0 error_str.0 alloc.0 case.0 cdb.0 \
env.0 fd_copy.0 fd_move.0 getln.0 getln2.0 sgetopt.0 subgetopt.0 \
stralloc.0 wait.0

mconnect: \
warn-auto.sh mconnect.sh conf-home
	cat warn-auto.sh mconnect.sh \
	| sed s}HOME}"`head -1 conf-home`"}g \
	> mconnect
	chmod 755 mconnect

mconnect-io: \
load mconnect-io.o strerr.a substdio.a error.a str.a wait.a sig.a
	./load mconnect-io strerr.a substdio.a error.a str.a \
	wait.a sig.a 

mconnect-io.o: \
compile mconnect-io.c sig.h substdio.h strerr.h readwrite.h exit.h
	./compile mconnect-io.c

mconnect.0: \
mconnect.1
	nroff -man mconnect.1 > mconnect.0

ndelay.a: \
makelib ndelay.o ndelay_off.o
	./makelib ndelay.a ndelay.o ndelay_off.o

ndelay.o: \
compile ndelay.c ndelay.h
	./compile ndelay.c

ndelay_off.o: \
compile ndelay_off.c ndelay.h
	./compile ndelay_off.c

open.a: \
makelib open_read.o open_trunc.o
	./makelib open.a open_read.o open_trunc.o

open_read.o: \
compile open_read.c open.h
	./compile open_read.c

open_trunc.o: \
compile open_trunc.c open.h
	./compile open_trunc.c

prog: \
tcpclient tcpserver tcprules tcprulescheck who@ date@ finger@ http@ \
tcpcat mconnect mconnect-io fixcr addcr delcr argv0 recordio rts

recordio: \
load recordio.o strerr.a substdio.a error.a str.a fs.a fd.a sig.a
	./load recordio strerr.a substdio.a error.a str.a fs.a \
	fd.a sig.a 

recordio.0: \
recordio.1
	nroff -man recordio.1 > recordio.0

recordio.o: \
compile recordio.c sig.h substdio.h strerr.h str.h byte.h readwrite.h \
exit.h fmt.h select.h
	./compile recordio.c

remoteinfo.o: \
compile remoteinfo.c byte.h substdio.h ip.h fmt.h timeoutconn.h \
timeoutread.h timeoutwrite.h remoteinfo.h
	./compile remoteinfo.c

rts: \
warn-auto.sh rts.sh conf-home
	cat warn-auto.sh rts.sh \
	| sed s}HOME}"`head -1 conf-home`"}g \
	> rts
	chmod 755 rts

scan_ulong.o: \
compile scan_ulong.c scan.h
	./compile scan_ulong.c

seek.a: \
makelib seek_set.o
	./makelib seek.a seek_set.o

seek_set.o: \
compile seek_set.c seek.h
	./compile seek_set.c

select.h: \
compile trysysel.c select.h1 select.h2
	( ./compile trysysel.c >/dev/null 2>&1 \
	&& cat select.h2 || cat select.h1 ) > select.h
	rm -f trysysel.o trysysel

setup: \
it install
	./install

sgetopt.0: \
sgetopt.3
	nroff -man sgetopt.3 > sgetopt.0

sgetopt.o: \
compile sgetopt.c substdio.h subfd.h substdio.h sgetopt.h subgetopt.h \
subgetopt.h
	./compile sgetopt.c

shar: \
FILES BLURB README TODO THANKS CHANGES UCSPI TCP FILES VERSION \
SYSDEPS TARGETS Makefile tcpclient.1 tcpclient.c who@.1 who@.sh \
date@.1 date@.sh finger@.1 finger@.sh http@.1 http@.sh tcpcat.1 \
tcpcat.sh mconnect.1 mconnect.sh mconnect-io.c delcr.1 delcr.c \
addcr.1 addcr.c fixcr.1 fixcr.c tcpserver.1 tcpserver.c tcprules.1 \
tcprules.c tcprulescheck.1 tcprulescheck.c tcp-environ.5 recordio.1 \
recordio.c argv0.1 argv0.c rts.sh rts.tests rts.exp conf-cc conf-ld \
find-systype.sh trycpp.c warn-auto.sh INSTALL hier.c conf-home \
auto-str.c auto_home.h install.c instcheck.c substdio.h substdio.c \
substdi.c substdo.c substdio_copy.c subfd.h subfderr.c subfdout.c \
subfdin.c readwrite.h exit.h strerr.h strerr_sys.c strerr_die.c \
error.3 error_str.3 error.h error.c error_str.c open.h open_read.c \
open_trunc.c byte.h byte_chr.c byte_copy.c byte_cr.c byte_diff.c \
byte_rchr.c byte_zero.c str.h str_chr.c str_cpy.c str_diff.c \
str_diffn.c str_len.c alloc.3 alloc.h alloc.c alloc_re.c case.3 \
case.h case_lowers.c cdb.3 cdb.h cdb_hash.c cdb_seek.c cdb_unpack.c \
cdbmake.h cdbmake_add.c cdbmake_hash.c cdbmake_pack.c cdbmss.h \
cdbmss.c dns.h dns.c trylsock.c tryrsolv.c env.3 env.h env.c \
envread.c fd.h fd_copy.3 fd_copy.c fd_move.3 fd_move.c fmt.h \
fmt_str.c fmt_ulong.c scan.h scan_ulong.c getln.3 getln.h getln.c \
getln2.3 getln2.c sgetopt.3 sgetopt.h sgetopt.c subgetopt.3 \
subgetopt.h subgetopt.c ip.h ip.c ipalloc.h ipalloc.c ndelay.h \
ndelay.c ndelay_off.c remoteinfo.h remoteinfo.c seek.h seek_set.c \
select.h1 select.h2 trysysel.c sig.h sig_block.c sig_catch.c \
sig_pause.c sig_pipe.c sig_child.c sig_term.c trysgact.c trysgprm.c \
gen_alloc.h gen_allocdefs.h stralloc.3 stralloc.h stralloc_eady.c \
stralloc_pend.c stralloc_copy.c stralloc_opyb.c stralloc_opys.c \
stralloc_cat.c stralloc_catb.c stralloc_cats.c timeoutconn.h \
timeoutconn.c timeoutread.h timeoutread.c timeoutwrite.h \
timeoutwrite.c uint32.h1 uint32.h2 tryulong32.c wait.3 wait.h \
wait_nohang.c wait_pid.c trywaitp.c
	shar -m `cat FILES` > shar
	chmod 400 shar

sig.a: \
makelib sig_block.o sig_catch.o sig_pause.o sig_pipe.o sig_child.o \
sig_term.o
	./makelib sig.a sig_block.o sig_catch.o sig_pause.o \
	sig_pipe.o sig_child.o sig_term.o

sig_block.o: \
compile sig_block.c sig.h hassgprm.h
	./compile sig_block.c

sig_catch.o: \
compile sig_catch.c sig.h hassgact.h
	./compile sig_catch.c

sig_child.o: \
compile sig_child.c sig.h
	./compile sig_child.c

sig_pause.o: \
compile sig_pause.c sig.h hassgprm.h
	./compile sig_pause.c

sig_pipe.o: \
compile sig_pipe.c sig.h
	./compile sig_pipe.c

sig_term.o: \
compile sig_term.c sig.h
	./compile sig_term.c

socket.lib: \
trylsock.c compile load
	( ( ./compile trylsock.c && \
	./load trylsock -lsocket -lnsl ) >/dev/null 2>&1 \
	&& echo -lsocket -lnsl || exit 0 ) > socket.lib
	rm -f trylsock.o trylsock

str.a: \
makelib str_chr.o str_len.o str_diff.o str_diffn.o str_cpy.o \
byte_chr.o byte_rchr.o byte_diff.o byte_copy.o byte_cr.o byte_zero.o
	./makelib str.a str_chr.o str_len.o str_diff.o str_diffn.o \
	str_cpy.o byte_chr.o byte_rchr.o byte_diff.o byte_copy.o \
	byte_cr.o byte_zero.o

str_chr.o: \
compile str_chr.c str.h
	./compile str_chr.c

str_cpy.o: \
compile str_cpy.c str.h
	./compile str_cpy.c

str_diff.o: \
compile str_diff.c str.h
	./compile str_diff.c

str_diffn.o: \
compile str_diffn.c str.h
	./compile str_diffn.c

str_len.o: \
compile str_len.c str.h
	./compile str_len.c

stralloc.0: \
stralloc.3
	nroff -man stralloc.3 > stralloc.0

stralloc.a: \
makelib stralloc_eady.o stralloc_pend.o stralloc_copy.o \
stralloc_opys.o stralloc_opyb.o stralloc_cat.o stralloc_cats.o \
stralloc_catb.o
	./makelib stralloc.a stralloc_eady.o stralloc_pend.o \
	stralloc_copy.o stralloc_opys.o stralloc_opyb.o \
	stralloc_cat.o stralloc_cats.o stralloc_catb.o

stralloc_cat.o: \
compile stralloc_cat.c byte.h stralloc.h gen_alloc.h
	./compile stralloc_cat.c

stralloc_catb.o: \
compile stralloc_catb.c stralloc.h gen_alloc.h byte.h
	./compile stralloc_catb.c

stralloc_cats.o: \
compile stralloc_cats.c byte.h str.h stralloc.h gen_alloc.h
	./compile stralloc_cats.c

stralloc_copy.o: \
compile stralloc_copy.c byte.h stralloc.h gen_alloc.h
	./compile stralloc_copy.c

stralloc_eady.o: \
compile stralloc_eady.c alloc.h stralloc.h gen_alloc.h \
gen_allocdefs.h
	./compile stralloc_eady.c

stralloc_opyb.o: \
compile stralloc_opyb.c stralloc.h gen_alloc.h byte.h
	./compile stralloc_opyb.c

stralloc_opys.o: \
compile stralloc_opys.c byte.h str.h stralloc.h gen_alloc.h
	./compile stralloc_opys.c

stralloc_pend.o: \
compile stralloc_pend.c alloc.h stralloc.h gen_alloc.h \
gen_allocdefs.h
	./compile stralloc_pend.c

strerr.a: \
makelib strerr_sys.o strerr_die.o
	./makelib strerr.a strerr_sys.o strerr_die.o

strerr_die.o: \
compile strerr_die.c substdio.h subfd.h substdio.h exit.h strerr.h
	./compile strerr_die.c

strerr_sys.o: \
compile strerr_sys.c error.h strerr.h
	./compile strerr_sys.c

subfderr.o: \
compile subfderr.c readwrite.h substdio.h subfd.h substdio.h
	./compile subfderr.c

subfdin.o: \
compile subfdin.c readwrite.h substdio.h subfd.h substdio.h
	./compile subfdin.c

subfdout.o: \
compile subfdout.c readwrite.h substdio.h subfd.h substdio.h
	./compile subfdout.c

subgetopt.0: \
subgetopt.3
	nroff -man subgetopt.3 > subgetopt.0

subgetopt.o: \
compile subgetopt.c subgetopt.h
	./compile subgetopt.c

substdi.o: \
compile substdi.c substdio.h byte.h error.h
	./compile substdi.c

substdio.a: \
makelib substdio.o substdi.o substdo.o subfderr.o subfdout.o \
subfdin.o substdio_copy.o
	./makelib substdio.a substdio.o substdi.o substdo.o \
	subfderr.o subfdout.o subfdin.o substdio_copy.o

substdio.o: \
compile substdio.c substdio.h
	./compile substdio.c

substdio_copy.o: \
compile substdio_copy.c substdio.h
	./compile substdio_copy.c

substdo.o: \
compile substdo.c substdio.h str.h byte.h error.h
	./compile substdo.c

systype: \
find-systype.sh conf-cc conf-ld trycpp.c
	( cat warn-auto.sh; \
	echo CC=\'`head -1 conf-cc`\'; \
	echo LD=\'`head -1 conf-ld`\'; \
	cat find-systype.sh; \
	) | sh > systype

tcp-environ.0: \
tcp-environ.5
	nroff -man tcp-environ.5 > tcp-environ.0

tcpcat: \
warn-auto.sh tcpcat.sh conf-home
	cat warn-auto.sh tcpcat.sh \
	| sed s}HOME}"`head -1 conf-home`"}g \
	> tcpcat
	chmod 755 tcpcat

tcpcat.0: \
tcpcat.1
	nroff -man tcpcat.1 > tcpcat.0

tcpclient: \
load tcpclient.o ip.o ipalloc.o dns.o remoteinfo.o timeoutconn.o \
timeoutread.o timeoutwrite.o getopt.a strerr.a stralloc.a env.a \
alloc.a ndelay.a substdio.a error.a str.a sig.a fd.a case.a fs.a \
dns.lib socket.lib
	./load tcpclient ip.o ipalloc.o dns.o remoteinfo.o \
	timeoutconn.o timeoutread.o timeoutwrite.o getopt.a \
	strerr.a stralloc.a env.a alloc.a ndelay.a substdio.a \
	error.a str.a sig.a fd.a case.a fs.a  `cat dns.lib` `cat \
	socket.lib`

tcpclient.0: \
tcpclient.1
	nroff -man tcpclient.1 > tcpclient.0

tcpclient.o: \
compile tcpclient.c strerr.h stralloc.h gen_alloc.h str.h byte.h \
sig.h fd.h ip.h ipalloc.h ip.h gen_alloc.h case.h sgetopt.h \
subgetopt.h exit.h scan.h fmt.h env.h dns.h remoteinfo.h
	./compile tcpclient.c

tcprules: \
load tcprules.o cdbmss.o cdbmake.a getln.a strerr.a stralloc.a \
substdio.a alloc.a error.a open.a seek.a str.a fs.a
	./load tcprules cdbmss.o cdbmake.a getln.a strerr.a \
	stralloc.a substdio.a alloc.a error.a open.a seek.a str.a \
	fs.a 

tcprules.0: \
tcprules.1
	nroff -man tcprules.1 > tcprules.0

tcprules.o: \
compile tcprules.c strerr.h stralloc.h gen_alloc.h getln.h substdio.h \
subfd.h substdio.h exit.h fmt.h byte.h cdbmss.h cdbmake.h uint32.h \
substdio.h
	./compile tcprules.c

tcprulescheck: \
load tcprulescheck.o cdb.a stralloc.a alloc.a strerr.a substdio.a \
error.a str.a open.a
	./load tcprulescheck cdb.a stralloc.a alloc.a strerr.a \
	substdio.a error.a str.a open.a 

tcprulescheck.0: \
tcprulescheck.1
	nroff -man tcprulescheck.1 > tcprulescheck.0

tcprulescheck.o: \
compile tcprulescheck.c substdio.h subfd.h substdio.h strerr.h \
stralloc.h gen_alloc.h alloc.h cdb.h uint32.h
	./compile tcprulescheck.c

tcpserver: \
load tcpserver.o ip.o ipalloc.o dns.o remoteinfo.o timeoutconn.o \
timeoutread.o timeoutwrite.o cdb.a open.a wait.a strerr.a stralloc.a \
env.a ndelay.a alloc.a getopt.a substdio.a error.a str.a sig.a fd.a \
case.a fs.a dns.lib socket.lib
	./load tcpserver ip.o ipalloc.o dns.o remoteinfo.o \
	timeoutconn.o timeoutread.o timeoutwrite.o cdb.a open.a \
	wait.a strerr.a stralloc.a env.a ndelay.a alloc.a getopt.a \
	substdio.a error.a str.a sig.a fd.a case.a fs.a  `cat \
	dns.lib` `cat socket.lib`

tcpserver.0: \
tcpserver.1
	nroff -man tcpserver.1 > tcpserver.0

tcpserver.o: \
compile tcpserver.c strerr.h substdio.h stralloc.h gen_alloc.h \
alloc.h readwrite.h fd.h sig.h wait.h ip.h ipalloc.h ip.h gen_alloc.h \
dns.h str.h case.h byte.h sgetopt.h subgetopt.h remoteinfo.h exit.h \
open.h scan.h fmt.h env.h cdb.h uint32.h
	./compile tcpserver.c

timeoutconn.o: \
compile timeoutconn.c ndelay.h select.h error.h readwrite.h ip.h \
byte.h timeoutconn.h
	./compile timeoutconn.c

timeoutread.o: \
compile timeoutread.c timeoutread.h select.h error.h readwrite.h
	./compile timeoutread.c

timeoutwrite.o: \
compile timeoutwrite.c timeoutwrite.h select.h error.h readwrite.h
	./compile timeoutwrite.c

uint32.h: \
tryulong32.c compile load uint32.h1 uint32.h2
	( ( ./compile tryulong32.c && ./load tryulong32 && \
	./tryulong32 ) >/dev/null 2>&1 \
	&& cat uint32.h2 || cat uint32.h1 ) > uint32.h
	rm -f tryulong32.o tryulong32

wait.0: \
wait.3
	nroff -man wait.3 > wait.0

wait.a: \
makelib wait_nohang.o wait_pid.o
	./makelib wait.a wait_nohang.o wait_pid.o

wait_nohang.o: \
compile wait_nohang.c haswaitp.h
	./compile wait_nohang.c

wait_pid.o: \
compile wait_pid.c error.h haswaitp.h
	./compile wait_pid.c

who@: \
warn-auto.sh who@.sh conf-home
	cat warn-auto.sh who@.sh \
	| sed s}HOME}"`head -1 conf-home`"}g \
	> who@
	chmod 755 who@

who@.0: \
who@.1
	nroff -man who@.1 > who@.0
