# Note: Makefile is built automatically from Makefile.in
#
-# $Id: GNUmakefile.in,v 1.5 2002/09/05 23:12:04 hal9 Exp $
+# $Id: GNUmakefile.in,v 1.6 2002/09/06 01:58:28 hal9 Exp $
#
# Location: doc/source/Makefile.in
# Purpose: Build documentation
JADEBIN = @JADEBIN@
DOC_STATUS = @DOC_STATUS@
MAN2HTML = @MAN2HTML@
+DKPREFIX = @DKPREFIX@
# Note: Please make sure that -d ldp.dsl\#html stays the last option to
# $(JADEBIN), because for some targets "-notoc" will be appended
# to it (--> "ldp.dsl\#html-notoc").
UTILS = $(ROOT)/utils
DOK_WEB_USEM=$(ROOT)/webserver/user-manual
-DOC_FILES = AUTHORS LICENSE README ChangeLog \
+DOC_FILES = $(ROOT)/AUTHORS $(ROOT)/LICENSE $(ROOT)/README $(ROOT)/INSTALL $(ROOT)/ChangeLog \
`find ../text/ -type f | grep -v "CVS" | grep -v "\.\#" | grep -v ".*~" | grep -v ".cvsignore" | grep -v "TAGS"` \
`find ../webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \
`find ../webserver/ -name "*.css"` \
#############################################################################
# Phony targets
#############################################################################
-.PHONY: all dok webserver dok-webserver clean dok-clean clobber ensure-wdump \
-ensure-jadebin ensure-dkprefix user dok-user devel dok-devel faq dok-faq \
-readme dok-readme authors dok-authors index dok-index webserver dok-webserver \
-man dok-man man2html manuals dok-release dok-pdf dok-shtml announce config-file
+.PHONY: all dok webserver doc-webserver clean doc-clean clobber ensure-wdump \
+ensure-jadebin ensure-dkprefix user doc-user devel doc-devel faq doc-faq \
+readme doc-readme authors doc-authors index doc-index webserver doc-webserver \
+man doc-man man2html manuals doc-release doc-pdf doc-shtml announce config-file
#############################################################################
#
# Documentation
# converts *.sgml into html, pdf, text and man pages
#
#############################################################################
-#
+
+#############################################################################
# Build the Manuals, etc #########################################
# This does not build _all_ targets #########################################
-all: dok-release dok-user dok-devel dok-faq dok-webserver dok-index dok-readme dok-authors dok-man dok-clean
+all: $(DOC_DIR)/doc_version.tmp doc-user doc-devel doc-faq doc-webserver doc-index doc-readme doc-authors doc-man doc-clean
@$(ECHO) Documentation created.
-# Shortcuts. Use these targets.
-clean: dok-clean
-index: dok-release dok-webserver dok-index dok-clean
-user: dok-release dok-user dok-clean
-devel: dok-release dok-devel dok-clean
-faq: dok-release dok-faq dok-clean
-manuals: dok-release dok-user dok-devel dok-faq dok-clean
-readme: dok-release dok-readme dok-clean
-webserver: dok-release dok-webserver dok-clean
-man: dok-release dok-man dok-clean
-authors: dok-release dok-authors dok-clean
-pdf: dok-release dok-pdf
+#############################################################################
+# Shortcuts. Use these targets if building docs selectively (ie not 'all').
+#
+# Both index pages (index.html and privoxy-index.html)
+index: $(DOC_DIR)/doc_version.tmp doc-webserver doc-index doc-clean
+
+# Just index.html
+webserver: $(DOC_DIR)/doc_version.tmp doc-webserver doc-clean
+
+# User Manual html and text
+user: $(DOC_DIR)/doc_version.tmp doc-user doc-clean
+
+# Developer Manual html and text
+devel: $(DOC_DIR)/doc_version.tmp doc-devel doc-clean
+
+# FAQ html and text
+faq: $(DOC_DIR)/doc_version.tmp doc-faq doc-clean
+
+# All formal manuals (html and text).
+manuals: $(DOC_DIR)/doc_version.tmp doc-user doc-devel doc-faq doc-clean
+
+# README and INSTALL
+readme: $(DOC_DIR)/doc_version.tmp doc-readme doc-clean
+
+# man page and html man page
+man: $(DOC_DIR)/doc_version.tmp doc-man doc-clean
+
+# AUTHORS file only.
+authors: $(DOC_DIR)/doc_version.tmp doc-authors doc-clean
+
+# PDF version of manuals.
+pdf: $(DOC_DIR)/doc_version.tmp doc-pdf
+
+# doh.
+clean: doc-clean
+
+# backward compatibility targets
+dok-user: user
+dok-faq: faq
+dok-devel: devel
+dok-index: index
+dok-man: man
+dok-readme: readme
+dok: all
# 3 checks to make sure docs will be generated
ensure-wdump:
@exit 1
endif
+# Update release info, so it can be read by Docbook/jade, and run other
+# checks.
+$(DOC_DIR)/doc_version.tmp: ensure-dkprefix ensure-jadebin ensure-wdump doc-release
+
+# Write VERSION and CODE_STATUS to tmp files so they can be read into the doc
+# processing. This needs to go before any doc building (doh).
+doc-release:
+ @$(ECHO) Setting doc version and status to $(VERSION), $(CODE_STATUS)
+ $(MAKE) doc-clean
+ mkdir -p $(DOC_TMP)
+ $(ECHO) -n $(VERSION) > $(DOC_DIR)/doc_version.tmp
+ $(ECHO) -n $(CODE_STATUS) > $(DOC_DIR)/doc_status.tmp
+ $(ECHO) -n $(STABLE) > $(DOC_DIR)/doc_stable.tmp
+
# user manual
-dok-user: ensure-dkprefix ensure-jadebin ensure-wdump
+doc-user:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
cd $(DOC_TMP) && $(RM) * && $(DB) -iuser-man ../user-manual.sgml && cd .. && \
$(RM) ../webserver/user-manual/*.html && cp $(DOC_TMP)/*.html ../webserver/user-manual/
$(DB) -iuser-man -V nochunks user-manual.sgml > tmp.html && $(WDUMP) tmp.html > ../text/user-manual.txt
# developer manual
-dok-devel: ensure-dkprefix ensure-jadebin ensure-wdump
+doc-devel:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
cd $(DOC_TMP) && $(RM) * && $(DB) ../developer-manual.sgml && cd .. && \
$(RM) ../webserver/developer-manual/*.html && cp -f $(DOC_TMP)/*.html ../webserver/developer-manual/
$(DB) -V nochunks developer-manual.sgml > tmp.html && $(WDUMP) tmp.html > ../text/developer-manual.txt
# faq
-dok-faq: ensure-dkprefix ensure-jadebin ensure-wdump
+doc-faq:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
cd $(DOC_TMP) && $(RM) * && $(DB) ../faq.sgml && cd .. && \
$(RM) ../webserver/faq/*.html && cp $(DOC_TMP)/*.html ../webserver/faq/
$(DB) -V nochunks faq.sgml > tmp.html && $(WDUMP) tmp.html > ../text/faq.txt
# Build README and INSTALL files.
-dok-readme: dok-release ensure-dkprefix ensure-jadebin ensure-wdump
+doc-readme:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
$(DB)-notoc -V nochunks readme.sgml > tmp.html &&\
$(WDUMP) tmp.html > $(ROOT)/README ;\
$(DB)-notoc -V nochunks install.sgml > tmp.html &&\
# for documentation (privoxy-index.html), etc.
#
# index.html for webserver:
-dok-webserver: ensure-dkprefix ensure-jadebin ensure-wdump
+doc-webserver:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
cd webserver && $(DB)-notoc -ip-homepage -V nochunks index.sgml > index.html ;\
$(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps consumers reduce unwanted junk email and protect their privacy from direct marketing companies.\"><\/HEAD/;\
$(RM) *.html *.bak
# privoxy-index.html for bundling with locally installed documentation:
-dok-index: ensure-dkprefix ensure-jadebin ensure-wdump
+doc-index:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
cd webserver && $(DB)-notoc -ip-index -V nochunks index.sgml > privoxy-index.html ;\
$(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\
s/<\/HEAD/\n<meta name=\"description\" content=\"Privoxy helps consumers reduce unwanted junk email and protect their privacy from direct marketing companies.\"><\/HEAD/;\
$(RM) *.html *.bak
## Make AUTHORS file
-dok-authors: ensure-dkprefix ensure-jadebin ensure-wdump
+doc-authors:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
$(DB) -V nochunks authors.sgml > tmp.html && $(WDUMP) \
tmp.html > ../../AUTHORS
# Make a man page, and then HTML version. Uses docbook2man (short perl script)
# in utils dir.
-dok-man: ensure-dkprefix ensure-jadebin dok-release
+doc-man:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
cd $(DOC_TMP) && $(RM) * &&\
nsgmls $(DOC_STATUS) ../privoxy-man-page.sgml | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\
perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1
$(MAKE) clean
# For those with man2html ala RH7s.
-man2html: ensure-dkprefix ensure-jadebin ensure-wdump
+man2html:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
mkdir -p ../webserver/man-page
ifneq ($(MAN2HTML),false)
$(MAN2HTML) $(ROOT)/privoxy.1 |grep -v "^Content-type" > tmp.html
$(G2H_CMD) $(ROOT)/privoxy.1 | $(SED) -e 's@</head>@<link REL="STYLESHEET" TYPE="text/css" HREF="../p_doc.css"></head>@' >\
../webserver/man-page/privoxy-man-page.html
-# Write VERSION and CODE_STATUS to tmp files so they can be read into the doc
-# processing. This needs to go before any doc building (doh).
-dok-release:
- @$(ECHO) Setting doc version and status to $(VERSION), $(CODE_STATUS)
- $(MAKE) dok-clean
- mkdir -p $(DOC_TMP)
- $(ECHO) -n $(VERSION) > $(DOC_DIR)/doc_version.tmp
- $(ECHO) -n $(CODE_STATUS) > $(DOC_DIR)/doc_status.tmp
- $(ECHO) -n $(STABLE) > $(DOC_DIR)/doc_stable.tmp
-
# Make pdf docs from single page html. Requires htmldoc, see
# (http://www.easysw.com/htmldoc/). Note: 1.8.20 has a TOC bug.
# PDF docs are uploaded to webserver as zip archive.
-dok-pdf: dok-shtml
+doc-pdf: doc-shtml
@$(ECHO) -n "starting htmldoc version: "; htmldoc --version
cd $(UTILS)/ldp_print && $(RM) *html *bak *jpg *tmp *pdf *zip
cp -f $(DOC_TMP)/*html ../webserver/images/*jpg $(UTILS)/ldp_print
# Generate single page html. Used only for creating pdf docs (ATM).
-dok-shtml: dok-release ensure-dkprefix ensure-jadebin ensure-wdump
+doc-shtml:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
$(DB) -iuser-man -V nochunks user-manual.sgml > $(DOC_TMP)/privoxy-user-manual.html
$(DB) -V nochunks developer-manual.sgml > $(DOC_TMP)/privoxy-developer-manual.html
$(DB) -V nochunks faq.sgml > $(DOC_TMP)/privoxy-faq.html
# Create release announcement in text and html, with short and long versions.
# This is a standalone target, and must be invoked directly.
-announce: dok-release ensure-wdump
+announce: $(DOC_DIR)/doc_version.tmp
cd $(DOC_TMP) && $(DB) -iannounce-big ../announce.sgml &&\
mv -f index.html announce.html && $(WDUMP) announce.html > announce.txt
cd $(DOC_TMP) && $(DB) ../announce.sgml &&\
mv -f index.html announce-mini.html && $(WDUMP) announce-mini.html > announce-mini.txt &&\
mv -f *html *txt $(ROOT)
- $(MAKE) dok-clean
+ $(MAKE) doc-clean
@$(ECHO) Announce texts are done. Please check them. Some hand editing
@$(ECHO) may be required.
# as config.new so that problem sections can be compared to previous
# version. This is hardcored to w3m for html/text conversion. Also,
# requires the shell util 'fmt'.
-config-file: ensure-dkprefix ensure-jadebin ensure-wdump dok-release
+config-file: $(DOC_DIR)/doc_version.tmp
$(DB)-notoc -iconfig-file -V nochunks config.sgml > tmp.html &&\
w3m -dump tmp.html |fmt -w 70 > $(ROOT)/config.new && $(RM) tmp.*
$(PERL) -pi.bak -e 's/^1\. \@\@TITLE\@\@/ /i;\
# config file, alternate verison using lynx (perl stuff unfinished). Lynx
# does not do so good a job.
-config-file-alt: dok-release ensure-wdump
+config-file-alt: doc-release ensure-wdump
$(ECHO) -e ".h2 JUSTIFY\\nJUSTIFY:FALSE" > tmp.lynx_cfg &&\
$(DB)-notoc -iconfig-file -V nochunks config.sgml > tmp.html &&\
lynx -cfg=tmp.lynx_cfg -width=78 -dump tmp.html > ../../config.new && $(RM) tmp.*
s/:$\/:\n/' $(ROOT)/config.new
# This is mostly to catch cruft from build failures
-dok-clean:
+doc-clean:
$(RM) $(DOC_TMP) *.html `find $(ROOT) -name "tmp.*" -o -name "*.tmp" -o -name "*.bak" -o -name "*.fot"`
tidy:
- $(RM) `find . -name "*~"` `find . -name ".\#*"`
+ $(RM) doc_* `find . -name "*~"` `find . -name ".\#*"`
clobber: tidy clean
$(RM) GNUmakefile ldp.dsl
#############################################################################
# $Log: GNUmakefile.in,v $
+# Revision 1.6 2002/09/06 01:58:28 hal9
+# Create a separate INSTALL file, and remove install instructions from README.
+# INSTALL is built from dok-readme target.
+#
# Revision 1.5 2002/09/05 23:12:04 hal9
# Updated Makefile with 3.0 changes (pdf and man targets, etc). Revise comments
# in privoxy-man-page.sgml to remove out of date comments.