# This file is automatically generated, do not edit.
SHELL=/bin/sh
default: it

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

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

buffer_0.o: \
compile buffer_0.c buffer.h
	./compile buffer_0.c

buffer_1.o: \
compile buffer_1.c buffer.h
	./compile buffer_1.c

buffer_2.o: \
compile buffer_2.c buffer.h
	./compile buffer_2.c

buffer_copy.o: \
compile buffer_copy.c buffer.h
	./compile buffer_copy.c

buffer_copyline.o: \
compile buffer_copyline.c buffer.h byte.h
	./compile buffer_copyline.c

buffer_get.o: \
compile buffer_get.c buffer.h byte.h error.h
	./compile buffer_get.c

buffer_gets.o: \
compile buffer_gets.c buffer.h byte.h
	./compile buffer_gets.c

buffer_put.o: \
compile buffer_put.c buffer.h str.h byte.h error.h
	./compile buffer_put.c

buffer_read.o: \
compile buffer_read.c buffer.h
	./compile buffer_read.c

buffer_write.o: \
compile buffer_write.c buffer.h
	./compile buffer_write.c

byte.a: \
makelib byte_chr.o byte_rchr.o fmt_uint.o fmt_uint0.o fmt_ulong.o scan_ulong.o scan_8long.o str_chr.o str_start.o
	./makelib byte.a byte_chr.o byte_rchr.o fmt_uint.o fmt_uint0.o fmt_ulong.o scan_ulong.o scan_8long.o str_chr.o str_start.o

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

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

chkshsgr: \
load chkshsgr.o
	./load chkshsgr 

chkshsgr.o: \
compile chkshsgr.c
	./compile chkshsgr.c

choose: \
choose.sh warn-auto.sh
	rm -f choose
	cat warn-auto.sh choose.sh > choose
	chmod 555 choose

clean: \
TARGETS
	rm -f $$( cat TARGETS )

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

compile: \
conf-cc print-cc.sh systype warn-auto.sh
	rm -f compile
	sh print-cc.sh > compile
	chmod 555 compile

conf_supervise.c: \
conf-supervise
	echo 'const char conf_supervise[] = "'`head -n 1 conf-supervise`'";' >conf_supervise.c

deepsleep.o: \
compile deepsleep.c iopause.h deepsleep.h
	./compile deepsleep.c

direntry.h: \
choose compile direntry.h1 direntry.h2 trydrent.c
	./choose c trydrent direntry.h1 direntry.h2 > direntry.h

dosubst: \
warn-auto.sh conf-supervise
	cat warn-auto.sh > dosubst
	echo "sed -e 's}@SUPERVISEDIR@}supervise}g'" >> dosubst
	chmod 755 dosubst

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

envdir: \
load envdir.o unix.a byte.a
	./load envdir unix.a byte.a 

envdir.o: \
compile envdir.c byte.h open.h error.h direntry.h stralloc.h gen_alloc.h openreadclose.h stralloc.h gen_alloc.h strerr.h hasattribute.h pathexec.h sgetopt.h subgetopt.h
	./compile envdir.c

envini: \
load envini.o unix.a byte.a
	./load envini unix.a byte.a 

envini.o: \
compile envini.c byte.h open.h error.h direntry.h stralloc.h gen_alloc.h openreadclose.h stralloc.h gen_alloc.h strerr.h hasattribute.h pathexec.h sgetopt.h subgetopt.h
	./compile envini.c

envuidgid: \
load envuidgid.o unix.a byte.a
	./load envuidgid unix.a byte.a 

envuidgid.o: \
compile envuidgid.c fmt.h strerr.h hasattribute.h pathexec.h
	./compile envuidgid.c

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

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

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

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

fghack: \
load fghack.o unix.a byte.a
	./load fghack unix.a byte.a 

fghack.o: \
compile fghack.c wait.h error.h strerr.h hasattribute.h buffer.h pathexec.h
	./compile fghack.c

fifo.o: \
compile fifo.c hasmkffo.h fifo.h
	./compile fifo.c

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

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

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

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

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

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

