SHELL	= /bin/sh

# For now, just hard-coded rules.

CONFIG	= ../conf/access ../conf/aliases ../conf/canonical ../conf/relocated \
	../conf/transport ../conf/virtual ../conf/header_checks \
	../conf/generic

HTML	= ../html/ADDRESS_CLASS_README.html \
	../html/ADDRESS_REWRITING_README.html \
	../html/ADDRESS_VERIFICATION_README.html \
	../html/BACKSCATTER_README.html \
	../html/BASIC_CONFIGURATION_README.html \
	../html/BDAT_README.html \
	../html/BUILTIN_FILTER_README.html \
	../html/CDB_README.html \
	../html/COMPATIBILITY_README.html \
	../html/CONNECTION_CACHE_README.html \
	../html/CONTENT_INSPECTION_README.html \
	../html/DATABASE_README.html ../html/DB_README.html \
	../html/DEBUG_README.html \
	../html/DSN_README.html \
	../html/ETRN_README.html ../html/FILTER_README.html \
	../html/FORWARD_SECRECY_README.html \
	../html/INSTALL.html ../html/IPV6_README.html \
	../html/LDAP_README.html \
	../html/LINUX_README.html \
	../html/LOCAL_RECIPIENT_README.html ../html/MAILDROP_README.html \
	../html/MAILLOG_README.html \
	../html/LMDB_README.html \
	../html/MEMCACHE_README.html \
	../html/MILTER_README.html \
	../html/MULTI_INSTANCE_README.html \
	../html/MYSQL_README.html ../html/NFS_README.html \
	../html/OVERVIEW.html \
	../html/PACKAGE_README.html ../html/PCRE_README.html \
	../html/PGSQL_README.html \
	../html/POSTSCREEN_3_5_README.html \
	../html/POSTSCREEN_README.html \
	../html/QSHAPE_README.html \
	../html/RESTRICTION_CLASS_README.html ../html/SASL_README.html \
	../html/SCHEDULER_README.html ../html/SMTPD_ACCESS_README.html \
	../html/SMTPD_POLICY_README.html \
	../html/SMTPD_PROXY_README.html \
	../html/SMTPUTF8_README.html \
	../html/SOHO_README.html \
	../html/SQLITE_README.html \
	../html/STANDARD_CONFIGURATION_README.html \
	../html/STRESS_README.html \
	../html/TLS_README.html ../html/TLS_LEGACY_README.html \
	../html/TUNING_README.html \
	../html/UUCP_README.html \
	../html/VERP_README.html ../html/VIRTUAL_README.html \
	../html/XCLIENT_README.html ../html/XFORWARD_README.html \
	../html/postconf.5.html

README	= ../README_FILES/ADDRESS_CLASS_README \
	../README_FILES/ADDRESS_REWRITING_README \
	../README_FILES/ADDRESS_VERIFICATION_README \
	../README_FILES/BACKSCATTER_README \
	../README_FILES/BASIC_CONFIGURATION_README \
	../README_FILES/BDAT_README \
	../README_FILES/BUILTIN_FILTER_README \
	../README_FILES/CDB_README \
	../README_FILES/COMPATIBILITY_README \
	../README_FILES/CONNECTION_CACHE_README \
	../README_FILES/CONTENT_INSPECTION_README \
	../README_FILES/DATABASE_README ../README_FILES/DB_README \
	../README_FILES/DEBUG_README \
	../README_FILES/DSN_README \
	../README_FILES/ETRN_README ../README_FILES/FILTER_README \
	../README_FILES/FORWARD_SECRECY_README \
	../README_FILES/INSTALL ../README_FILES/IPV6_README \
	../README_FILES/LDAP_README \
	../README_FILES/LINUX_README \
	../README_FILES/LOCAL_RECIPIENT_README ../README_FILES/MAILDROP_README \
	../README_FILES/MAILLOG_README \
	../README_FILES/LMDB_README \
	../README_FILES/MEMCACHE_README \
	../README_FILES/MILTER_README \
	../README_FILES/MULTI_INSTANCE_README \
	../README_FILES/MYSQL_README ../README_FILES/NFS_README \
	../README_FILES/OVERVIEW \
	../README_FILES/PACKAGE_README ../README_FILES/PCRE_README \
	../README_FILES/PGSQL_README \
	../README_FILES/POSTSCREEN_3_5_README \
	../README_FILES/POSTSCREEN_README \
	../README_FILES/QSHAPE_README \
	../README_FILES/RESTRICTION_CLASS_README \
	../README_FILES/SASL_README ../README_FILES/SCHEDULER_README \
	../README_FILES/SMTPD_ACCESS_README \
	../README_FILES/SMTPD_POLICY_README ../README_FILES/SMTPD_PROXY_README \
	../README_FILES/SMTPUTF8_README \
	../README_FILES/SOHO_README \
	../README_FILES/SQLITE_README \
	../README_FILES/STANDARD_CONFIGURATION_README \
	../README_FILES/STRESS_README \
	../README_FILES/TLS_README ../README_FILES/TLS_LEGACY_README \
	../README_FILES/TUNING_README \
	../README_FILES/UUCP_README \
	../README_FILES/VERP_README ../README_FILES/VIRTUAL_README \
	../README_FILES/XCLIENT_README ../README_FILES/XFORWARD_README \
	../README_FILES/AAAREADME

