default: it

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

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

bin: \
load bin.o libsubstdio.a liberror.a libstr.a
	./load bin libsubstdio.a liberror.a libstr.a

bin.o: \
compile bin.c substdio.h bin.c subfd.h bin.c conf-bin.h bin.c
	./compile bin.c

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

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

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

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

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

compile: \
make-commands systype
	./make-commands "`cat ./systype`" compile > compile
	chmod 755 compile

control.o: \
compile control.c readwrite.h control.c open.h control.c getline.h \
control.c stralloc.h gen_alloc.h stralloc.h control.c substdio.h \
control.c error.h control.c control.h control.c alloc.h control.c \
scan.h control.c
	./compile control.c

date822fmt.o: \
compile date822fmt.c datetime.h date822fmt.c fmt.h date822fmt.c \
date822fmt.h date822fmt.c
	./compile date822fmt.c

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

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

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

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

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

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

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

find-systype: \
find-systype.sh conf-cc.sh warn-auto.sh
	cat warn-auto.sh conf-cc.sh find-systype.sh > find-systype
	chmod 755 find-systype

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

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

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

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

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

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

getline2.o: \
compile getline2.c substdio.h getline2.c byte.h getline2.c stralloc.h \
gen_alloc.h stralloc.h getline2.c alloc.h getline2.c getline.h \
getline2.c
	./compile getline2.c

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

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

it: \
maildir2smtp maildir2qmtp maildirbounce

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

libcase.a: \
makelib case_diffb.o
	./makelib libcase.a case_diffb.o

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

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

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

libfs.a: \
makelib fmt_str.o fmt_uint.o fmt_uint0.o fmt_ulong.o scan_nbblong.o \
scan_ulong.o
	./makelib libfs.a fmt_str.o fmt_uint.o fmt_uint0.o \
	fmt_ulong.o scan_nbblong.o scan_ulong.o

libgetline.a: \
makelib getline.o getline2.o
	./makelib libgetline.a getline.o getline2.o

libopen.a: \
makelib open_read.o
	./makelib libopen.a open_read.o

libsig.a: \
makelib sig_catch.o sig_pipe.o
	./makelib libsig.a sig_catch.o sig_pipe.o

libstr.a: \
makelib str_len.o str_diff.o str_diffn.o str_cpy.o str_chr.o \
str_rchr.o byte_chr.o byte_copy.o byte_cr.o byte_zero.o
	./makelib libstr.a str_len.o str_diff.o str_diffn.o \
	str_cpy.o str_chr.o str_rchr.o byte_chr.o byte_copy.o \
	byte_cr.o byte_zero.o

libstralloc.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 libstralloc.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

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

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

libwait.a: \
makelib wait_pid.o
	./makelib libwait.a wait_pid.o

load: \
make-commands systype
	./make-commands "`cat ./systype`" load > load
	chmod 755 load

maildir.o: \
compile maildir.c maildir.c maildir.c prioq.h datetime.h prioq.h \
gen_alloc.h prioq.h maildir.c env.h maildir.c stralloc.h gen_alloc.h \
stralloc.h maildir.c direntry.h direntry.h direntry.h maildir.c \
datetime.h datetime.h maildir.c now.h datetime.h datetime.h now.h \
maildir.c str.h maildir.c maildir.h strerr.h maildir.h maildir.c
	./compile maildir.c

maildir2qmtp: \
load maildir2qmtp.o timeoutread.o timeoutwrite.o timeoutconn.o \
maildir.o prioq.o ndelay.o now.o ip.o libstrerr.a libenv.a \
libgetline.a libsubstdio.a libstralloc.a liballoc.a liberror.a \
libopen.a libwait.a libsig.a libstr.a libcase.a libfs.a
	./load maildir2qmtp timeoutread.o timeoutwrite.o \
	timeoutconn.o maildir.o prioq.o ndelay.o now.o ip.o \
	libstrerr.a libenv.a libgetline.a libsubstdio.a \
	libstralloc.a liballoc.a liberror.a libopen.a libwait.a \
	libsig.a libstr.a libcase.a libfs.a

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