hasattribute.h: \
choose compile tryattribute.c hasattribute.h1 hasattribute.h2
	./choose c tryattribute hasattribute.h1 hasattribute.h2 > hasattribute.h

hasflock.h: \
choose compile hasflock.h1 hasflock.h2 load tryflock.c
	./choose cl tryflock hasflock.h1 hasflock.h2 > hasflock.h

hasmemrchr.h: \
choose compile hasmemrchr.h1 hasmemrchr.h2 load trymemrchr.c
	./choose cl trymemrchr hasmemrchr.h1 hasmemrchr.h2 > hasmemrchr.h

hasmkffo.h: \
choose compile hasmkffo.h1 hasmkffo.h2 load trymkffo.c
	./choose cl trymkffo hasmkffo.h1 hasmkffo.h2 > hasmkffo.h

hassgact.h: \
choose compile hassgact.h1 hassgact.h2 load trysgact.c
	./choose cl trysgact hassgact.h1 hassgact.h2 > hassgact.h

hassgprm.h: \
choose compile hassgprm.h1 hassgprm.h2 load trysgprm.c
	./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h

hasshsgr.h: \
chkshsgr choose compile hasshsgr.h1 hasshsgr.h2 load tryshsgr.c warn-shsgr
	./chkshsgr || ( cat warn-shsgr; exit 1 )
	./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h

haswaitp.h: \
choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c
	./choose cl trywaitp haswaitp.h1 haswaitp.h2 > haswaitp.h

install: \
installer BIN conf-bin MAN conf-man
	./installer `head -n 1 conf-bin` <BIN
	./installer `head -n 1 conf-man` <MAN

installer: \
load installer.o getln.a unix.a byte.a
	./load installer getln.a unix.a byte.a 

installer.o: \
compile installer.c buffer.h stralloc.h gen_alloc.h getln.h open.h error.h strerr.h hasattribute.h byte.h scan.h
	./compile installer.c

iopause.h: \
choose compile iopause.h1 iopause.h2 load trypoll.c taia.h uint64.h
	./choose clr trypoll iopause.h1 iopause.h2 > iopause.h

iopause.o: \
compile iopause.c taia.h tai.h uint64.h select.h iopause.h
	./compile iopause.c

it: \
rts sysdeps man

load: \
conf-ld print-ld.sh systype warn-auto.sh
	rm -f load
	sh print-ld.sh > load
	chmod 555 load

lock_ex.o: \
compile lock_ex.c hasflock.h lock.h
	./compile lock_ex.c

lock_exnb.o: \
compile lock_exnb.c hasflock.h lock.h
	./compile lock_exnb.c

makelib: \
print-ar.sh systype warn-auto.sh
	rm -f makelib
	sh print-ar.sh > makelib
	chmod 555 makelib

man: \
envdir.8 envini.8 envuidgid.8 fghack.8 multilog.8 pgrphack.8 readproctitle.8 setlock.8 setuidgid.8 softlimit.8 supervise.8 svc.8 svok.8 svscan.8 svscanboot.8 svstat.8 svup.8 tai64n.8 tai64nlocal.8

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

matchtest: \
load matchtest.o match.o unix.a byte.a
	./load matchtest match.o unix.a byte.a 

matchtest.o: \
compile matchtest.c match.h buffer.h str.h
	./compile matchtest.c

multilog: \
load multilog.o deepsleep.o match.o timestamp.o time.a unix.a byte.a
	./load multilog deepsleep.o match.o timestamp.o time.a unix.a byte.a 

multilog.o: \
compile multilog.c direntry.h alloc.h stralloc.h gen_alloc.h buffer.h strerr.h hasattribute.h error.h open.h lock.h scan.h str.h byte.h seek.h timestamp.h wait.h closeonexec.h env.h fd.h sig.h match.h deepsleep.h
	./compile multilog.c

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

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

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

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

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

