+#### WIP targets HB ##################
+## Make AUTHORS file
+authors: doc/source/ldpOK.dsl
+ cd doc/source && $(DB) -V nochunks authors.sgml > tmp.html && $(WDUMP) \
+ tmp.html > ../../AUTHORS && rm -f tmp.html
+ # kludge to force recreation on next run. Rodgrigo?
+ @rm -f doc/source/ldpOK.dsl
+
+# make a man page, and then (lousy) HTML version.
+man: doc/source/ldpOK.dsl
+ mkdir -p doc/source/man
+ cd doc/source/man && docbook2man ../privoxy-man-page.sgml &&\
+ $(PERL) -pi -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1
+ cd doc/source/man && $(DB) ../privoxy-man-page.sgml &&\
+ mv -f index.html privoxy-man-page.html
+ # kludge to force recreation on next run. Rodgrigo?
+ @rm -f doc/source/ldpOK.dsl
+
+# Set doc entities for VERSION and CODE_STATUS. Toggle content
+# exceptions accordingly. When 'make dok' gets stable, this
+# needs to go before any doc building (doh).
+make dok-release:
+ @$(ECHO) Setting doc version and status to $(VERSION), $(CODE_STATUS)
+ @$(PERL) -pi -e 's/<!entity +p-version.*>/<!entity p-version "$(VERSION)">/;\
+ s/<!entity +p-status.*>/<!entity p-status "$(CODE_STATUS)">/' \
+ doc/source/*sgml
+ifeq ($(CODE_STATUS),stable)
+ @$(ECHO) Setting docs to stable $(VERSION)
+ @$(PERL) -pi -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "INCLUDE">/;\
+ s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "IGNORE">/' \
+ doc/source/*sgml
+else
+ @$(ECHO) Setting docs to not stable $(VERSION)
+ @$(PERL) -pi -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "IGNORE">/;\
+ s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "INCLUDE">/' \
+ doc/source/*sgml
+endif
+