maildir2qmtp.o: \
compile maildir2qmtp.c maildir2qmtp.c maildir2qmtp.c maildir2qmtp.c \
maildir2qmtp.c maildir2qmtp.c getline.h maildir2qmtp.c stralloc.h \
gen_alloc.h stralloc.h maildir2qmtp.c substdio.h maildir2qmtp.c \
subfd.h maildir2qmtp.c prioq.h datetime.h prioq.h gen_alloc.h prioq.h \
maildir2qmtp.c sig.h maildir2qmtp.c fork.h maildir2qmtp.c readwrite.h \
maildir2qmtp.c exit.h maildir2qmtp.c maildir.h strerr.h maildir.h \
maildir2qmtp.c open.h maildir2qmtp.c case.h maildir2qmtp.c fmt.h \
maildir2qmtp.c str.h maildir2qmtp.c wait.h maildir2qmtp.c ip.h \
maildir2qmtp.c error.h maildir2qmtp.c timeoutconn.h maildir2qmtp.c \
timeoutread.h maildir2qmtp.c timeoutwrite.h maildir2qmtp.c
	./compile maildir2qmtp.c

maildir2smtp: \
load maildir2smtp.o timeoutread.o timeoutwrite.o timeoutconn.o \
quote.o maildir.o prioq.o ndelay.o now.o ip.o libstrerr.a libenv.a \
libgetline.a libsubstdio.a libstralloc.a liballoc.a liberror.a \
libopen.a libsig.a libstr.a libcase.a libfs.a
	./load maildir2smtp timeoutread.o timeoutwrite.o \
	timeoutconn.o quote.o maildir.o prioq.o ndelay.o now.o ip.o \
	libstrerr.a libenv.a libgetline.a libsubstdio.a \
	libstralloc.a liballoc.a liberror.a libopen.a libsig.a \
	libstr.a libcase.a libfs.a

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

maildir2smtp.o: \
compile maildir2smtp.c maildir2smtp.c maildir2smtp.c maildir2smtp.c \
maildir2smtp.c getline.h maildir2smtp.c substdio.h maildir2smtp.c \
subfd.h maildir2smtp.c stralloc.h gen_alloc.h stralloc.h \
maildir2smtp.c maildir.h strerr.h maildir.h maildir2smtp.c prioq.h \
datetime.h prioq.h gen_alloc.h prioq.h maildir2smtp.c open.h \
maildir2smtp.c readwrite.h maildir2smtp.c exit.h maildir2smtp.c sig.h \
maildir2smtp.c str.h maildir2smtp.c case.h maildir2smtp.c error.h \
maildir2smtp.c quote.h maildir2smtp.c ip.h maildir2smtp.c scan.h \
maildir2smtp.c timeoutconn.h maildir2smtp.c timeoutread.h \
maildir2smtp.c timeoutwrite.h maildir2smtp.c
	./compile maildir2smtp.c

maildirbounce: \
load maildirbounce.o control.o qqtalk.o quote.o now.o datetime.o \
date822fmt.o libgetline.a libsubstdio.a libstralloc.a liballoc.a \
liberror.a libopen.a libwait.a libfd.a libstr.a libfs.a
	./load maildirbounce control.o qqtalk.o quote.o now.o \
	datetime.o date822fmt.o libgetline.a libsubstdio.a \
	libstralloc.a liballoc.a liberror.a libopen.a libwait.a \
	libfd.a libstr.a libfs.a

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

maildirbounce.o: \
compile maildirbounce.c getline.h maildirbounce.c control.h \
maildirbounce.c stralloc.h gen_alloc.h stralloc.h maildirbounce.c \
readwrite.h maildirbounce.c substdio.h maildirbounce.c subfd.h \
maildirbounce.c qqtalk.h substdio.h substdio.h qqtalk.h \
maildirbounce.c quote.h maildirbounce.c open.h maildirbounce.c str.h \
maildirbounce.c datetime.h maildirbounce.c date822fmt.h \
maildirbounce.c now.h datetime.h datetime.h now.h maildirbounce.c \
fmt.h maildirbounce.c conf-mailhome.h maildirbounce.c
	./compile maildirbounce.c

