# Note: Makefile is built automatically from Makefile.in # # $Id: GNUmakefile.in,v 1.4 2002/08/08 01:02:26 hal9 Exp $ # # Location: doc/source/Makefile.in # Purpose: Build documentation # # Written by and Copyright (C) 2002 the Privoxy # team. http://www.privoxy.org/ # # This program is free software; you can redistribute it # and/or modify it under the terms of the GNU General # Public License as published by the Free Software # Foundation; either version 2 of the License, or (at # your option) any later version. # # This program is distributed in the hope that it will # be useful, but WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU General Public # License for more details. # # The GNU General Public License should be included with # this file. If not, you can view it at # http://www.gnu.org/copyleft/gpl.html # or write to the Free Software Foundation, Inc., 59 # Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ############################################################################# # Set make command correctly ############################################################################# @SET_MAKE@ ############################################################################# # Version number (for RPM) ############################################################################# VERSION_MAJOR = @VERSION_MAJOR@ VERSION_MINOR = @VERSION_MINOR@ 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 ############################################################################# PROGRAM = privoxy@EXEEXT@ ECHO = echo INSTALL = @INSTALL@ RM = rm -fr SED = sed CAT = cat MV = mv -f WDUMP = @WDUMP@ -dump JADECAT = @JADECAT@ JADEBIN = @JADEBIN@ DOC_STATUS = @DOC_STATUS@ MAN2HTML = @MAN2HTML@ # 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"). DB = $(JADEBIN) $(JADECAT) $(DOC_STATUS) -ihtml -t sgml -D.. -d ldp.dsl\#html G2H_CMD = groff -mandoc -Thtml TARGET_OS = @host@ PERL = perl DOC_DIR = . DOC_TMP = $(DOC_DIR)/tmp ROOT = ../.. UTILS = $(ROOT)/utils DOK_WEB_USEM=$(ROOT)/webserver/user-manual DOC_FILES = AUTHORS LICENSE README 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"` \ $(ROOT)/privoxy.1 ############################################################################# # 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 ############################################################################# # # 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 @$(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 # 3 checks to make sure docs will be generated ensure-wdump: ifeq (@WDUMP@,false) @$(ECHO) @$(ECHO) "Cannot build docs; one of w3m, links, or lynx must be installed." @$(ECHO) "You should install the appropriate package and rerun ./configure" @exit 1 endif ensure-jadebin: ifeq (@JADEBIN@,false) @$(ECHO) @$(ECHO) "Cannot build docs; one of openjade or jade must be installed" @$(ECHO) "You should install the appropriate package and rerun ./configure" @exit 1 endif ensure-dkprefix: ifeq (@DKPREFIX@,false) @$(ECHO) @$(ECHO) "Cannot build docs; cannot find docbook-dsssl stylesheets" @$(ECHO) "You should install the appropriate package and rerun ./configure" @exit 1 endif # user manual dok-user: ensure-dkprefix ensure-jadebin ensure-wdump 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 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 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 # readme page dok-readme: ensure-dkprefix ensure-jadebin ensure-wdump $(DB)-notoc -V nochunks readme.sgml > tmp.html &&\ $(WDUMP) tmp.html > $(ROOT)/README ;\ $(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 > index.html ;\ $(PERL) -pi.bak -e 's/..\/p_doc.css/p_doc.css/;\ s/<\/HEAD/\n<\/HEAD/;\ s/<\/HEAD/\n<\/HEAD/;\ s/\.\d\. //' index.html ;\ $(MV) index.html ../../webserver ;\ $(RM) *.html *.bak # privoxy-index.html for bundling with locally installed documentation: dok-index: ensure-dkprefix ensure-jadebin ensure-wdump 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<\/HEAD/;\ s/<\/HEAD/\n<\/HEAD/;\ s/\.\d\. //' privoxy-index.html ;\ $(MV) privoxy-index.html ../../webserver ;\ $(RM) *.html *.bak ## Make AUTHORS file dok-authors: ensure-dkprefix ensure-jadebin ensure-wdump $(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 cd $(DOC_TMP) && $(RM) * &&\ nsgmls $(DOC_STATUS) ../privoxy-man-page.sgml | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\ perl -pi.bak -e 's/ //; 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 $(MAKE) man2html $(MAKE) clean # For those with man2html ala RH7s. man2html: ensure-dkprefix ensure-jadebin ensure-wdump mkdir -p ../webserver/man-page ifneq ($(MAN2HTML),false) $(MAN2HTML) $(ROOT)/privoxy.1 |grep -v "^Content-type" > tmp.html $(PERL) -pi.bak -e 's///; s//man2html/' tmp.html $(PERL) -pi.bak -e 's/(<\/HEAD>)/<\/HEAD>/' tmp.html # Twice because my version of man2html is pulling in commas and periods in URLs. $(PERL) -pi.bak -e 's/()/$$1$$2/g' tmp.html $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html # Get rid of spurious  from conversion. (How to do this with perl?) $(SED) -e 's///g' tmp.html > ../webserver/man-page/privoxy-man-page.html && $(RM) tmp.* else $(MAKE) groff2html endif # Otherwise we get plain groff conversion. groff2html: $(G2H_CMD) $(ROOT)/privoxy.1 | $(SED) -e 's@@@' >\ ../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 @$(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). dok-shtml: dok-release ensure-dkprefix ensure-jadebin ensure-wdump $(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 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 @$(ECHO) Announce texts are done. Please check them. Some hand editing @$(ECHO) may be required. # The main Privoxy config file, generated from sgml sources. # NOTE: This will require some hand editing. The new file is outputted # 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 $(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;\ /^\d\.\d\.\s+/ && tr/[a-z]/[A-Z]/;\ $$header_len=0 unless $$hit_header;\ if ($$hit_header) {\ print "# ";\ for ($$i=1; $$i < $$header_len; $$i++) {print "=";}\ print "\n";\ };\ $$hit_header=0;\ $$hit_header=1 if m/^(\d\.)(\d\.)(\d\.)?\s/ && s/^(\d\.)//;\ $$header_len = length($$_);\ s/^/# /; /^# #{12,}/ && s/^# #/####/;\ s/^.*$$// if $$hit_option;\ $$hit_option=0;\ s/^\n//; s/^#\s*-{20,}//;\ $$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) "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 $(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.* $(PERL) -pi -e 's/^( )//;\ s/:$\/:\n/' $(ROOT)/config.new # This is mostly to catch cruft from build failures dok-clean: $(RM) $(DOC_TMP) *.html `find $(ROOT) -name "tmp.*" -o -name "*.tmp" -o -name "*.bak" -o -name "*.fot"` tidy: $(RM) `find . -name "*~"` `find . -name ".\#*"` clobber: tidy clean $(RM) GNUmakefile ldp.dsl distclean: clobber coffee: @perl -e 'print pack "C*", (31,139,8,8,153,63,226,60,2,3,99,111,102,102,101,101,0,109,143,205,13,192,32,8,133,\ 239,78,241,110,234,1,28,160,171,152,208,53,26,117,247,22,165,73,137,125,9,1,62,126,2,128,169,5,243,143,\ 13,139,49,164,65,100,149,152,102,73,141,88,73,178,116,205,100,69,253,36,102,81,49,83,236,19,225,171,131,\ 214,172,163,73,4,168,123,115,71,126,247,122,94,128,178,227,95,154,12,86,215,122,197,249,146,187,54,220,125,\ 193,51,228,11,1,0,0);'|zcat ############################################################################# # $Log: GNUmakefile.in,v $ # 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. #