# Don't edit Makefile!  Use conf-* for configuration.
#
# Generated by spac see http://untroubled.org/spac/

SHELL=/bin/sh

DEFAULT: all

all: programs installer instcheck instshow

cdb/cdb.a: makelib cdb/cdb.o cdb/find.o cdb/hash.o cdb/read.o cdb/uint32_unpack.o
	./makelib cdb/cdb.a cdb/cdb.o cdb/find.o cdb/hash.o cdb/read.o cdb/uint32_unpack.o

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

cdb/find.o: compile cdb/find.c cdb/cdb.h uint32.h
	./compile cdb/find.c

cdb/hash.o: compile cdb/hash.c cdb/cdb.h uint32.h
	./compile cdb/hash.c

cdb/read.o: compile cdb/read.c cdb/cdb.h uint32.h
	./compile cdb/read.c

cdb/uint32_unpack.o: compile cdb/uint32_unpack.c uint32.h
	./compile cdb/uint32_unpack.c

choose: warn-auto.sh choose.sh
	cat warn-auto.sh choose.sh >choose
	chmod 755 choose

clean: TARGETS
	rm -f `cat TARGETS`

clean-spac: clean AUTOFILES
	rm -f `cat AUTOFILES`

cli/cli.a: makelib cli/main.o
	./makelib cli/cli.a cli/main.o

cli/main.o: compile cli/main.c iobuf/iobuf.h msg/msg.h systime.h cli/cli.h
	./compile cli/main.c

compile: conf-cc
	( echo '#!/bin/sh'; \
	  echo 'source=$$1; shift'; \
	  echo 'base=`echo "$$source" | sed -e s:\\\\.c$$::`'; \
	  echo exec `head -1 conf-cc` '-I. -o $${base}.o -c $$source $${1+"$$@"}'; \
	) >compile
	chmod 755 compile

conf_bin.c: conf-bin
	head -1 conf-bin | \
	  sed -e 's/"/\\"/g' \
	      -e 's/^/const char conf_bin[] = "/' \
	      -e 's/$$/";/' >conf_bin.c

dict/add.o: compile dict/add.c dict/dict.h str/str.h uint32.h
	./compile dict/add.c

dict/dict.a: makelib dict/add.o dict/free.o dict/get.o dict/hash.o dict/init.o dict/str_free.o
	./makelib dict/dict.a dict/add.o dict/free.o dict/get.o dict/hash.o dict/init.o dict/str_free.o

dict/free.o: compile dict/free.c dict/dict.h str/str.h uint32.h
	./compile dict/free.c

dict/get.o: compile dict/get.c dict/dict.h str/str.h uint32.h
	./compile dict/get.c

dict/hash.o: compile dict/hash.c dict/dict.h str/str.h uint32.h
	./compile dict/hash.c

dict/init.o: compile dict/init.c dict/dict.h str/str.h uint32.h
	./compile dict/init.c

dict/str_free.o: compile dict/str_free.c str/str.h dict/dict.h str/str.h uint32.h
	./compile dict/str_free.c

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

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

installer: load installer.o insthier.o
	./load installer insthier.o

installer.o: compile installer.c installer.h
	./compile installer.c

instcheck: load instcheck.o insthier.o
	./load instcheck insthier.o

instcheck.o: compile instcheck.c installer.h
	./compile instcheck.c

insthier.o: compile insthier.c conf_bin.c installer.h
	./compile insthier.c

instshow: load instshow.o insthier.o
	./load instshow insthier.o

instshow.o: compile instshow.c installer.h
	./compile instshow.c

iobuf/ibuf_getc.o: compile iobuf/ibuf_getc.c iobuf/iobuf.h
	./compile iobuf/ibuf_getc.c

iobuf/ibuf_gets.o: compile iobuf/ibuf_gets.c iobuf/iobuf.h
	./compile iobuf/ibuf_gets.c