make-commands: \
make-cmds.sh conf-cc.sh warn-auto.sh
	cat warn-auto.sh conf-cc.sh make-cmds.sh > make-commands
	chmod 755 make-commands

makelib: \
make-commands systype
	./make-commands "`cat ./systype`" makelib > makelib
	chmod 755 makelib

man: \
maildir2smtp.0 maildir2qmtp.0 maildirbounce.0

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

now.o: \
compile now.c now.c datetime.h now.c now.h datetime.h datetime.h \
now.h now.c
	./compile now.c

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

prioq.o: \
compile prioq.c alloc.h prioq.c gen_allocdefs.h prioq.c prioq.h \
datetime.h prioq.h gen_alloc.h prioq.h prioq.c
	./compile prioq.c

qqtalk.o: \
compile qqtalk.c fd.h qqtalk.c readwrite.h qqtalk.c wait.h qqtalk.c \
substdio.h qqtalk.c exit.h qqtalk.c fork.h qqtalk.c qqtalk.h \
substdio.h substdio.h qqtalk.h qqtalk.c qqx.h qqtalk.c
	./compile qqtalk.c

quote.o: \
compile quote.c stralloc.h gen_alloc.h stralloc.h quote.c str.h \
quote.c quote.h quote.c
	./compile quote.c

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

scan_ulong.o: \
compile scan_ulong.c scan.h scan_ulong.c
	./compile scan_ulong.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: \
setupbin bin it
	./setupbin "`./bin`"

setupbin: \
warn-auto.sh setupbin.sh
	cat warn-auto.sh setupbin.sh > setupbin
	chmod 755 setupbin

shar: \
FILES BLURB README INSTALL TODO THANKS CHANGES FILES VERSION SYSDEPS \
RFCQMTP Makefile maildirbounce.1 maildirbounce.c maildir2smtp.1 \
maildir2smtp.c maildir2qmtp.1 maildir2qmtp.c bin.c setupbin.sh \
conf-bin.h conf-mailhome.h conf-cc.sh find-systype.sh make-cmds.sh \
trycpp.c warn-auto.sh fmt.h fmt_str.c fmt_uint.c fmt_uint0.c \
fmt_ulong.c scan.h scan_ulong.c byte.h byte_chr.c byte_copy.c \
byte_cr.c byte_zero.c str.h str_chr.c str_cpy.c str_diff.c \
str_diffn.c str_len.c str_rchr.c error.h error.c error_str.c \
substdio.h substdio.c substdi.c substdo.c substdio_copy.c subfd.h \
subfderr.c subfdouts.c subfdout.c subfdin.c readwrite.h exit.h \
getline.h getline.c getline2.c alloc.h alloc.c alloc_re.c gen_alloc.h \
gen_allocdefs.h 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 control.h control.c open.h \
open_read.c qqx.h qqtalk.h qqtalk.c wait.h wait_pid.c trywaitp.c fd.h \
fd_copy.c fd_move.c fork.h1 fork.h2 tryvfork.c quote.h quote.c \
datetime.h datetime.c now.h now.c maildir.5 maildir.h maildir.c \
prioq.h prioq.c env.h envread.c direntry.h1 direntry.h2 trydrent.c \
strerr.h strerr.c strerr_sys.c strerr_die.c sig.h sig_catch.c \
sig_pipe.c trysgact.c trysgprm.c case.h case_diffb.c ip.h ip.c \
timeoutconn.h timeoutconn.c ndelay.h ndelay.c select.h1 select.h2 \
trysysel.c date822fmt.h date822fmt.c timeoutread.h timeoutread.c \
timeoutwrite.h timeoutwrite.c
	shar -m `cat FILES` > shar
	chmod 400 shar

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

strerr.o: \
compile strerr.c stralloc.h gen_alloc.h stralloc.h strerr.c strerr.h \
strerr.c
	./compile strerr.c

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

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

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

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

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

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

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

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

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

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

systype: \
find-systype trycpp.c
	./find-systype > systype

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

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

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

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