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

SHELL=/bin/sh

DEFAULT: all

adt/ghash_add.o: compile adt/ghash_add.c adt/ghash.h adt/common.h
	./compile adt/ghash_add.c

adt/ghash_foreach.o: compile adt/ghash_foreach.c adt/ghash.h adt/common.h
	./compile adt/ghash_foreach.c

adt/ghash_free.o: compile adt/ghash_free.c adt/ghash.h adt/common.h
	./compile adt/ghash_free.c

adt/ghash_get.o: compile adt/ghash_get.c adt/ghash.h adt/common.h
	./compile adt/ghash_get.c

adt/ghash_hash.o: compile adt/ghash_hash.c adt/ghash.h adt/common.h
	./compile adt/ghash_hash.c

adt/ghash_init.o: compile adt/ghash_init.c adt/ghash.h adt/common.h
	./compile adt/ghash_init.c

adt/ghash_insert.o: compile adt/ghash_insert.c adt/ghash.h adt/common.h
	./compile adt/ghash_insert.c

adt/ghash_rehash.o: compile adt/ghash_rehash.c adt/ghash.h adt/common.h
	./compile adt/ghash_rehash.c

adt/ghash_search.o: compile adt/ghash_search.c adt/ghash.h adt/common.h
	./compile adt/ghash_search.c

adt/gqueue_pop.o: compile adt/gqueue_pop.c adt/gqueue.h adt/common.h
	./compile adt/gqueue_pop.c

adt/gqueue_push.o: compile adt/gqueue_push.c adt/gqueue.h adt/common.h
	./compile adt/gqueue_push.c

adt/gqueue_top.o: compile adt/gqueue_top.c adt/gqueue.h adt/common.h
	./compile adt/gqueue_top.c

adt/gstack_pop.o: compile adt/gstack_pop.c adt/gstack.h adt/common.h
	./compile adt/gstack_pop.c

adt/gstack_push.o: compile adt/gstack_push.c adt/gstack.h adt/common.h
	./compile adt/gstack_push.c

adt/gstack_top.o: compile adt/gstack_top.c adt/gstack.h adt/common.h
	./compile adt/gstack_top.c

adt/lib.a: makelib adt/ghash_add.o adt/ghash_foreach.o adt/ghash_free.o adt/ghash_get.o adt/ghash_hash.o adt/ghash_init.o adt/ghash_insert.o adt/ghash_rehash.o adt/ghash_search.o adt/gqueue_pop.o adt/gqueue_push.o adt/gqueue_top.o adt/gstack_pop.o adt/gstack_push.o adt/gstack_top.o
	./makelib adt/lib.a adt/ghash_add.o adt/ghash_foreach.o adt/ghash_free.o adt/ghash_get.o adt/ghash_hash.o adt/ghash_init.o adt/ghash_insert.o adt/ghash_rehash.o adt/ghash_search.o adt/gqueue_pop.o adt/gqueue_push.o adt/gqueue_top.o adt/gstack_pop.o adt/gstack_push.o adt/gstack_top.o

all: sysdeps.h libraries selftests installer instcheck instshow

base64/asc2bin.o: compile base64/asc2bin.c base64/base64.h str/str.h
	./compile base64/asc2bin.c

base64/bin2asc.o: compile base64/bin2asc.c base64/base64.h str/str.h
	./compile base64/bin2asc.c

base64/decode_line.o: compile base64/decode_line.c base64/base64.h str/str.h
	./compile base64/decode_line.c

base64/decode_part.o: compile base64/decode_part.c base64/base64.h str/str.h
	./compile base64/decode_part.c

base64/encode_line.o: compile base64/encode_line.c base64/base64.h str/str.h
	./compile base64/encode_line.c

base64/encode_part.o: compile base64/encode_part.c base64/base64.h str/str.h
	./compile base64/encode_part.c

base64/lib.a: makelib base64/asc2bin.o base64/bin2asc.o base64/decode_line.o base64/decode_part.o base64/encode_line.o base64/encode_part.o
	./makelib base64/lib.a base64/asc2bin.o base64/bin2asc.o base64/decode_line.o base64/decode_part.o base64/encode_line.o base64/encode_part.o

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

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

cdb/get.o: compile cdb/get.c cdb/cdb.h sysdeps.h cdb/str.h cdb/cdb.h sysdeps.h str/str.h
	./compile cdb/get.c

cdb/getnext.o: compile cdb/getnext.c cdb/cdb.h sysdeps.h cdb/str.h cdb/cdb.h sysdeps.h str/str.h
	./compile cdb/getnext.c

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

cdb/lib.a: makelib cdb/cdb.o cdb/find.o cdb/getnext.o cdb/get.o cdb/hash.o cdb/hash.o cdb/make.o cdb/read.o
	./makelib cdb/lib.a cdb/cdb.o cdb/find.o cdb/getnext.o cdb/get.o cdb/hash.o cdb/hash.o cdb/make.o cdb/read.o

cdb/make.o: compile cdb/make.c cdb/cdb.h sysdeps.h cdb/make.h iobuf/iobuf.h sysdeps.h uint32.h sysdeps.h uintnn.h
	./compile cdb/make.c