iobuf/ibuf_getu.o: compile iobuf/ibuf_getu.c iobuf/iobuf.h
	./compile iobuf/ibuf_getu.c

iobuf/ibuf_init.o: compile iobuf/ibuf_init.c iobuf/iobuf.h
	./compile iobuf/ibuf_init.c

iobuf/ibuf_open.o: compile iobuf/ibuf_open.c iobuf/iobuf.h
	./compile iobuf/ibuf_open.c

iobuf/ibuf_peek.o: compile iobuf/ibuf_peek.c iobuf/iobuf.h
	./compile iobuf/ibuf_peek.c

iobuf/ibuf_read.o: compile iobuf/ibuf_read.c iobuf/iobuf.h
	./compile iobuf/ibuf_read.c

iobuf/ibuf_refill.o: compile iobuf/ibuf_refill.c iobuf/iobuf.h
	./compile iobuf/ibuf_refill.c

iobuf/ibuf_seek.o: compile iobuf/ibuf_seek.c iobuf/iobuf.h
	./compile iobuf/ibuf_seek.c

iobuf/ibuf_status.o: compile iobuf/ibuf_status.c iobuf/iobuf.h
	./compile iobuf/ibuf_status.c

iobuf/ibuf_stdin.o: compile iobuf/ibuf_stdin.c iobuf/iobuf.h
	./compile iobuf/ibuf_stdin.c

iobuf/ibuf_tell.o: compile iobuf/ibuf_tell.c iobuf/iobuf.h
	./compile iobuf/ibuf_tell.c

iobuf/iobuf.a: makelib iobuf/iobuf_close.o iobuf/iobuf_copy.o iobuf/iobuf_init.o iobuf/iobuf_timeout.o iobuf/ibuf_getc.o iobuf/ibuf_gets.o iobuf/ibuf_getu.o iobuf/ibuf_init.o iobuf/ibuf_open.o iobuf/ibuf_peek.o iobuf/ibuf_read.o iobuf/ibuf_refill.o iobuf/ibuf_seek.o iobuf/ibuf_status.o iobuf/ibuf_stdin.o iobuf/ibuf_tell.o iobuf/obuf_close.o iobuf/obuf_endl.o iobuf/obuf_flush.o iobuf/obuf_init.o iobuf/obuf_open.o iobuf/obuf_pad.o iobuf/obuf_put2s.o iobuf/obuf_put3s.o iobuf/obuf_put4s.o iobuf/obuf_put5s.o iobuf/obuf_put6s.o iobuf/obuf_put7s.o iobuf/obuf_putc.o iobuf/obuf_putiw.o iobuf/obuf_putnetstring.o iobuf/obuf_putsflush.o iobuf/obuf_putuw.o iobuf/obuf_seek.o iobuf/obuf_stderr.o iobuf/obuf_stdout.o iobuf/obuf_sync.o iobuf/obuf_write.o
	./makelib iobuf/iobuf.a iobuf/iobuf_close.o iobuf/iobuf_copy.o iobuf/iobuf_init.o iobuf/iobuf_timeout.o iobuf/ibuf_getc.o iobuf/ibuf_gets.o iobuf/ibuf_getu.o iobuf/ibuf_init.o iobuf/ibuf_open.o iobuf/ibuf_peek.o iobuf/ibuf_read.o iobuf/ibuf_refill.o iobuf/ibuf_seek.o iobuf/ibuf_status.o iobuf/ibuf_stdin.o iobuf/ibuf_tell.o iobuf/obuf_close.o iobuf/obuf_endl.o iobuf/obuf_flush.o iobuf/obuf_init.o iobuf/obuf_open.o iobuf/obuf_pad.o iobuf/obuf_put2s.o iobuf/obuf_put3s.o iobuf/obuf_put4s.o iobuf/obuf_put5s.o iobuf/obuf_put6s.o iobuf/obuf_put7s.o iobuf/obuf_putc.o iobuf/obuf_putiw.o iobuf/obuf_putnetstring.o iobuf/obuf_putsflush.o iobuf/obuf_putuw.o iobuf/obuf_seek.o iobuf/obuf_stderr.o iobuf/obuf_stdout.o iobuf/obuf_sync.o iobuf/obuf_write.o