MAN	= ../man/man5/postconf.5

TOP	= ../INSTALL

AWK	= awk '{ print; if (NR == 1) print ".pl 9999\n.ll 65" }'
SRCTOMAN= ../mantools/srctoman
POSTLINK= ../mantools/postlink
DETAB	= pr -tre
NROFF	= LANG=C GROFF_NO_SGR=1 nroff
HT2READ	= ../mantools/html2readme
MAKEAAA	= ../mantools/makereadme
MAKESOHO= ../mantools/make_soho_readme
DEPSOHO	= SASL_README.html STANDARD_CONFIGURATION_README.html

update:	$(CONFIG) $(HTML) $(README) $(MAN) $(TOP)

clean:
	:

tidy:	clean

clobber:
	rm -f $(CONFIG) $(README) $(HTML)

#$(README): $(HT2READ)
#$(HTML): $(POSTLINK)

../conf/access: access
	$(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@

../conf/aliases: aliases0 aliases
	(cat aliases0; $(SRCTOMAN) - aliases | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /') >$@

../conf/canonical: canonical
	$(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@

../conf/generic: generic
	$(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@

../conf/header_checks: header_checks
	$(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@

../conf/relocated: relocated
	$(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@

../conf/transport: transport
	$(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@

../conf/virtual: virtual
	$(SRCTOMAN) - $? | $(AWK) | $(NROFF) -man | col -bx | uniq | sed 's/^/# /' >$@

../html/ADDRESS_CLASS_README.html: ADDRESS_CLASS_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/ADDRESS_REWRITING_README.html: ADDRESS_REWRITING_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/ADDRESS_VERIFICATION_README.html: ADDRESS_VERIFICATION_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/BACKSCATTER_README.html: BACKSCATTER_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/CDB_README.html: CDB_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/COMPATIBILITY_README.html: COMPATIBILITY_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/CONNECTION_CACHE_README.html: CONNECTION_CACHE_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/CONTENT_INSPECTION_README.html: CONTENT_INSPECTION_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/CYRUS_README.html: CYRUS_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/BASIC_CONFIGURATION_README.html: BASIC_CONFIGURATION_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/BDAT_README.html: BDAT_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/BUILTIN_FILTER_README.html: BUILTIN_FILTER_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/DATABASE_README.html: DATABASE_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/DB_README.html: DB_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/DEBUG_README.html: DEBUG_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/DSN_README.html: DSN_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/ETRN_README.html: ETRN_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/FILTER_README.html: FILTER_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/FORWARD_SECRECY_README.html: FORWARD_SECRECY_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/INSTALL.html: INSTALL.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/IPV6_README.html: IPV6_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/LDAP_README.html: LDAP_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/LINUX_README.html: LINUX_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/LOCAL_RECIPIENT_README.html: LOCAL_RECIPIENT_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/MAILDROP_README.html: MAILDROP_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/MAILLOG_README.html: MAILLOG_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/LMDB_README.html: LMDB_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/MEMCACHE_README.html: MEMCACHE_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/MILTER_README.html: MILTER_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/MULTI_INSTANCE_README.html: MULTI_INSTANCE_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/MYSQL_README.html: MYSQL_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/NFS_README.html: NFS_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/OVERVIEW.html: OVERVIEW.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/PACKAGE_README.html: PACKAGE_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/PCRE_README.html: PCRE_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/PGSQL_README.html: PGSQL_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/POSTSCREEN_3_5_README.html: POSTSCREEN_3_5_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/POSTSCREEN_README.html: POSTSCREEN_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/QMQP_README.html: QMQP_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/QSHAPE_README.html: QSHAPE_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/RESTRICTION_CLASS_README.html: RESTRICTION_CLASS_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/SASL_README.html: SASL_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/SCHEDULER_README.html: SCHEDULER_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/SMTPD_ACCESS_README.html: SMTPD_ACCESS_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/SMTPD_POLICY_README.html: SMTPD_POLICY_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/SMTPD_PROXY_README.html: SMTPD_PROXY_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/SMTPUTF8_README.html: SMTPUTF8_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/SOHO_README.html: $(MAKESOHO) $(DEPSOHO)
	$(MAKESOHO) | $(POSTLINK) | $(DETAB) >$@

../html/SQLITE_README.html: SQLITE_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/STANDARD_CONFIGURATION_README.html: STANDARD_CONFIGURATION_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/STRESS_README.html: STRESS_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/TUNING_README.html: TUNING_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/UUCP_README.html: UUCP_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/ULTRIX_README.html: ULTRIX_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/VERP_README.html: VERP_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/VIRTUAL_README.html: VIRTUAL_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/XCLIENT_README.html: XCLIENT_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/XFORWARD_README.html: XFORWARD_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/TLS_README.html: TLS_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../html/TLS_LEGACY_README.html: TLS_LEGACY_README.html
	$(DETAB) $? | $(POSTLINK) >$@

../README_FILES/ADDRESS_CLASS_README: ADDRESS_CLASS_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/ADDRESS_REWRITING_README: ADDRESS_REWRITING_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/ADDRESS_VERIFICATION_README: ADDRESS_VERIFICATION_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/BACKSCATTER_README: BACKSCATTER_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/BASIC_CONFIGURATION_README: BASIC_CONFIGURATION_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/BDAT_README: BDAT_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/BUILTIN_FILTER_README: BUILTIN_FILTER_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/CDB_README: CDB_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/COMPATIBILITY_README: COMPATIBILITY_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/CONNECTION_CACHE_README: CONNECTION_CACHE_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/CONTENT_INSPECTION_README: CONTENT_INSPECTION_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/CYRUS_README: CYRUS_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/DATABASE_README: DATABASE_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/DB_README: DB_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/DEBUG_README: DEBUG_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/DSN_README: DSN_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/ETRN_README: ETRN_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/FILTER_README: FILTER_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/FORWARD_SECRECY_README: FORWARD_SECRECY_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/INSTALL: INSTALL.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/IPV6_README: IPV6_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/LDAP_README: LDAP_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/LINUX_README: LINUX_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/LOCAL_RECIPIENT_README: LOCAL_RECIPIENT_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/MAILDROP_README: MAILDROP_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/MAILLOG_README: MAILLOG_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/LMDB_README: LMDB_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/MEMCACHE_README: MEMCACHE_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/MILTER_README: MILTER_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/MULTI_INSTANCE_README: MULTI_INSTANCE_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/MYSQL_README: MYSQL_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/NFS_README: NFS_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/OVERVIEW: OVERVIEW.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/PACKAGE_README: PACKAGE_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/PCRE_README: PCRE_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/PGSQL_README: PGSQL_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/POSTSCREEN_3_5_README: POSTSCREEN_3_5_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/POSTSCREEN_README: POSTSCREEN_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/QMQP_README: QMQP_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/QSHAPE_README: QSHAPE_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/RESTRICTION_CLASS_README: RESTRICTION_CLASS_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/SASL_README: SASL_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/SCHEDULER_README: SCHEDULER_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/SMTPD_ACCESS_README: SMTPD_ACCESS_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/SMTPD_POLICY_README: SMTPD_POLICY_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/SMTPD_PROXY_README: SMTPD_PROXY_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/SMTPUTF8_README: SMTPUTF8_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/SOHO_README: $(MAKESOHO) $(DEPSOHO)
	$(MAKESOHO) | $(HT2READ) | $(DETAB) >$@

../README_FILES/SQLITE_README: SQLITE_README.html
	$(DETAB) $? | $(HT2READ) >$@ 

../README_FILES/STANDARD_CONFIGURATION_README: STANDARD_CONFIGURATION_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/STRESS_README: STRESS_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/TUNING_README: TUNING_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/UUCP_README: UUCP_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/ULTRIX_README: ULTRIX_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/VERP_README: VERP_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/VIRTUAL_README: VIRTUAL_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/XCLIENT_README: XCLIENT_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/XFORWARD_README: XFORWARD_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/TLS_README: TLS_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/TLS_LEGACY_README: TLS_LEGACY_README.html
	$(DETAB) $? | $(HT2READ) >$@

../README_FILES/AAAREADME: ../html/index.html $(MAKEAAA)
	$(MAKEAAA) ../html/index.html | $(HT2READ) | $(DETAB) >$@

../man/man5/postconf.5: postconf.man.prolog postconf.proto postconf.man.epilog \
	../mantools/xpostconf ../mantools/postconf2html ../mantools/postconf2man
	(cat postconf.man.prolog; ../mantools/xpostconf postconf.proto | \
	    $(DETAB) | ../mantools/postconf2html -n | \
		../mantools/postconf2man | \
		sed 's/\\e&/\\\&/'; cat postconf.man.epilog ) > $@

../html/postconf.5.html: postconf.html.prolog postconf.proto \
	postconf.html.epilog ../mantools/xpostconf ../mantools/postconf2html \
	../mantools/postlink
	(cat postconf.html.prolog; ../mantools/xpostconf postconf.proto | \
	    ../mantools/postconf2html | ../mantools/postlink; \
	    cat postconf.html.epilog ) | $(DETAB) > $@

../INSTALL: ../README_FILES/INSTALL
	rm -f $@
	col -b < $? > $@