cdb/read.o: compile cdb/read.c cdb/cdb.h sysdeps.h
	./compile cdb/read.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/lib.a: makelib cli/main.o
	./makelib cli/lib.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_home.c: conf-home
	head -1 conf-home | \
	  sed -e 's/"/\\"/g' \
	      -e 's/^/const char conf_home[] = "/' \
	      -e 's/$$/";/' >conf_home.c

crc-gentab: load crc-gentab.o msg/lib.a iobuf/lib.a libbg-sysdeps.a
	./load crc-gentab msg/lib.a iobuf/lib.a libbg-sysdeps.a 

crc-gentab.o: compile crc-gentab.c sysdeps.h iobuf/iobuf.h msg/msg.h
	./compile crc-gentab.c

crc/crc16_arc_table.c: crc-gentab
	./crc-gentab crc16_arc 16 0x8005 reflected >$@

crc/crc16_arc_table.o: compile crc/crc16_arc_table.c crc/crc16_arc.h uint16.h sysdeps.h uintnn.h
	./compile crc/crc16_arc_table.c

crc/crc16_arc_update.o: compile crc/crc16_arc_update.c crc/crc16_arc.h uint16.h sysdeps.h uintnn.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile crc/crc16_arc_update.c

crc/crc16_ccitt_table.c: crc-gentab
	./crc-gentab crc16_ccitt 16 0x1021 normal >$@

crc/crc16_ccitt_table.o: compile crc/crc16_ccitt_table.c crc/crc16_ccitt.h uint16.h sysdeps.h uintnn.h
	./compile crc/crc16_ccitt_table.c

crc/crc16_ccitt_update.o: compile crc/crc16_ccitt_update.c crc/crc16_ccitt.h uint16.h sysdeps.h uintnn.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile crc/crc16_ccitt_update.c

crc/crc16_xmodem_table.c: crc-gentab
	./crc-gentab crc16_xmodem 16 0x8408 reflected >$@

crc/crc16_xmodem_table.o: compile crc/crc16_xmodem_table.c crc/crc16_xmodem.h uint16.h sysdeps.h uintnn.h
	./compile crc/crc16_xmodem_table.c

crc/crc16_xmodem_update.o: compile crc/crc16_xmodem_update.c crc/crc16_xmodem.h uint16.h sysdeps.h uintnn.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile crc/crc16_xmodem_update.c

crc/crc32_table.c: crc-gentab
	./crc-gentab crc32 32 0x04C11DB7 reflected >$@

crc/crc32_table.o: compile crc/crc32_table.c crc/crc32.h uint32.h sysdeps.h uintnn.h
	./compile crc/crc32_table.c

crc/crc32_update.o: compile crc/crc32_update.c crc/crc32.h uint32.h sysdeps.h uintnn.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile crc/crc32_update.c

crc/crc64_table.c: crc-gentab
	./crc-gentab crc64 64 0x42F0E1EBA9EA3693 normal >$@

crc/crc64_table.o: compile crc/crc64_table.c crc/crc64.h uint64.h sysdeps.h uintnn.h
	./compile crc/crc64_table.c

crc/crc64_update.o: compile crc/crc64_update.c crc/crc64.h uint64.h sysdeps.h uintnn.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile crc/crc64_update.c

crc/lib.a: makelib crc/crc16_arc_table.o crc/crc16_arc_update.o crc/crc16_ccitt_table.o crc/crc16_ccitt_update.o crc/crc16_xmodem_table.o crc/crc16_xmodem_update.o crc/crc32_table.o crc/crc32_update.o crc/crc64_table.o crc/crc64_update.o
	./makelib crc/lib.a crc/crc16_arc_table.o crc/crc16_arc_update.o crc/crc16_ccitt_table.o crc/crc16_ccitt_update.o crc/crc16_xmodem_table.o crc/crc16_xmodem_update.o crc/crc32_table.o crc/crc32_update.o crc/crc64_table.o crc/crc64_update.o

crypto/lib.a: makelib crypto/md4.o crypto/md5-crypt.o crypto/md5.o crypto/sha1.o crypto/sha256.o crypto/sha384.o crypto/sha512.o
	./makelib crypto/lib.a crypto/md4.o crypto/md5-crypt.o crypto/md5.o crypto/sha1.o crypto/sha256.o crypto/sha384.o crypto/sha512.o

crypto/md4.o: compile crypto/md4.c sysdeps.h crypto/md4.h
	./compile crypto/md4.c

crypto/md5-crypt.o: compile crypto/md5-crypt.c crypto/md5.h
	./compile crypto/md5-crypt.c

crypto/md5.o: compile crypto/md5.c sysdeps.h crypto/md5.h
	./compile crypto/md5.c

crypto/sha1.o: compile crypto/sha1.c crypto/sha1.h sysdeps.h uint32.h sysdeps.h uintnn.h uint64.h sysdeps.h uintnn.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile crypto/sha1.c

crypto/sha256.o: compile crypto/sha256.c crypto/sha256.h sysdeps.h uint32.h sysdeps.h uintnn.h uint64.h sysdeps.h uintnn.h
	./compile crypto/sha256.c

crypto/sha384.o: compile crypto/sha384.c sysdeps.h crypto/sha384.h sysdeps.h crypto/sha512.h sysdeps.h uint64.h sysdeps.h uintnn.h
	./compile crypto/sha384.c

crypto/sha512.o: compile crypto/sha512.c sysdeps.h crypto/sha512.h sysdeps.h uint64.h sysdeps.h uintnn.h
	./compile crypto/sha512.c

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