iobuf/iobuf_close.o: compile iobuf/iobuf_close.c iobuf/iobuf.h
	./compile iobuf/iobuf_close.c

iobuf/iobuf_copy.o: compile iobuf/iobuf_copy.c iobuf/iobuf.h
	./compile iobuf/iobuf_copy.c

iobuf/iobuf_init.o: compile iobuf/iobuf_init.c iobuf/iobuf.h
	./compile iobuf/iobuf_init.c

iobuf/iobuf_timeout.o: compile iobuf/iobuf_timeout.c iobuf/iobuf.h iopoll.h
	./compile iobuf/iobuf_timeout.c

iobuf/obuf_close.o: compile iobuf/obuf_close.c iobuf/iobuf.h
	./compile iobuf/obuf_close.c

iobuf/obuf_endl.o: compile iobuf/obuf_endl.c iobuf/iobuf.h
	./compile iobuf/obuf_endl.c

iobuf/obuf_flush.o: compile iobuf/obuf_flush.c iobuf/iobuf.h
	./compile iobuf/obuf_flush.c

iobuf/obuf_init.o: compile iobuf/obuf_init.c iobuf/iobuf.h
	./compile iobuf/obuf_init.c

iobuf/obuf_open.o: compile iobuf/obuf_open.c iobuf/iobuf.h
	./compile iobuf/obuf_open.c

iobuf/obuf_pad.o: compile iobuf/obuf_pad.c iobuf/iobuf.h
	./compile iobuf/obuf_pad.c

iobuf/obuf_put2s.o: compile iobuf/obuf_put2s.c iobuf/iobuf.h
	./compile iobuf/obuf_put2s.c

iobuf/obuf_put3s.o: compile iobuf/obuf_put3s.c iobuf/iobuf.h
	./compile iobuf/obuf_put3s.c

iobuf/obuf_put4s.o: compile iobuf/obuf_put4s.c iobuf/iobuf.h
	./compile iobuf/obuf_put4s.c

iobuf/obuf_put5s.o: compile iobuf/obuf_put5s.c iobuf/iobuf.h
	./compile iobuf/obuf_put5s.c

iobuf/obuf_put6s.o: compile iobuf/obuf_put6s.c iobuf/iobuf.h
	./compile iobuf/obuf_put6s.c

iobuf/obuf_put7s.o: compile iobuf/obuf_put7s.c iobuf/iobuf.h
	./compile iobuf/obuf_put7s.c

iobuf/obuf_putc.o: compile iobuf/obuf_putc.c iobuf/iobuf.h
	./compile iobuf/obuf_putc.c

iobuf/obuf_putiw.o: compile iobuf/obuf_putiw.c iobuf/iobuf.h
	./compile iobuf/obuf_putiw.c

iobuf/obuf_putnetstring.o: compile iobuf/obuf_putnetstring.c iobuf/iobuf.h
	./compile iobuf/obuf_putnetstring.c

iobuf/obuf_putsflush.o: compile iobuf/obuf_putsflush.c iobuf/iobuf.h
	./compile iobuf/obuf_putsflush.c

iobuf/obuf_putuw.o: compile iobuf/obuf_putuw.c iobuf/iobuf.h
	./compile iobuf/obuf_putuw.c

iobuf/obuf_seek.o: compile iobuf/obuf_seek.c iobuf/iobuf.h
	./compile iobuf/obuf_seek.c

iobuf/obuf_stderr.o: compile iobuf/obuf_stderr.c iobuf/iobuf.h
	./compile iobuf/obuf_stderr.c

