# Makefile.am
-# Automake file for Ethereal help files
+# Automake file for Wireshark help files
#
-# $Id: Makefile.am,v 1.3 2003/12/22 20:04:32 guy Exp $
+# $Id$
#
-# Ethereal - Network traffic analyzer
-# By Gerald Combs <gerald@ethereal.com>
+# Wireshark - Network traffic analyzer
+# By Gerald Combs <gerald@wireshark.org>
# Copyright 2003 Gerald Combs
#
# This program is free software; you can redistribute it and/or
# Install the help files in the "help" subdirectory of the data directory.
#
helpdir = $(pkgdatadir)/help
-help_DATA = \
- capture_filters.txt \
- display_filters.txt \
- faq.txt \
- overview.txt \
- well_known.txt
+help_DATA = \
+ toc \
+ getting_started.txt \
+ capturing.txt \
+ capture_filters.txt \
+ display_filters.txt \
+ faq.txt \
+ overview.txt
-EXTRA_DIST = $(help_DATA) convert-include.sh Makefile.nmake
+EXTRA_DIST = \
+ $(help_DATA) \
+ Makefile.nmake \
+ $(srcdir)/faq.py \
+ faq.txt
-CLEANFILES =
+CLEANFILES = faq.txt
+
+MAINTAINERCLEANFILES = \
+ Makefile.in
+
+# Try our best to convert the FAQ to text.
+# The output of html2text.py isn't as pretty as elinks, links, or lynx. If that ever changes, we
+# can use it exclusively.
+faq.txt: $(srcdir)/faq.py
+ $(srcdir)/faq.py >$@.tmp && \
+ (( which elinks > /dev/null && elinks -dump -dump-width 72 -no-numbering -no-references < $@.tmp > $@ ) || \
+ ( which links > /dev/null && links -width 72 -html-numbered-links 0 -dump $@.tmp > $@ ) || \
+ ( which lynx > /dev/null && lynx -dump -width=72 -nolist -stdin -force-html < $@.tmp > $@ ) || \
+ $(srcdir)/../tools/html2text.py --width=72 --no-links $@.tmp > $@ ) && \
+ rm -f $@.tmp