dict/foreach.o: compile dict/foreach.c dict/dict.h str/str.h uint32.h sysdeps.h uintnn.h
	./compile dict/foreach.c

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

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

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

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

dict/lib.a: makelib dict/add.o dict/foreach.o dict/free.o dict/get.o dict/hash.o dict/init.o dict/load_list.o dict/load_map.o dict/str_free.o
	./makelib dict/lib.a dict/add.o dict/foreach.o dict/free.o dict/get.o dict/hash.o dict/init.o dict/load_list.o dict/load_map.o dict/str_free.o

dict/load_list.o: compile dict/load_list.c iobuf/iobuf.h str/str.h dict/dict.h str/str.h uint32.h sysdeps.h uintnn.h dict/load.h dict/dict.h str/str.h uint32.h sysdeps.h uintnn.h
	./compile dict/load_list.c

dict/load_map.o: compile dict/load_map.c iobuf/iobuf.h str/str.h dict/dict.h str/str.h uint32.h sysdeps.h uintnn.h dict/load.h dict/dict.h str/str.h uint32.h sysdeps.h uintnn.h
	./compile dict/load_map.c

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

dns/config.o: compile dns/config.c iobuf/iobuf.h net/ipv4.h sysdeps.h str/str.h dns/dns.h sysdeps.h str/str.h net/ipv4.h sysdeps.h uint16.h sysdeps.h uintnn.h
	./compile dns/config.c

dns/header.o: compile dns/header.c dns/dns.h sysdeps.h str/str.h net/ipv4.h sysdeps.h uint16.h sysdeps.h uintnn.h uint16.h sysdeps.h uintnn.h
	./compile dns/header.c

dns/ip.o: compile dns/ip.c misc/misc.h sysdeps.h dns/dns.h sysdeps.h str/str.h net/ipv4.h sysdeps.h uint16.h sysdeps.h uintnn.h
	./compile dns/ip.c

dns/lib.a: makelib dns/config.o dns/header.o dns/ip.o dns/mx.o dns/name.o dns/name4.o dns/packet.o dns/query.o dns/transmit.o
	./makelib dns/lib.a dns/config.o dns/header.o dns/ip.o dns/mx.o dns/name.o dns/name4.o dns/packet.o dns/query.o dns/transmit.o

dns/mx.o: compile dns/mx.c dns/dns.h sysdeps.h str/str.h net/ipv4.h sysdeps.h uint16.h sysdeps.h uintnn.h
	./compile dns/mx.c

dns/name.o: compile dns/name.c dns/dns.h sysdeps.h str/str.h net/ipv4.h sysdeps.h uint16.h sysdeps.h uintnn.h
	./compile dns/name.c

dns/name4.o: compile dns/name4.c dns/dns.h sysdeps.h str/str.h net/ipv4.h sysdeps.h uint16.h sysdeps.h uintnn.h
	./compile dns/name4.c

dns/packet.o: compile dns/packet.c dns/dns.h sysdeps.h str/str.h net/ipv4.h sysdeps.h uint16.h sysdeps.h uintnn.h
	./compile dns/packet.c

dns/query.o: compile dns/query.c dns/dns.h sysdeps.h str/str.h net/ipv4.h sysdeps.h uint16.h sysdeps.h uintnn.h
	./compile dns/query.c

dns/transmit.o: compile dns/transmit.c sysdeps.h misc/misc.h sysdeps.h net/socket.h net/ipv4.h sysdeps.h dns/dns.h sysdeps.h str/str.h net/ipv4.h sysdeps.h uint16.h sysdeps.h uintnn.h
	./compile dns/transmit.c

install/installer.a: makelib install/installer.o
	./makelib install/installer.a install/installer.o

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

install/instcheck.a: makelib install/instcheck.o
	./makelib install/instcheck.a install/instcheck.o

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

install/instshow.a: makelib install/instshow.o
	./makelib install/instshow.a install/instshow.o

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

installer: load insthier.o install/installer.a libbg-sysdeps.a
	./load insthier install/installer.a libbg-sysdeps.a
	mv insthier installer

instcheck: load insthier.o install/instcheck.a libbg-sysdeps.a
	./load insthier install/instcheck.a libbg-sysdeps.a
	mv insthier instcheck

insthier.o: compile insthier.c conf_home.c install/installer.h
	./compile insthier.c

instshow: load insthier.o install/instshow.a libbg-sysdeps.a
	./load insthier install/instshow.a libbg-sysdeps.a
	mv insthier instshow

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_getstr.o: compile iobuf/ibuf_getstr.c iobuf/iobuf.h str/str.h
	./compile iobuf/ibuf_getstr.c

iobuf/ibuf_getstr_crlf.o: compile iobuf/ibuf_getstr_crlf.c iobuf/iobuf.h str/str.h
	./compile iobuf/ibuf_getstr_crlf.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_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 selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/iobuf_init.c

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

