# Note: Makefile is built automatically from Makefile.in
#
-# $Id: GNUmakefile.in,v 1.1 2002/06/05 00:28:28 hal9 Exp $
+# $Id: GNUmakefile.in,v 1.8 2002/09/26 22:51:16 hal9 Exp $
#
# Location: doc/source/Makefile.in
# Purpose: Build documentation
VERSION_POINT = @VERSION_POINT@
CODE_STATUS = @CODE_STATUS@
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT)
+# Whatever the most recent stable version is.
+STABLE = 3.0.0
#############################################################################
# Build tools
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").
DOC_DIR = .
DOC_TMP = $(DOC_DIR)/tmp
ROOT = ../..
+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-pdf2 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, text and man pages
+# 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-index dok-readme dok-authors 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
+#############################################################################
+# 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
-# man page, using one variant of man2html that reads page from stdin.
-dok-man-suse: ensure-dkprefix ensure-jadebin ensure-wdump dok-release
- $(RM) ../webserver/man-page/*.html
-ifneq ($(MAN2HTML),false)
- $(ECHO) "<html><head><title>Privoxy Man page</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../p_web.css\"></head><body><H2>NAME</H2>" > \
- ../webserver/man-page/privoxy-man-page.html
- man $(ROOT)/privoxy.1 | $(MAN2HTML) -bare >> ../webserver/man-page/privoxy-man-page.html
- $(ECHO) "</body></html>" >> ../webserver/man-page/privoxy-man-page.html
-else
- $(MAKE) groff2html
-endif
-
-# readme page
-dok-readme: ensure-dkprefix ensure-jadebin ensure-wdump
+# Build README and INSTALL files.
+doc-readme:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
$(DB)-notoc -V nochunks readme.sgml > tmp.html &&\
- $(WDUMP) tmp.html > $(ROOT)/README
+ $(WDUMP) tmp.html > $(ROOT)/README ;\
+ $(DB)-notoc -V nochunks install.sgml > tmp.html &&\
+ $(WDUMP) tmp.html > $(ROOT)/INSTALL ;\
+ $(RM) tmp.*
# index.sgml is used to create both the Home Page, and a local index
# for documentation (privoxy-index.html), etc.
#
# index.html for webserver:
-dok-webserver: ensure-dkprefix ensure-jadebin ensure-wdump
- cd webserver && $(DB)-notoc -ip-homepage -V nochunks index.sgml > ../../webserver/index.html
+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/;\
s/<\/HEAD/\n<meta name="MSSmartTagsPreventParsing" content="TRUE"><\/HEAD/;\
- s/\.\d\. //'\
- ../webserver/index.html
-
-# privoxy-index.html for local documentation:
-dok-index: ensure-dkprefix ensure-jadebin ensure-wdump
- cd webserver && $(DB)-notoc -ip-index -V nochunks index.sgml > ../../webserver/privoxy-index.html
+ s/\.\d\. //' index.html ;\
+ $(MV) index.html ../../webserver ;\
+ $(RM) *.html *.bak
+
+# privoxy-index.html for bundling with locally installed documentation:
+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/;\
s/<\/HEAD/\n<meta name="MSSmartTagsPreventParsing" content="TRUE"><\/HEAD/;\
- s/\.\d\. //'\
- ../webserver/privoxy-index.html
+ s/\.\d\. //' privoxy-index.html ;\
+ $(MV) privoxy-index.html ../../webserver ;\
+ $(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 (lousy) HTML version.
-# Requires docbook2man (short perl script), see comments
-# in privoxy-man-page.sgml. This target is not invoked from other dok targets.
-# It is built separately due to dependencies on off-beat perl scripts.
-# Note: docbook2man eats all command line arguments except file name. Bummer.
-dok-man: ensure-dkprefix ensure-jadebin
- cd $(DOC_TMP) && $(RM) * && docbook2man $(DOC_STATUS) ../privoxy-man-page.sgml &&\
- perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1
- cd $(DOC_TMP) && $(DB) ../privoxy-man-page.sgml &&\
- $(MV) -f index.html privoxy-man-page.html
- # This html is not used. See make man2html.
- $(MV) -f $(DOC_TMP)/privoxy.1 $(ROOT)/privoxy.1
- # Build a proper HTML man page.
- $(MAKE) man2html
-
-# This is laternate version of above, that does handle command line options,
-# ie DOC_STATUS.
-dok-man-test: ensure-dkprefix ensure-jadebin dok-release
+# Make a man page, and then HTML version. Uses docbook2man (short perl script)
+# in utils dir.
+doc-man:
+ test -f $(DOC_DIR)/doc_version.tmp || exit 1
cd $(DOC_TMP) && $(RM) * &&\
- nsgmls $(DOC_STATUS) ../privoxy-man-page.sgml | sgmlspl `find /usr/share/sgml -name docbook2man-spec.pl` &&\
+ nsgmls $(DOC_STATUS) ../privoxy-man-page.sgml | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\
perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1
- cd $(DOC_TMP) && $(DB) ../privoxy-man-page.sgml &&\
- $(MV) -f index.html privoxy-man-page.html
+# cd $(DOC_TMP) && $(DB) ../privoxy-man-page.sgml &&\
+# $(MV) -f index.html privoxy-man-page.html
# This html is not used. See make man2html.
$(MV) -f $(DOC_TMP)/privoxy.1 $(ROOT)/privoxy.1
$(MAKE) man2html
$(MAKE) clean
-# For those with man2html ala RH7's.
-man2html: ensure-dkprefix ensure-jadebin ensure-wdump
+# For those with man2html ala RH7s.
+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
$(PERL) -pi.bak -e 's/<A .*Contents<\/A>//; s/<A .*man2html<\/A>/man2html/' tmp.html
$(PERL) -pi.bak -e 's/(<\/HEAD>)/<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"..\/p_doc.css\"><\/HEAD>/' tmp.html
+# Twice because my version of man2html is pulling in commas and periods in URLs.
+ $(PERL) -pi.bak -e 's/(<A.*),(">)/$$1$$2/g' tmp.html
+ $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html
# Get rid of spurious \a from conversion. (How to do this with perl?)
- $(SED) -e 's/\a//g' tmp.html > ../webserver/man-page/privoxy-man-page.html
+ $(SED) -e 's/\a//g' tmp.html > ../webserver/man-page/privoxy-man-page.html && $(RM) tmp.*
else
$(MAKE) groff2html
endif
$(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
-
-dok-pdf: dok-release
- $(RM) ../pdf/*.pdf
- cp -f *.sgml ../pdf
- cp -f *.dsl ../pdf
- cd ../pdf && db2pdf --pdf -s ldp.dsl user-manual.sgml && mv user-manual.pdf privoxy-user-manual.pdf > /dev/null 2>&1
- cd ../pdf && db2pdf --pdf -s ldp.dsl developer-manual.sgml && mv developer-manual.pdf privoxy-developer-manual.pdf > /dev/null 2>&1
- cd ../pdf && db2pdf --pdf -s ldp.dsl faq.sgml && mv faq.pdf privoxy-faq.pdf > /dev/null 2>&1
- $(RM) ../pdf/*.sgml ../pdf/*.dsl ../pdf/*.out ../pdf/*.tex ../pdf/*.log ../pdf/*.aux
-
-# the layout and style with db2pdf sucks, here is an alternative
-dok-pdf2: dok-release
- mkdir -p $(DOC_TMP) # this directory not in cvs
- $(DB) -V nochunks user-manual.sgml > $(DOC_TMP)/privoxy-user-manual.html
+# 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.
+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
+ cd $(UTILS)/ldp_print ;\
+ $(PERL) -pi.bak -e 's/\.\.\/images\///; s/(<\/?)SUB/$$1small/i;\
+ s/\.\.\/user-manual\/index\.html/privoxy-user-manual.pdf/;\
+ s/\.\.\/developer-manual\/index\.html/privoxy-developer-manual.pdf/;\
+ s/\.\.\/faq\/index\.html/privoxy-faq.pdf/' *.html ;\
+ for i in developer-manual user-manual faq; do \
+ ./ldp_print privoxy-$$i.html ;\
+ $(ECHO) DONE: privoxy-$$i.pdf ;\
+ done ;\
+ $(MV) *.pdf ../../doc/pdf ;\
+ $(RM) *html *bak *jpg *pdf *zip
+ $(RM) $(DOC_TMP)
+
+
+# Generate single page html. Used only for creating pdf docs (ATM).
+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
-# one could use html2ps and ps2pdf. well, that does not work. htmlps produces incorrect output.
# 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;\
s/^/# /; /^# #{12,}/ && s/^# #/####/;\
s/^.*$$// if $$hit_option;\
$$hit_option=0;\
- s/^\n//; s/^#\s*-{20,}//;\
+ s/^\n//; s/^#\s*-{20,}//; s/ *$$//;\
$$hit_option=1 if s/^#\s+@@//;' $(ROOT)/config.new
$(RM) $(ROOT)/*.bak *.tmp tmp.* $(DOC_TMP)
@$(ECHO) "****************************************************"
@$(ECHO) "The output file is config.new."
@$(ECHO) "Now -- you need to hand edit the results!!!"
- @$(ECHO) "In particular, check the Debug levels, and the"
- @$(ECHO) "permit-access, forward & socks examples. They"
+ @$(ECHO) "In particular, check the Debug levels, the"
+ @$(ECHO) "permit-access, forward & socks examples and the"
+ @$(ECHO) "various user-manual examples, which all"
@$(ECHO) "probably got hammered."
@$(ECHO) "****************************************************"
# 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:
- $(RM) $(DOC_TMP) `find $(ROOT) -name "tmp.*" -o -name "*.tmp" -o -name "*.bak" -o -name "*.fot"`
+doc-clean:
+ $(RM) $(DOC_TMP) *.html `find $(ROOT) -name "tmp.*" -o -name "*.tmp" -o -name "*.bak" -o -name "*.fot"`
tidy:
- $(RM) `find . -name "*~"`
- $(RM) `find . -name ".\#*"`
+ $(RM) doc_* `find . -name "*~"` `find . -name ".\#*"`
clobber: tidy clean
$(RM) GNUmakefile ldp.dsl
#############################################################################
# $Log: GNUmakefile.in,v $
+# Revision 1.8 2002/09/26 22:51:16 hal9
+# New user-manual examples in config-file are wrapping now. Add warning.
+#
+# Revision 1.7 2002/09/16 06:04:34 hal9
+# Improved $(VERSION) handling, and related cleanups, with minor changes to most
+# targets. Renamed all dok-* targets to doc-*, and added some backward
+# compatibility targets.
+#
+# 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.
+#
+# Revision 1.4 2002/08/08 01:02:26 hal9
+# Update pdf2 target to dok-shtml (for single page html)
+#
+# Revision 1.3 2002/06/07 00:27:04 hal9
+# Fixing man2html quirk that pulls in punctuation, and breaks URLs.
+#
+# Revision 1.2 2002/06/05 04:17:19 hal9
+# Add dok-man-test target as temp workaround for docbook2man ignoring -i command
+# line option.
+#
# Revision 1.1 2002/06/05 00:28:28 hal9
# Moving all doc building to doc/source. Rewrite all targets (not well tested).
# Docs are now built without touching sgml source.