openreadclose.o: \
compile openreadclose.c error.h open.h readclose.h stralloc.h gen_alloc.h openreadclose.h stralloc.h gen_alloc.h
	./compile openreadclose.c

pathexec_env.o: \
compile pathexec_env.c stralloc.h gen_alloc.h alloc.h str.h byte.h env.h pathexec.h
	./compile pathexec_env.c

pathexec_run.o: \
compile pathexec_run.c error.h stralloc.h gen_alloc.h str.h env.h pathexec.h
	./compile pathexec_run.c

pgrphack: \
load pgrphack.o unix.a byte.a
	./load pgrphack unix.a byte.a 

pgrphack.o: \
compile pgrphack.c strerr.h hasattribute.h pathexec.h
	./compile pgrphack.c

programs: \
envdir envini envuidgid fghack installer matchtest multilog pgrphack readproctitle setlock setuidgid setuser sleeper softlimit supervise svc svok svscan svscanboot svstat svup tai64n tai64nlocal

prot.o: \
compile prot.c hasshsgr.h prot.h
	./compile prot.c

readclose.o: \
compile readclose.c error.h readclose.h stralloc.h gen_alloc.h
	./compile readclose.c

readproctitle: \
load readproctitle.o unix.a byte.a
	./load readproctitle unix.a byte.a 

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

rts: \
programs rts.sh rts.exp
	env - /bin/sh rts.sh 2>&1 | cat -v > rts
	diff -u rts.exp rts