iobuf/lib.a: makelib iobuf/ibuf_getc.o iobuf/ibuf_gets.o iobuf/ibuf_getstr_crlf.o iobuf/ibuf_getstr.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/iobuf_close.o iobuf/iobuf_copy.o iobuf/iobuf_init.o iobuf/iobuf_timeout.o iobuf/obuf_close.o iobuf/obuf_digits.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_putnetstring.o iobuf/obuf_putsflush.o iobuf/obuf_putsllnumw.o iobuf/obuf_putsnumw.o iobuf/obuf_putullnumw.o iobuf/obuf_putunumw.o iobuf/obuf_seek.o iobuf/obuf_sign_pad.o iobuf/obuf_stderr.o iobuf/obuf_stdout.o iobuf/obuf_sync.o iobuf/obuf_write.o
	./makelib iobuf/lib.a iobuf/ibuf_getc.o iobuf/ibuf_gets.o iobuf/ibuf_getstr_crlf.o iobuf/ibuf_getstr.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/iobuf_close.o iobuf/iobuf_copy.o iobuf/iobuf_init.o iobuf/iobuf_timeout.o iobuf/obuf_close.o iobuf/obuf_digits.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_putnetstring.o iobuf/obuf_putsflush.o iobuf/obuf_putsllnumw.o iobuf/obuf_putsnumw.o iobuf/obuf_putullnumw.o iobuf/obuf_putunumw.o iobuf/obuf_seek.o iobuf/obuf_sign_pad.o iobuf/obuf_stderr.o iobuf/obuf_stdout.o iobuf/obuf_sync.o iobuf/obuf_write.o

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

iobuf/obuf_digits.o: compile iobuf/obuf_digits.c iobuf/iobuf.h
	./compile iobuf/obuf_digits.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 selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_put2s.c

iobuf/obuf_put3s.o: compile iobuf/obuf_put3s.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_put3s.c

iobuf/obuf_put4s.o: compile iobuf/obuf_put4s.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_put4s.c

iobuf/obuf_put5s.o: compile iobuf/obuf_put5s.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_put5s.c

iobuf/obuf_put6s.o: compile iobuf/obuf_put6s.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_put6s.c

iobuf/obuf_put7s.o: compile iobuf/obuf_put7s.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.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_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_putsllnumw.o: compile iobuf/obuf_putsllnumw.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_putsllnumw.c

iobuf/obuf_putsnumw.o: compile iobuf/obuf_putsnumw.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_putsnumw.c

iobuf/obuf_putullnumw.o: compile iobuf/obuf_putullnumw.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_putullnumw.c

iobuf/obuf_putunumw.o: compile iobuf/obuf_putunumw.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_putunumw.c

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

iobuf/obuf_sign_pad.o: compile iobuf/obuf_sign_pad.c iobuf/iobuf.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_sign_pad.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 selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile iobuf/obuf_write.c

libbg-sysdeps.a: makelib sys/getpeereid.o sys/iopoll.o sys/setenv.o uint16/get.o uint16/pack.o uint16/unpack.o uint32/get_lsb.o uint32/get_msb.o uint32/pack_lsb.o uint32/pack_msb.o uint32/unpack_lsb.o uint32/unpack_msb.o uint64/get_lsb.o uint64/get_msb.o uint64/pack_lsb.o uint64/pack_msb.o uint64/unpack_lsb.o uint64/unpack_msb.o sys/unsetenv.o
	./makelib libbg-sysdeps.a sys/getpeereid.o sys/iopoll.o sys/setenv.o uint16/get.o uint16/pack.o uint16/unpack.o uint32/get_lsb.o uint32/get_msb.o uint32/pack_lsb.o uint32/pack_msb.o uint32/unpack_lsb.o uint32/unpack_msb.o uint64/get_lsb.o uint64/get_msb.o uint64/pack_lsb.o uint64/pack_msb.o uint64/unpack_lsb.o uint64/unpack_msb.o sys/unsetenv.o

libraries: str/lib.a adt/lib.a crc/lib.a vmailmgr/lib.a misc/lib.a unix/lib.a dict/lib.a iobuf/lib.a crypto/lib.a base64/lib.a msg/lib.a net/lib.a cdb/lib.a path/lib.a cli/lib.a pwcmp/client.a pwcmp/module.a pwcmp/hex.a install/installer.a install/instcheck.a install/instshow.a dns/lib.a libbg-sysdeps.a

