5 DEFS = -DSYSCONFDIR=\"$(sysconfdir)\" -DBINDIR=\"$(bindir)\" -DHAVE_CONFIG_H=1
6 AM_CPPFLAGS = -I. -I.. -I$(includedir) -I$(top_srcdir)
8 MAKEDOC_CPP = $(CPP) $(AM_CPPFLAGS) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C
10 noinst_PROGRAMS = makedoc
12 EXTRA_DIST = dotlock.man \
17 applying-patches.txt \
29 Muttrc Muttrc.head stamp-doc-rc \
30 makedoc.c makedoc-defs.h \
31 mutt.css mutt.xsl html.xsl chunk.xsl $(BUILT_DISTFILES)
33 CHUNKED_DOCFILES = index.html intro.html gettingstarted.html \
34 configuration.html mimesupport.html advancedusage.html \
35 optionalfeatures.html security.html tuning.html reference.html miscellany.html
37 HTML_DOCFILES = manual.html $(CHUNKED_DOCFILES)
39 BUILT_DISTFILES = stamp-doc-xml stamp-doc-chunked manual.txt $(HTML_DOCFILES)
41 srcdir_DOCFILES = PGP-Notes.txt applying-patches.txt \
42 devel-notes.txt patch-notes.txt smime-notes.txt
44 topsrcdir_DOCFILES = COPYRIGHT GPL INSTALL ChangeLog \
45 README NEWS TODO README.SECURITY README.SSL
49 makedoc-all: mutt.1 smime_keys.1 muttrc.man manual.html stamp-doc-rc stamp-doc-chunked manual.txt
51 install-data-local: makedoc-all instdoc
52 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
53 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man5
54 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
55 ./instdoc mutt.1 $(DESTDIR)$(mandir)/man1/mutt.1
56 ./instdoc smime_keys.1 $(DESTDIR)$(mandir)/man1/smime_keys.1
57 ./instdoc $(srcdir)/muttbug.man $(DESTDIR)$(mandir)/man1/flea.1
58 ./instdoc $(srcdir)/muttbug.man $(DESTDIR)$(mandir)/man1/muttbug.1
59 test x@DOTLOCK_TARGET@ = x || ./instdoc $(srcdir)/dotlock.man \
60 $(DESTDIR)$(mandir)/man1/mutt_dotlock.1
61 ./instdoc muttrc.man $(DESTDIR)$(mandir)/man5/muttrc.5
62 ./instdoc $(srcdir)/mbox.man $(DESTDIR)$(mandir)/man5/mbox.5
63 ./instdoc $(srcdir)/mmdf.man $(DESTDIR)$(mandir)/man5/mmdf.5
64 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)
65 for f in $(topsrcdir_DOCFILES) ; do \
66 $(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \
68 for f in $(srcdir_DOCFILES) ; do \
69 $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \
71 -$(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir)
72 -for f in $(HTML_DOCFILES) ; do \
73 $(INSTALL) -m 644 $$f $(DESTDIR)$(docdir) ; \
75 $(INSTALL) -m 644 Muttrc $(DESTDIR)$(sysconfdir)/Muttrc.dist
76 -if [ -f $(DESTDIR)$(pkgdatadir)/Muttrc ] ; then \
77 mv $(DESTDIR)$(pkgdatadir)/Muttrc* $(DESTDIR)$(sysconfdir) ; \
78 elif [ -f $(DESTDIR)$(pkgdatadir)/../Muttrc ] ; then \
79 mv $(DESTDIR)$(pkgdatadir)/../Muttrc* $(DESTDIR)$(sysconfdir) ; \
80 elif [ ! -f $(DESTDIR)$(sysconfdir)/Muttrc ] ; then \
81 $(INSTALL) -m 644 Muttrc $(DESTDIR)$(sysconfdir) ; \
85 for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 smime_keys.1; do \
86 rm -f $(DESTDIR)$(mandir)/man1/$$f ; \
88 for f in muttrc.5 mbox.5 mmdf.5 ; do \
89 rm -f $(DESTDIR)$(mandir)/man5/$$f ; \
91 for f in $(srcdir_DOCFILES) $(topsrcdir_DOCFILES) $(HTML_DOCFILES) ; \
93 rm -f $(DESTDIR)$(docdir)/$$f ; \
95 -rm -f $(DESTDIR)$(docdir)/manual.txt
96 for i in Muttrc ; do \
97 if cmp -s $(DESTDIR)$(sysconfdir)/$$i.dist $(DESTDIR)$(sysconfdir)/$$i ; then \
98 rm $(DESTDIR)$(sysconfdir)/$$i ; \
100 rm $(DESTDIR)$(sysconfdir)/$${i}.dist ; \
104 manual.txt: manual.html
105 -LC_ALL=C lynx -dump -nolist -with_backspaces -display_charset=us-ascii manual.html > $@ || \
106 LC_ALL=C w3m -dump manual.html > $@ || \
107 LC_ALL=C elinks -dump -no-numbering -no-references manual.html | sed -e 's,\\001, ,g' > $@
111 stamp-doc-rc: $(top_srcdir)/init.h makedoc$(EXEEXT) $(srcdir)/Muttrc.head
112 -rm -f Muttrc stamp-doc-rc
113 sed -e 's,[@]docdir[@],$(docdir),' $(srcdir)/Muttrc.head > Muttrc
114 $(CPP) $(AM_CPPFLAGS) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C \
115 $(top_srcdir)/init.h | ./makedoc$(EXEEXT) -c >> Muttrc
118 manual.html: $(srcdir)/html.xsl $(srcdir)/mutt.xsl stamp-doc-xml $(srcdir)/mutt.css
119 -xsltproc --nonet -o $@ $(srcdir)/html.xsl manual.xml
121 stamp-doc-chunked: $(srcdir)/chunk.xsl $(srcdir)/mutt.xsl stamp-doc-xml $(srcdir)/mutt.css
122 -xsltproc --nonet $(srcdir)/chunk.xsl manual.xml
123 touch stamp-doc-chunked
125 $(CHUNKED_DOCFILES): stamp-doc-chunked
127 manual.pdf: manual.tex
128 -if test -f manual.tex; then pdfjadetex manual.tex; fi
130 manual.tex: stamp-doc-xml
131 -if test -n "$(DSLROOT)"; then \
132 openjade -t tex -D $(DSLROOT) -d print/docbook.dsl dtds/decls/xml.dcl manual.xml; \
135 validate: stamp-doc-xml
136 xmllint --noout --noblanks --postvalid manual.xml
139 -aspell -d american --mode=sgml --encoding=utf-8 -p $(srcdir)/mutt.pwl check manual.xml.head
140 -aspell -d american --mode=nroff --encoding=utf-8 -p $(srcdir)/mutt.pwl check muttrc.man.head
141 -aspell -d american --mode=ccpp --encoding=utf-8 -p $(srcdir)/mutt.pwl check $(top_srcdir)/init.h
143 sortcheck: manual.xml
144 sed -n -e '1,/^<sect1 id="variables">/d' -e '1,/^<sect1 id="functions">/s/<sect2 id="\([^"]*\)">/\1/p' < manual.xml > vars.tmp.1
145 sort < vars.tmp.1 > vars.tmp.2
146 cmp -s vars.tmp.1 vars.tmp.2 || diff -u vars.tmp.1 vars.tmp.2 | less
147 rm -rf vars.tmp.1 vars.tmp.2
150 rm -f *~ *.html *.orig *.rej stamp-doc-* *.ps mutt.1 smime_keys.1 muttrc.man
151 rm -f *.aux *.log *.tex *.out
153 DISTCLEANFILES=manual.txt manual.html manual.xml manual.pdf html \
157 cat instdoc.sh > instdoc
160 update-doc: stamp-doc-xml stamp-doc-chunked stamp-doc-rc manual.txt manual.html
162 muttrc.man: makedoc$(EXEEXT) $(top_srcdir)/init.h muttrc.man.head muttrc.man.tail
163 $(MAKEDOC_CPP) $(top_srcdir)/init.h | ./makedoc$(EXEEXT) -m | \
164 cat $(srcdir)/muttrc.man.head - $(srcdir)/muttrc.man.tail\
167 EDIT = sed -e 's,@sysconfdir\@,$(sysconfdir),g' \
168 -e 's,@bindir\@,$(bindir),g' \
169 -e 's,@docdir\@,$(docdir),g'
171 mutt.1: $(srcdir)/mutt.man
172 $(EDIT) $(srcdir)/mutt.man > $@
174 smime_keys.1: $(srcdir)/smime_keys.man
175 $(EDIT) $(srcdir)/smime_keys.man > $@
177 stamp-doc-xml: makedoc$(EXEEXT) $(top_srcdir)/init.h \
178 manual.xml.head $(top_srcdir)/functions.h $(top_srcdir)/OPS* manual.xml.tail \
179 $(srcdir)/gen-map-doc $(top_srcdir)/VERSION $(top_srcdir)/ChangeLog
180 ( date=`head -n 1 $(top_srcdir)/ChangeLog | LC_ALL=C cut -d ' ' -f 1` && \
181 sed -e "s/@VERSION\@/`cat $(top_srcdir)/VERSION` ($$date)/" $(srcdir)/manual.xml.head && \
182 $(MAKEDOC_CPP) $(top_srcdir)/init.h | ./makedoc$(EXEEXT) -s && \
183 $(MAKEDOC_CPP) $(top_srcdir)/functions.h | \
184 perl $(srcdir)/gen-map-doc $(srcdir)/manual.xml.tail $(top_srcdir)/OPS* \