rts.exp: \
rts.tests/envdir.exp rts.tests/envini.exp rts.tests/envuidgid.exp rts.tests/fghack.exp rts.tests/matchtest.exp rts.tests/multilog.exp rts.tests/nonexistent.exp rts.tests/pgrphack.exp rts.tests/readproctitle.exp rts.tests/setlock.exp rts.tests/softlimit.exp rts.tests/supervise-base.exp rts.tests/supervise-downtime.exp rts.tests/supervise-lock.exp rts.tests/supervise-notify.exp rts.tests/supervise-restart.exp rts.tests/supervise-start.exp rts.tests/supervise-stop.exp rts.tests/svc.exp rts.tests/svscan.exp rts.tests/tai64n.exp
	cat rts.tests/*.exp > rts.exp

rts.sh: \
rts.tests/00-preamble.sh rts.tests/envdir.sh rts.tests/envini.sh rts.tests/envuidgid.sh rts.tests/fghack.sh rts.tests/matchtest.sh rts.tests/multilog.sh rts.tests/nonexistent.sh rts.tests/pgrphack.sh rts.tests/readproctitle.sh rts.tests/setlock.sh rts.tests/softlimit.sh rts.tests/supervise-base.sh rts.tests/supervise-downtime.sh rts.tests/supervise-lock.sh rts.tests/supervise-notify.sh rts.tests/supervise-restart.sh rts.tests/supervise-start.sh rts.tests/supervise-stop.sh rts.tests/svc.sh rts.tests/svscan.sh rts.tests/tai64n.sh rts.tests/zz-cleanup.sh
	cat rts.tests/*.sh > rts.sh

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

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

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

select.h: \
choose compile select.h1 select.h2 trysysel.c
	./choose c trysysel select.h1 select.h2 > select.h

setlock: \
load setlock.o unix.a byte.a
	./load setlock unix.a byte.a 

setlock.o: \
compile setlock.c lock.h open.h strerr.h hasattribute.h pathexec.h sgetopt.h subgetopt.h
	./compile setlock.c

setuidgid: \
load setuidgid.o unix.a byte.a
	./load setuidgid unix.a byte.a 

setuidgid.o: \
compile setuidgid.c prot.h strerr.h hasattribute.h pathexec.h sgetopt.h subgetopt.h
	./compile setuidgid.c

setuser: \
load setuser.o unix.a byte.a
	./load setuser unix.a byte.a 

setuser.o: \
compile setuser.c fmt.h pathexec.h prot.h sgetopt.h subgetopt.h strerr.h hasattribute.h
	./compile setuser.c

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

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

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_pause.o: \
compile sig_pause.c sig.h hassgprm.h
	./compile sig_pause.c

sleeper: \
load sleeper.o byte.a unix.a
	./load sleeper byte.a unix.a 

sleeper.o: \
compile sleeper.c byte.h sig.h str.h
	./compile sleeper.c

softlimit: \
load softlimit.o unix.a byte.a
	./load softlimit unix.a byte.a 

softlimit.o: \
compile softlimit.c env.h pathexec.h sgetopt.h subgetopt.h strerr.h hasattribute.h scan.h str.h
	./compile softlimit.c

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

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

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

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 stralloc.h gen_alloc.h
	./compile stralloc_copy.c

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

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

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

strerr_die.o: \
compile strerr_die.c buffer.h strerr.h hasattribute.h
	./compile strerr_die.c

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

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

supervise.8: \
supervise.8.in dosubst
	./dosubst <supervise.8.in >supervise.8

supervise: \
load supervise.o deepsleep.o svpath.o time.a unix.a byte.a
	./load supervise deepsleep.o svpath.o time.a unix.a byte.a 

supervise.o: \
compile supervise.c sig.h strerr.h hasattribute.h error.h fifo.h fmt.h open.h lock.h seek.h wait.h closeonexec.h ndelay.h env.h iopause.h taia.h tai.h uint64.h deepsleep.h stralloc.h gen_alloc.h svpath.h svstatus.h
	./compile supervise.c

svc.8: \
svc.8.in dosubst
	./dosubst <svc.8.in >svc.8

svc: \
load svc.o svpath.o unix.a byte.a
	./load svc svpath.o unix.a byte.a 

svc.o: \
compile svc.c ndelay.h strerr.h hasattribute.h error.h open.h sgetopt.h subgetopt.h buffer.h byte.h sig.h svpath.h
	./compile svc.c

svok.8: \
svok.8.in dosubst
	./dosubst <svok.8.in >svok.8

svok: \
load svok.o svpath.o unix.a byte.a
	./load svok svpath.o unix.a byte.a 

svok.o: \
compile svok.c strerr.h hasattribute.h error.h open.h svpath.h
	./compile svok.c

svpath.o: \
compile svpath.c conf_supervise.c env.h stralloc.h gen_alloc.h svpath.h
	./compile svpath.c

svscan: \
load svscan.o unix.a byte.a
	./load svscan unix.a byte.a 

svscan.o: \
compile svscan.c sig.h direntry.h strerr.h hasattribute.h error.h open.h wait.h closeonexec.h fd.h env.h str.h byte.h pathexec.h
	./compile svscan.c

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

svstat.8: \
svstat.8.in dosubst
	./dosubst <svstat.8.in >svstat.8

svstat: \
load svstat.o svpath.o time.a unix.a byte.a
	./load svstat svpath.o time.a unix.a byte.a 

svstat.o: \
compile svstat.c strerr.h hasattribute.h error.h open.h fmt.h tai.h uint64.h buffer.h sgetopt.h subgetopt.h svpath.h svstatus.h
	./compile svstat.c

svup.8: \
svup.8.in dosubst
	./dosubst <svup.8.in >svup.8

svup: \
load svup.o svpath.o unix.a byte.a
	./load svup svpath.o unix.a byte.a 

svup.o: \
compile svup.c strerr.h hasattribute.h error.h open.h sgetopt.h subgetopt.h svpath.h svstatus.h
	./compile svup.c

sysdeps: \
compile direntry.h hasattribute.h hasflock.h hasmkffo.h hassgact.h hassgprm.h hasshsgr.h haswaitp.h iopause.h load select.h systype uint64.h hasmemrchr.h
	rm -f sysdeps
	cat systype compile load >> sysdeps
	grep sysdep direntry.h >> sysdeps
	grep sysdep haswaitp.h >> sysdeps
	grep sysdep hassgact.h >> sysdeps
	grep sysdep hassgprm.h >> sysdeps
	grep sysdep select.h >> sysdeps
	grep sysdep uint64.h >> sysdeps
	grep sysdep iopause.h >> sysdeps
	grep sysdep hasmkffo.h >> sysdeps
	grep sysdep hasflock.h >> sysdeps
	grep sysdep hasshsgr.h >> sysdeps
	grep sysdep hasattribute.h >> sysdeps
	grep sysdep hasmemrchr.h >> sysdeps

systype: \
find-systype.sh trycpp.c x86cpuid.c
	sh find-systype.sh > systype

tai64n: \
load tai64n.o timestamp.o time.a unix.a byte.a
	./load tai64n timestamp.o time.a unix.a byte.a 

tai64n.o: \
compile tai64n.c timestamp.h buffer.h
	./compile tai64n.c

tai64nlocal: \
load tai64nlocal.o unix.a byte.a
	./load tai64nlocal unix.a byte.a 

tai64nlocal.o: \
compile tai64nlocal.c buffer.h fmt.h
	./compile tai64nlocal.c

tai_now.o: \
compile tai_now.c tai.h uint64.h
	./compile tai_now.c

tai_pack.o: \
compile tai_pack.c tai.h uint64.h
	./compile tai_pack.c

tai_sub.o: \
compile tai_sub.c tai.h uint64.h
	./compile tai_sub.c

tai_unpack.o: \
compile tai_unpack.c tai.h uint64.h
	./compile tai_unpack.c

taia_add.o: \
compile taia_add.c taia.h tai.h uint64.h
	./compile taia_add.c

taia_approx.o: \
compile taia_approx.c taia.h tai.h uint64.h
	./compile taia_approx.c

taia_frac.o: \
compile taia_frac.c taia.h tai.h uint64.h
	./compile taia_frac.c

taia_less.o: \
compile taia_less.c taia.h tai.h uint64.h
	./compile taia_less.c

taia_now.o: \
compile taia_now.c taia.h tai.h uint64.h
	./compile taia_now.c

taia_pack.o: \
compile taia_pack.c taia.h tai.h uint64.h
	./compile taia_pack.c

taia_sub.o: \
compile taia_sub.c taia.h tai.h uint64.h
	./compile taia_sub.c

taia_uint.o: \
compile taia_uint.c taia.h tai.h uint64.h
	./compile taia_uint.c

targets: \
it install

time.a: \
makelib iopause.o tai_now.o tai_pack.o tai_sub.o tai_unpack.o taia_add.o taia_approx.o taia_frac.o taia_less.o taia_now.o taia_pack.o taia_sub.o taia_uint.o
	./makelib time.a iopause.o tai_now.o tai_pack.o tai_sub.o tai_unpack.o taia_add.o taia_approx.o taia_frac.o taia_less.o taia_now.o taia_pack.o taia_sub.o taia_uint.o

timestamp.o: \
compile timestamp.c fmt.h taia.h tai.h uint64.h timestamp.h
	./compile timestamp.c

uint64.h: \
choose compile load tryulong64.c uint64.h1 uint64.h2
	./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h

unix.a: \
makelib alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o buffer_copy.o buffer_copyline.o buffer_get.o buffer_gets.o buffer_put.o buffer_read.o buffer_write.o closeonexec.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o open_trunc.o open_write.o openreadclose.o pathexec_env.o pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o sig_block.o sig_catch.o sig_pause.o stralloc_append.o stralloc_catb.o stralloc_cat.o stralloc_cats.o stralloc_copyb.o stralloc_copy.o stralloc_copys.o stralloc_ready.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o wait_pid.o
	./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o buffer_copy.o buffer_copyline.o buffer_get.o buffer_gets.o buffer_put.o buffer_read.o buffer_write.o closeonexec.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o open_trunc.o open_write.o openreadclose.o pathexec_env.o pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o sig_block.o sig_catch.o sig_pause.o stralloc_append.o stralloc_catb.o stralloc_cat.o stralloc_cats.o stralloc_copyb.o stralloc_copy.o stralloc_copys.o stralloc_ready.o strerr_die.o strerr_sys.o subgetopt.o 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