iobuf/obuf_stdout.o: compile iobuf/obuf_stdout.c iobuf/iobuf.h
	./compile iobuf/obuf_stdout.c

iobuf/obuf_sync.o: compile iobuf/obuf_sync.c iobuf/iobuf.h
	./compile iobuf/obuf_sync.c

iobuf/obuf_write.o: compile iobuf/obuf_write.c iobuf/iobuf.h
	./compile iobuf/obuf_write.c

iopoll.h: choose compile load trypoll.c iopoll.h1 iopoll.h2 iopoll.c
	./choose clr trypoll iopoll.h1 iopoll.h2 > iopoll.h

iopoll.o: compile iopoll.c iopoll.h select.h
	./compile iopoll.c

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

makelib: 
	( echo '#!/bin/sh'; \
	  echo 'main="$$1"; shift';\
	  echo 'rm -f "$$main"';\
	  echo 'ar cr "$$main" $${1+"$$@"}';\
	  echo 'ranlib "$$main"';\
	) >makelib
	chmod 755 makelib

msg/common.o: compile msg/common.c iobuf/iobuf.h msg/msg.h
	./compile msg/common.c

msg/debug.o: compile msg/debug.c msg/msg.h
	./compile msg/debug.c

msg/die.o: compile msg/die.c msg/msg.h
	./compile msg/die.c

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

msg/msg.a: makelib msg/common.o msg/debug.o msg/die.o msg/error.o msg/warn.o
	./makelib msg/msg.a msg/common.o msg/debug.o msg/die.o msg/error.o msg/warn.o

msg/warn.o: compile msg/warn.c iobuf/iobuf.h msg/msg.h
	./compile msg/warn.c

msg/wrap.a: makelib msg/wrap.o
	./makelib msg/wrap.a msg/wrap.o

msg/wrap.o: compile msg/wrap.c msg/msg.h msg/wrap.h
	./compile msg/wrap.c

openread.o: compile openread.c str/str.h qmail-notify.h
	./compile openread.c

programs: qmail-notify

qmail-notify: load qmail-notify.o openread.o qmail-notify-make.o cli/cli.a cdb/cdb.a msg/wrap.a msg/msg.a iobuf/iobuf.a dict/dict.a str/str.a iopoll.o
	./load qmail-notify openread.o qmail-notify-make.o cli/cli.a cdb/cdb.a msg/wrap.a msg/msg.a iobuf/iobuf.a dict/dict.a str/str.a iopoll.o 

qmail-notify-make.o: compile qmail-notify-make.c systime.h msg/msg.h qmail-notify.h
	./compile qmail-notify-make.c

qmail-notify.o: compile qmail-notify.c cdb/cdb.h uint32.h cli/cli.h dict/dict.h str/str.h uint32.h msg/msg.h msg/wrap.h str/str.h direntry.h fork.h systime.h qmail-notify.h
	./compile qmail-notify.c

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

str/buildmap.o: compile str/buildmap.c str/str.h
	./compile str/buildmap.c

str/cat.o: compile str/cat.c str/str.h
	./compile str/cat.c

str/cat2s.o: compile str/cat2s.c str/str.h
	./compile str/cat2s.c

str/cat3s.o: compile str/cat3s.c str/str.h
	./compile str/cat3s.c

str/cat4s.o: compile str/cat4s.c str/str.h
	./compile str/cat4s.c

str/cat5s.o: compile str/cat5s.c str/str.h
	./compile str/cat5s.c

str/cat6s.o: compile str/cat6s.c str/str.h
	./compile str/cat6s.c

str/catiw.o: compile str/catiw.c str/str.h
	./compile str/catiw.c

str/catuw.o: compile str/catuw.c str/str.h
	./compile str/catuw.c

str/cmp.o: compile str/cmp.c str/str.h
	./compile str/cmp.c

str/copy.o: compile str/copy.c str/str.h
	./compile str/copy.c

str/copy2s.o: compile str/copy2s.c str/str.h
	./compile str/copy2s.c