load: conf-ld
	(  \
	  echo '#!/bin/sh';\
	  echo 'main="$$1"; shift';\
	  echo exec `head -1 conf-ld` -L.  '-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

misc/lib.a: makelib misc/random.o misc/strtou.o misc/utoa2.o misc/utoa.o
	./makelib misc/lib.a misc/random.o misc/strtou.o misc/utoa2.o misc/utoa.o

misc/random.o: compile misc/random.c systime.h misc/misc.h sysdeps.h
	./compile misc/random.c

misc/strtou.o: compile misc/strtou.c misc/misc.h sysdeps.h
	./compile misc/strtou.c

misc/utoa.o: compile misc/utoa.c misc/misc.h sysdeps.h
	./compile misc/utoa.c

misc/utoa2.o: compile misc/utoa2.c misc/misc.h sysdeps.h
	./compile misc/utoa2.c

msg/common.o: compile msg/common.c iobuf/iobuf.h msg/msg.h selftest.c iobuf/iobuf.h msg/msg.h str/str.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/lib.a: makelib msg/common.o msg/debug.o msg/die.o msg/error.o msg/wrap_chdir.o msg/wrap_exit.o msg/wrap_str.o msg/warn.o msg/oom.o
	./makelib msg/lib.a msg/common.o msg/debug.o msg/die.o msg/error.o msg/wrap_chdir.o msg/wrap_exit.o msg/wrap_str.o msg/warn.o msg/oom.o

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

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

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

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

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

net/accept4.o: compile net/accept4.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/accept4.c

net/acceptu.o: compile net/acceptu.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/acceptu.c

net/bind4.o: compile net/bind4.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/bind4.c

net/bindu.o: compile net/bindu.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/bindu.c

net/broadcast.o: compile net/broadcast.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/broadcast.c

net/connect4.o: compile net/connect4.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/connect4.c

net/connected.o: compile net/connected.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/connected.c

net/connectu.o: compile net/connectu.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/connectu.c

net/cork.o: compile net/cork.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/cork.c

net/getaddr4.o: compile net/getaddr4.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/getaddr4.c

net/ipv4_addr.o: compile net/ipv4_addr.c net/ipv4.h sysdeps.h
	./compile net/ipv4_addr.c

net/ipv4_format.o: compile net/ipv4_format.c net/ipv4.h sysdeps.h
	./compile net/ipv4_format.c

net/ipv4_scan.o: compile net/ipv4_scan.c net/ipv4.h sysdeps.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile net/ipv4_scan.c

net/lib.a: makelib net/accept4.o net/acceptu.o net/bind4.o net/bindu.o net/broadcast.o net/connect4.o net/connected.o net/connectu.o net/cork.o net/getaddr4.o net/ipv4_addr.o net/ipv4_format.o net/ipv4_scan.o net/linger.o net/listen.o net/pairdgm.o net/pairstr.o net/recv4.o net/recvfd.o net/recvu.o net/resolve_error.o net/resolve_ipv4addr.o net/resolve_ipv4name.o net/reuse.o net/send4.o net/sendfd.o net/sendu.o net/shutdown.o net/tcp.o net/udp.o net/uncork.o net/unixdgm.o net/unixstr.o
	./makelib net/lib.a net/accept4.o net/acceptu.o net/bind4.o net/bindu.o net/broadcast.o net/connect4.o net/connected.o net/connectu.o net/cork.o net/getaddr4.o net/ipv4_addr.o net/ipv4_format.o net/ipv4_scan.o net/linger.o net/listen.o net/pairdgm.o net/pairstr.o net/recv4.o net/recvfd.o net/recvu.o net/resolve_error.o net/resolve_ipv4addr.o net/resolve_ipv4name.o net/reuse.o net/send4.o net/sendfd.o net/sendu.o net/shutdown.o net/tcp.o net/udp.o net/uncork.o net/unixdgm.o net/unixstr.o

net/linger.o: compile net/linger.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/linger.c

net/listen.o: compile net/listen.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/listen.c

net/pairdgm.o: compile net/pairdgm.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/pairdgm.c

net/pairstr.o: compile net/pairstr.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/pairstr.c

net/recv4.o: compile net/recv4.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/recv4.c

net/recvfd.o: compile net/recvfd.c net/cmsg.h net/socket.h net/ipv4.h sysdeps.h
	./compile net/recvfd.c

net/recvu.o: compile net/recvu.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/recvu.c

net/resolve_error.o: compile net/resolve_error.c net/resolve.h net/ipv4.h sysdeps.h
	./compile net/resolve_error.c

net/resolve_ipv4addr.o: compile net/resolve_ipv4addr.c net/resolve.h net/ipv4.h sysdeps.h
	./compile net/resolve_ipv4addr.c

net/resolve_ipv4name.o: compile net/resolve_ipv4name.c net/resolve.h net/ipv4.h sysdeps.h
	./compile net/resolve_ipv4name.c

net/reuse.o: compile net/reuse.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/reuse.c

net/send4.o: compile net/send4.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/send4.c

net/sendfd.o: compile net/sendfd.c net/cmsg.h net/socket.h net/ipv4.h sysdeps.h
	./compile net/sendfd.c

net/sendu.o: compile net/sendu.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/sendu.c

net/shutdown.o: compile net/shutdown.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/shutdown.c

net/tcp.o: compile net/tcp.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/tcp.c

net/udp.o: compile net/udp.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/udp.c

net/uncork.o: compile net/uncork.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/uncork.c

net/unixdgm.o: compile net/unixdgm.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/unixdgm.c

net/unixstr.o: compile net/unixstr.c net/socket.h net/ipv4.h sysdeps.h
	./compile net/unixstr.c

path/contains.o: compile path/contains.c path/path.h str/str.h
	./compile path/contains.c

path/fnmatch.o: compile path/fnmatch.c path/path.h str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile path/fnmatch.c

path/lib.a: makelib path/contains.o path/fnmatch.o path/match.o path/merge.o path/mktemp.o
	./makelib path/lib.a path/contains.o path/fnmatch.o path/match.o path/merge.o path/mktemp.o

path/match.o: compile path/match.c sysdeps.h str/str.h str/iter.h str/str.h path/path.h str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile path/match.c

path/merge.o: compile path/merge.c path/path.h str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h path/path.h str/str.h
	./compile path/merge.c

path/mktemp.o: compile path/mktemp.c systime.h path/path.h str/str.h
	./compile path/mktemp.c

pwcmp/client.a: makelib pwcmp/client.o pwcmp/hex_encode.o
	./makelib pwcmp/client.a pwcmp/client.o pwcmp/hex_encode.o

pwcmp/client.o: compile pwcmp/client.c sysdeps.h pwcmp/client.h
	./compile pwcmp/client.c

pwcmp/hex.a: makelib pwcmp/hex_encode.o
	./makelib pwcmp/hex.a pwcmp/hex_encode.o

pwcmp/hex_encode.o: compile pwcmp/hex_encode.c pwcmp/hex.h
	./compile pwcmp/hex_encode.c

pwcmp/module.a: makelib pwcmp/module.o
	./makelib pwcmp/module.a pwcmp/module.o

pwcmp/module.o: compile pwcmp/module.c pwcmp/module.h
	./compile pwcmp/module.c

selftests: selftests.sh
	sh selftests.sh

str/alloc.o: compile str/alloc.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/alloc.c

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

str/case_glob.o: compile str/case_glob.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/case_glob.c

str/case_match.o: compile str/case_match.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/case_match.c

str/case_start.o: compile str/case_start.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/case_start.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 selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/cat2s.c

str/cat3s.o: compile str/cat3s.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/cat3s.c

str/cat4s.o: compile str/cat4s.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/cat4s.c

str/cat5s.o: compile str/cat5s.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/cat5s.c

str/cat6s.o: compile str/cat6s.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/cat6s.c

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

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

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

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

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

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

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

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

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

str/catxwll.o: compile str/catxwll.c str/str.h
	./compile str/catxwll.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 selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/copy.c

str/copy2s.o: compile str/copy2s.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/copy2s.c

str/copy3s.o: compile str/copy3s.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/copy3s.c

str/copy4s.o: compile str/copy4s.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/copy4s.c

str/copy5s.o: compile str/copy5s.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/copy5s.c

str/copy6s.o: compile str/copy6s.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h 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/digits.o: compile str/digits.c str/str.h
	./compile str/digits.c

str/findnext.o: compile str/findnext.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/findnext.c

str/findnextof.o: compile str/findnextof.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/findnextof.c

str/findprev.o: compile str/findprev.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/findprev.c

str/findprevof.o: compile str/findprevof.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/findprevof.c

str/free.o: compile str/free.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/free.c

str/glob.o: compile str/glob.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/glob.c

str/init.o: compile str/init.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/init.c

str/iter_advance.o: compile str/iter_advance.c str/iter.h str/str.h
	./compile str/iter_advance.c

str/iter_start.o: compile str/iter_start.c str/iter.h str/str.h
	./compile str/iter_start.c

str/iter_valid.o: compile str/iter_valid.c str/iter.h str/str.h
	./compile str/iter_valid.c

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

str/lib.a: makelib str/alloc.o str/buildmap.o str/case_glob.o str/case_match.o str/case_start.o str/cat2s.o str/cat3s.o str/cat4s.o str/cat5s.o str/cat6s.o str/catiwll.o str/catiw.o str/cat.o str/catsllnum.o str/catsnum.o str/catullnum.o str/catunum.o str/catuwll.o str/catuw.o str/catxw.o str/catxwll.o str/cmp.o str/copy2s.o str/copy3s.o str/copy4s.o str/copy5s.o str/copy6s.o str/copy.o str/count.o str/countof.o str/cut.o str/diff.o str/digits.o str/findnext.o str/findnextof.o str/findprev.o str/findprevof.o str/free.o str/glob.o str/init.o str/iter_advance.o str/iter_start.o str/iter_valid.o str/join.o str/lower.o str/lstrip.o str/match.o str/rstrip.o str/sort.o str/start.o str/subst.o str/truncate.o str/upper.o
	./makelib str/lib.a str/alloc.o str/buildmap.o str/case_glob.o str/case_match.o str/case_start.o str/cat2s.o str/cat3s.o str/cat4s.o str/cat5s.o str/cat6s.o str/catiwll.o str/catiw.o str/cat.o str/catsllnum.o str/catsnum.o str/catullnum.o str/catunum.o str/catuwll.o str/catuw.o str/catxw.o str/catxwll.o str/cmp.o str/copy2s.o str/copy3s.o str/copy4s.o str/copy5s.o str/copy6s.o str/copy.o str/count.o str/countof.o str/cut.o str/diff.o str/digits.o str/findnext.o str/findnextof.o str/findprev.o str/findprevof.o str/free.o str/glob.o str/init.o str/iter_advance.o str/iter_start.o str/iter_valid.o str/join.o str/lower.o str/lstrip.o str/match.o str/rstrip.o str/sort.o str/start.o str/subst.o str/truncate.o str/upper.o

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/match.o: compile str/match.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/match.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/start.o: compile str/start.c str/str.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile str/start.c

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

sys/getpeereid.o: compile sys/getpeereid.c sysdeps.h
	./compile sys/getpeereid.c

sys/iopoll.o: compile sys/iopoll.c sysdeps.h
	./compile sys/iopoll.c

sys/setenv.o: compile sys/setenv.c sysdeps.h
	./compile sys/setenv.c

sys/unsetenv.o: compile sys/unsetenv.c sysdeps.h
	./compile sys/unsetenv.c

sysdeps.h: choose compile load sysdeps-head.h sysdeps-tail.h sys/tryflock.c sys/hasflock.h1 sys/hasflock.h2 sys/trypeercred.c sys/haspeercred.h1 sys/haspeercred.h2 sys/trysendfile.c sys/hassendfile.h1 sys/hassendfile.h2 sys/trysgact.c sys/hassgact.h1 sys/hassgact.h2 sys/trysgprm.c sys/hassgprm.h1 sys/hassgprm.h2 sys/tryspnam.c sys/hasspnam.h1 sys/hasspnam.h2 sys/tryuserpw.c sys/hasuserpw.h1 sys/hasuserpw.h2 sys/trywaitp.c sys/haswaitp.h1 sys/haswaitp.h2 sys/tryzlib.c sys/haszlib.h1 sys/haszlib.h2 sys/tryulong32.c sys/uint32.h1 sys/uint32.h2 sys/tryulong64.c sys/uint64.h1 sys/uint64.h2 sys/tryendian.c sys/endian.h1 sys/endian.h2 sys/trydirent.c sys/direntry.h1 sys/direntry.h2 sys/trygetpeereid.c sys/hasgetpeereid.h1 sys/hasgetpeereid.h2 sys/tryvfork.c sys/fork.h1 sys/fork.h2 sys/trypoll.c sys/iopoll.h1 sys/iopoll.h2 sys/trysysel.c sys/select.h1 sys/select.h2 sys/trysetenv.c sys/setenv.h1 sys/setenv.h2 sys/tryunsetenv.c sys/unsetenv.h1 sys/unsetenv.h2 sys/tryunaligned.c sys/unaligned.h1 sys/unaligned.h2
	( set -e; \
	  cat sysdeps-head.h; \
	  ./choose clr sys/tryulong32    sys/uint32.h1        sys/uint32.h2; \
	  ./choose clr sys/tryulong64    sys/uint64.h1        sys/uint64.h2; \
	  ./choose clr sys/tryendian     sys/endian.h1        sys/endian.h2; \
	  ./choose c   sys/trydirent     sys/direntry.h1      sys/direntry.h2; \
	  ./choose cl  sys/tryvfork      sys/fork.h1          sys/fork.h2; \
	  ./choose cl  sys/trygetpeereid sys/hasgetpeereid.h1 sys/hasgetpeereid.h2; \
	  ./choose cl  sys/tryflock      sys/hasflock.h1      sys/hasflock.h2; \
	  ./choose cl  sys/trypeercred   sys/haspeercred.h1   sys/haspeercred.h2; \
	  ./choose cl  sys/trysendfile   sys/hassendfile.h1   sys/hassendfile.h2; \
	  ./choose cl  sys/trysgact      sys/hassgact.h1      sys/hassgact.h2; \
	  ./choose cl  sys/trysgprm      sys/hassgprm.h1      sys/hassgprm.h2; \
	  ./choose cl  sys/tryspnam      sys/hasspnam.h1      sys/hasspnam.h2; \
	  ./choose cl  sys/tryuserpw     sys/hasuserpw.h1     sys/hasuserpw.h2; \
	  ./choose cl  sys/trywaitp      sys/haswaitp.h1      sys/haswaitp.h2; \
	  ./choose c   sys/tryzlib       sys/haszlib.h1       sys/haszlib.h2; \
	  ./choose clr sys/trypoll       sys/iopoll.h1        sys/iopoll.h2; \
	  ./choose c   sys/trysysel      sys/select.h1        sys/select.h2; \
	  ./choose cl  sys/trysetenv     sys/setenv.h1        sys/setenv.h2; \
	  ./choose cl  sys/tryunsetenv   sys/unsetenv.h1      sys/unsetenv.h2; \
	  ./choose clr sys/tryunaligned  sys/unaligned.h1     sys/unaligned.h2; \
	  cat sysdeps-tail.h; \
	) >sysdeps.h

uint16/get.o: compile uint16/get.c uint16.h sysdeps.h uintnn.h
	./compile uint16/get.c

uint16/pack.o: compile uint16/pack.c uint16.h sysdeps.h uintnn.h
	./compile uint16/pack.c

uint16/unpack.o: compile uint16/unpack.c uint16.h sysdeps.h uintnn.h
	./compile uint16/unpack.c

uint32/get_lsb.o: compile uint32/get_lsb.c uint32.h sysdeps.h uintnn.h
	./compile uint32/get_lsb.c

uint32/get_msb.o: compile uint32/get_msb.c uint32.h sysdeps.h uintnn.h
	./compile uint32/get_msb.c

uint32/pack_lsb.o: compile uint32/pack_lsb.c uint32.h sysdeps.h uintnn.h
	./compile uint32/pack_lsb.c

uint32/pack_msb.o: compile uint32/pack_msb.c uint32.h sysdeps.h uintnn.h
	./compile uint32/pack_msb.c

uint32/unpack_lsb.o: compile uint32/unpack_lsb.c uint32.h sysdeps.h uintnn.h
	./compile uint32/unpack_lsb.c

uint32/unpack_msb.o: compile uint32/unpack_msb.c uint32.h sysdeps.h uintnn.h
	./compile uint32/unpack_msb.c

uint64/get_lsb.o: compile uint64/get_lsb.c uint64.h sysdeps.h uintnn.h uint32.h sysdeps.h uintnn.h
	./compile uint64/get_lsb.c

uint64/get_msb.o: compile uint64/get_msb.c uint64.h sysdeps.h uintnn.h uint32.h sysdeps.h uintnn.h
	./compile uint64/get_msb.c

uint64/pack_lsb.o: compile uint64/pack_lsb.c uint64.h sysdeps.h uintnn.h uint32.h sysdeps.h uintnn.h
	./compile uint64/pack_lsb.c

uint64/pack_msb.o: compile uint64/pack_msb.c uint64.h sysdeps.h uintnn.h uint32.h sysdeps.h uintnn.h
	./compile uint64/pack_msb.c

uint64/unpack_lsb.o: compile uint64/unpack_lsb.c uint64.h sysdeps.h uintnn.h uint32.h sysdeps.h uintnn.h
	./compile uint64/unpack_lsb.c

uint64/unpack_msb.o: compile uint64/unpack_msb.c uint64.h sysdeps.h uintnn.h uint32.h sysdeps.h uintnn.h
	./compile uint64/unpack_msb.c

unix/lib.a: makelib unix/nonblock_off.o unix/nonblock_on.o unix/selfpipe.o unix/sig_alarm.o unix/sig_all.o unix/sig_block.o unix/sig_bug.o unix/sig_catch.o unix/sig_child.o unix/sig_hup.o unix/sig_int.o unix/sig_misc.o unix/sig_pipe.o unix/sig_quit.o unix/sig_suspend.o unix/sig_term.o
	./makelib unix/lib.a unix/nonblock_off.o unix/nonblock_on.o unix/selfpipe.o unix/sig_alarm.o unix/sig_all.o unix/sig_block.o unix/sig_bug.o unix/sig_catch.o unix/sig_child.o unix/sig_hup.o unix/sig_int.o unix/sig_misc.o unix/sig_pipe.o unix/sig_quit.o unix/sig_suspend.o unix/sig_term.o

unix/nonblock_off.o: compile unix/nonblock_off.c unix/nonblock.h
	./compile unix/nonblock_off.c

unix/nonblock_on.o: compile unix/nonblock_on.c unix/nonblock.h
	./compile unix/nonblock_on.c

unix/selfpipe.o: compile unix/selfpipe.c sysdeps.h unix/nonblock.h unix/sig.h selftest.c iobuf/iobuf.h msg/msg.h str/str.h
	./compile unix/selfpipe.c

unix/sig_alarm.o: compile unix/sig_alarm.c unix/sig.h
	./compile unix/sig_alarm.c

unix/sig_all.o: compile unix/sig_all.c unix/sig.h sysdeps.h
	./compile unix/sig_all.c

unix/sig_block.o: compile unix/sig_block.c unix/sig.h sysdeps.h
	./compile unix/sig_block.c

unix/sig_bug.o: compile unix/sig_bug.c unix/sig.h
	./compile unix/sig_bug.c

unix/sig_catch.o: compile unix/sig_catch.c unix/sig.h sysdeps.h
	./compile unix/sig_catch.c

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

unix/sig_hup.o: compile unix/sig_hup.c unix/sig.h
	./compile unix/sig_hup.c

unix/sig_int.o: compile unix/sig_int.c unix/sig.h
	./compile unix/sig_int.c

unix/sig_misc.o: compile unix/sig_misc.c unix/sig.h
	./compile unix/sig_misc.c

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

unix/sig_quit.o: compile unix/sig_quit.c unix/sig.h
	./compile unix/sig_quit.c

unix/sig_suspend.o: compile unix/sig_suspend.c unix/sig.h sysdeps.h
	./compile unix/sig_suspend.c

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

vmailmgr/lib.a: makelib vmailmgr/req_arg.o vmailmgr/req_init.o vmailmgr/req_write.o vmailmgr/resp_read.o vmailmgr/vpwentry_export.o vmailmgr/vpwentry_free.o vmailmgr/vpwentry_import.o
	./makelib vmailmgr/lib.a vmailmgr/req_arg.o vmailmgr/req_init.o vmailmgr/req_write.o vmailmgr/resp_read.o vmailmgr/vpwentry_export.o vmailmgr/vpwentry_free.o vmailmgr/vpwentry_import.o

vmailmgr/req_arg.o: compile vmailmgr/req_arg.c vmailmgr/client.h str/str.h
	./compile vmailmgr/req_arg.c

vmailmgr/req_init.o: compile vmailmgr/req_init.c vmailmgr/client.h str/str.h
	./compile vmailmgr/req_init.c

vmailmgr/req_write.o: compile vmailmgr/req_write.c vmailmgr/client.h str/str.h
	./compile vmailmgr/req_write.c

vmailmgr/resp_read.o: compile vmailmgr/resp_read.c vmailmgr/client.h str/str.h
	./compile vmailmgr/resp_read.c

vmailmgr/vpwentry_export.o: compile vmailmgr/vpwentry_export.c vmailmgr/vpwentry.h str/str.h str/str.h
	./compile vmailmgr/vpwentry_export.c

vmailmgr/vpwentry_free.o: compile vmailmgr/vpwentry_free.c vmailmgr/vpwentry.h str/str.h
	./compile vmailmgr/vpwentry_free.c

vmailmgr/vpwentry_import.o: compile vmailmgr/vpwentry_import.c systime.h misc/misc.h sysdeps.h vmailmgr/vpwentry.h str/str.h
	./compile vmailmgr/vpwentry_import.c

