# Note: Makefile is built automatically from Makefile.in
#
-# $Id: GNUmakefile.in,v 1.198 2011/08/26 16:11:59 fabiankeil Exp $
+# $Id: GNUmakefile.in,v 1.201 2011/08/31 13:36:35 fabiankeil Exp $
#
-# Written by and Copyright (C) 2001-2010 members of the
+# Written by and Copyright (C) 2001-2011 members of the
# Privoxy team. http://www.privoxy.org/
#
# Based on the Internet Junkbuster originally written
DOC_DIR = doc/source
DOC_TMP = $(DOC_DIR)/tmp
DOC_STATUS = @DOC_STATUS@
+TIDY = tidy -modify -indent -clean -wrap 78
# Program to do LF->CRLF
#
# moves dokumentation to webserver
#
#############################################################################
-webserver: tidy
+webserver: clean-editor-files
@$(ECHO) -------------------------------------------------------
@$(ECHO) You will need to "create" a SF shell first:
@$(ECHO) ssh -t SF-USER-ID,ijbswa@shell.sourceforge.net create
@$(SSH) shell.sourceforge.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true'
@$(SSH) shell.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true'
-web-actions: tidy
+web-actions: clean-editor-files
@$(ECHO) Uploading
@cd doc/webserver/actions; \
upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
$(WGET) http://www.privoxy.org/docs/$(DOC_FILE) ;\
$(TAR) -zxvf $(DOC_FILE)
+#############################################################################
+#
+# Try to clean up the generated HTML files.
+#
+# The files are a such a mess that some of them require two tidy runs
+# in row as the first abort prematurely. The vanilla tidy output renders
+# poorly as it contains a bit too much white-space, so we additionally run
+# the files through perl to fix this again.
+#
+#############################################################################
+dok-tidy:
+ for html_file in `find doc/webserver -name "*.html"`; do \
+ $(TIDY) $$html_file || $(TIDY) $$html_file; \
+ $(PERL) -i\'\' -e 's@^\s*<br>\s*$$@@; s@ +$$@@;' -n -p $$html_file; \
+ done
+
#############################################################################
# Source file dependencies
$(RM) a.out $(OBJS) $(W32_FILES) $(W32_INIS) $(PROGRAM) default.action \
`find . -name TAGS -o -name tags | $(GREP) -v .git` config.base config.tmp
-tidy:
+clean-editor-files:
$(RM) `find . -name "*~"`
$(RM) `find . -name "#*#"` # Emacs backup files
$(RM) `find . -name ".\#*"`
-clobber: tidy
+clobber: clean-editor-files
$(RM) GNUmakefile configure config.h.in config.h config.cache config.status config.log logfile \
privoxy.log core *.tar.gz *.tar privoxy-cl.spec doc/source/ldp.dsl config.new
$(RM) -r autom4te.cache