str/copy3s.o: compile str/copy3s.c str/str.h
	./compile str/copy3s.c

str/copy4s.o: compile str/copy4s.c str/str.h
	./compile str/copy4s.c

str/copy5s.o: compile str/copy5s.c str/str.h
	./compile str/copy5s.c

str/copy6s.o: compile str/copy6s.c str/str.h
	./compile str/copy6s.c

str/count.o: compile str/count.c str/str.h
	./compile str/count.c

str/countof.o: compile str/countof.c str/str.h
	./compile str/countof.c

str/cut.o: compile str/cut.c str/str.h
	./compile str/cut.c

str/diff.o: compile str/diff.c str/str.h
	./compile str/diff.c

str/findnext.o: compile str/findnext.c str/str.h
	./compile str/findnext.c

str/findnextof.o: compile str/findnextof.c str/str.h
	./compile str/findnextof.c

str/findprev.o: compile str/findprev.c str/str.h
	./compile str/findprev.c

str/findprevof.o: compile str/findprevof.c str/str.h
	./compile str/findprevof.c

str/free.o: compile str/free.c str/str.h
	./compile str/free.c

str/init.o: compile str/init.c str/str.h
	./compile str/init.c

str/join.o: compile str/join.c str/str.h
	./compile str/join.c

str/lower.o: compile str/lower.c str/str.h
	./compile str/lower.c

str/lstrip.o: compile str/lstrip.c str/str.h
	./compile str/lstrip.c

str/ready.o: compile str/ready.c str/str.h
	./compile str/ready.c

str/realloc.o: compile str/realloc.c str/str.h
	./compile str/realloc.c

str/rstrip.o: compile str/rstrip.c str/str.h
	./compile str/rstrip.c

str/sort.o: compile str/sort.c str/str.h
	./compile str/sort.c

str/str.a: makelib str/buildmap.o str/cat.o str/cat2s.o str/cat3s.o str/cat4s.o str/cat5s.o str/cat6s.o str/catiw.o str/catuw.o str/cmp.o str/copy.o str/copy2s.o str/copy3s.o str/copy4s.o str/copy5s.o str/copy6s.o str/count.o str/countof.o str/cut.o str/diff.o str/findnext.o str/findnextof.o str/findprev.o str/findprevof.o str/free.o str/init.o str/join.o str/lower.o str/lstrip.o str/ready.o str/realloc.o str/rstrip.o str/sort.o str/subst.o str/truncate.o str/upper.o
	./makelib str/str.a str/buildmap.o str/cat.o str/cat2s.o str/cat3s.o str/cat4s.o str/cat5s.o str/cat6s.o str/catiw.o str/catuw.o str/cmp.o str/copy.o str/copy2s.o str/copy3s.o str/copy4s.o str/copy5s.o str/copy6s.o str/count.o str/countof.o str/cut.o str/diff.o str/findnext.o str/findnextof.o str/findprev.o str/findprevof.o str/free.o str/init.o str/join.o str/lower.o str/lstrip.o str/ready.o str/realloc.o str/rstrip.o str/sort.o str/subst.o str/truncate.o str/upper.o

str/subst.o: compile str/subst.c str/str.h
	./compile str/subst.c

str/truncate.o: compile str/truncate.c str/str.h
	./compile str/truncate.c

str/upper.o: compile str/upper.c str/str.h
	./compile str/upper.c

systime.h: compile trysystime.c trytime.c
	( ( ./compile trysystime.c >/dev/null 2>&1 && \
	    echo '#include <sys/time.h>' ); \
	  ( ./compile trytime.c >/dev/null 2>&1 && \
	    echo '#include <time.h>' ) ) >systime.h
	rm -f trysystime.o trytime.o

uint32.h: choose compile load tryulong32.c uint32.h1 uint32.h2
	./choose clr tryulong32 uint32.h1 uint32.h2 > uint32.h

