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 \
16 applying-patches.txt \
28 Muttrc Muttrc.head stamp-doc-rc \
29 makedoc.c makedoc-defs.h \
30 mutt.css mutt.xsl html.xsl chunk.xsl $(BUILT_DISTFILES)
32 CHUNKED_DOCFILES = index.html intro.html gettingstarted.html \
33 configuration.html mimesupport.html advancedusage.html \
34 optionalfeatures.html security.html tuning.html reference.html miscellany.html
36 HTML_DOCFILES = manual.html $(CHUNKED_DOCFILES)
38 BUILT_DISTFILES = stamp-doc-xml stamp-doc-chunked manual.txt $(HTML_DOCFILES)
40 srcdir_DOCFILES = PGP-Notes.txt applying-patches.txt \
41 devel-notes.txt patch-notes.txt smime-notes.txt
43 topsrcdir_DOCFILES = COPYRIGHT GPL INSTALL ChangeLog \
44 README NEWS TODO README.SECURITY README.SSL
48 makedoc-all: mutt.1 muttrc.man manual.html stamp-doc-rc stamp-doc-chunked manual.txt
50 install-data-local: makedoc-all instdoc
51 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1
52 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man5
53 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir)
54 ./instdoc mutt.1 $(DESTDIR)$(mandir)/man1/mutt.1
55 ./instdoc $(srcdir)/muttbug.man $(DESTDIR)$(mandir)/man1/flea.1
56 ./instdoc $(srcdir)/muttbug.man $(DESTDIR)$(mandir)/man1/muttbug.1
57 test x@DOTLOCK_TARGET@ = x || ./instdoc $(srcdir)/dotlock.man \
58 $(DESTDIR)$(mandir)/man1/mutt_dotlock.1
59 ./instdoc muttrc.man $(DESTDIR)$(mandir)/man5/muttrc.5
60 ./instdoc $(srcdir)/mbox.man $(DESTDIR)$(mandir)/man5/mbox.5
61 ./instdoc $(srcdir)/mmdf.man $(DESTDIR)$(mandir)/man5/mmdf.5
62 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(docdir)
63 for f in $(topsrcdir_DOCFILES) ; do \
64 $(INSTALL) -m 644 $(top_srcdir)/$$f $(DESTDIR)$(docdir) ; \
66 for f in $(srcdir_DOCFILES) ; do \
67 $(INSTALL) -m 644 $(srcdir)/$$f $(DESTDIR)$(docdir) ; \
69 -$(INSTALL) -m 644 manual.txt $(DESTDIR)$(docdir)
70 -for f in $(HTML_DOCFILES) ; do \
71 $(INSTALL) -m 644 $$f $(DESTDIR)$(docdir) ; \
73 $(INSTALL) -m 644 Muttrc $(DESTDIR)$(sysconfdir)/Muttrc.dist
74 -if [ -f $(DESTDIR)$(pkgdatadir)/Muttrc ] ; then \
75 mv $(DESTDIR)$(pkgdatadir)/Muttrc* $(DESTDIR)$(sysconfdir) ; \
76 elif [ -f $(DESTDIR)$(pkgdatadir)/../Muttrc ] ; then \
77 mv $(DESTDIR)$(pkgdatadir)/../Muttrc* $(DESTDIR)$(sysconfdir) ; \
78 elif [ ! -f $(DESTDIR)$(sysconfdir)/Muttrc ] ; then \
79 $(INSTALL) -m 644 Muttrc $(DESTDIR)$(sysconfdir) ; \
83 for f in mutt.1 mutt_dotlock.1 flea.1 muttbug.1 ; do \
84 rm -f $(DESTDIR)$(mandir)/man1/$$f ; \
86 for f in muttrc.5 mbox.5 mmdf.5 ; do \
87 rm -f $(DESTDIR)$(mandir)/man5/$$f ; \
89 for f in $(srcdir_DOCFILES) $(topsrcdir_DOCFILES) $(HTML_DOCFILES) ; \
91 rm -f $(DESTDIR)$(docdir)/$$f ; \
93 -rm -f $(DESTDIR)$(docdir)/manual.txt
94 for i in Muttrc ; do \
95 if cmp -s $(DESTDIR)$(sysconfdir)/$$i.dist $(DESTDIR)$(sysconfdir)/$$i ; then \
96 rm $(DESTDIR)$(sysconfdir)/$$i ; \
98 rm $(DESTDIR)$(sysconfdir)/$${i}.dist ; \
102 manual.txt: manual.html
103 -LC_ALL=C lynx -dump -nolist -with_backspaces manual.html > $@ || \
104 LC_ALL=C w3m -dump manual.html > $@ || \
105 LC_ALL=C elinks -dump -no-numbering -no-references manual.html | sed -e 's,\\001, ,g' > $@
109 stamp-doc-rc: $(top_srcdir)/init.h makedoc$(EXEEXT) $(srcdir)/Muttrc.head
110 -rm -f Muttrc stamp-doc-rc
111 sed -e 's,[@]docdir[@],$(docdir),' $(srcdir)/Muttrc.head > Muttrc
112 $(CPP) $(AM_CPPFLAGS) $(DEFS) $(CPPFLAGS) -D_MAKEDOC -C \
113 $(top_srcdir)/init.h | ./makedoc$(EXEEXT) -c >> Muttrc
116 manual.html: $(srcdir)/html.xsl $(srcdir)/mutt.xsl stamp-doc-xml $(srcdir)/mutt.css
117 -xsltproc --nonet -o $@ $(srcdir)/html.xsl manual.xml
119 stamp-doc-chunked: $(srcdir)/chunk.xsl $(srcdir)/mutt.xsl stamp-doc-xml $(srcdir)/mutt.css
120 -xsltproc --nonet $(srcdir)/chunk.xsl manual.xml
121 touch stamp-doc-chunked
123 $(CHUNKED_DOCFILES): stamp-doc-chunked
125 manual.pdf: manual.tex
126 -if test -f manual.tex; then pdfjadetex manual.tex; fi
128 manual.tex: stamp-doc-xml
129 -if test -n "$(DSLROOT)"; then \
130 openjade -t tex -D $(DSLROOT) -d print/docbook.dsl dtds/decls/xml.dcl manual.xml; \
133 validate: stamp-doc-xml
134 xmllint --noout --noblanks --postvalid manual.xml
137 -aspell -l en --mode sgml -c manual.xml.head && \
138 -aspell -l en --mode nroff -c muttrc.man.head
140 sortcheck: manual.xml
141 sed -n -e '1,/^<sect1 id="variables">/d' -e '1,/^<sect1 id="functions">/s/<sect2 id="\([^"]*\)">/\1/p' < manual.xml > vars.tmp.1
142 sort < vars.tmp.1 > vars.tmp.2
143 cmp -s vars.tmp.1 vars.tmp.2 || diff -u vars.tmp.1 vars.tmp.2 | less
144 rm -rf vars.tmp.1 vars.tmp.2
147 rm -f *~ *.html *.orig *.rej stamp-doc-* *.ps mutt.1 muttrc.man
148 rm -f *.aux *.log *.tex *.out
150 DISTCLEANFILES=manual.txt manual.html manual.xml manual.pdf html \
154 cat instdoc.sh > instdoc
157 update-doc: stamp-doc-xml stamp-doc-chunked stamp-doc-rc manual.txt manual.html
159 muttrc.man: makedoc$(EXEEXT) $(top_srcdir)/init.h muttrc.man.head muttrc.man.tail
160 $(MAKEDOC_CPP) $(top_srcdir)/init.h | ./makedoc$(EXEEXT) -m | \
161 cat $(srcdir)/muttrc.man.head - $(srcdir)/muttrc.man.tail\
164 EDIT = sed -e 's,@sysconfdir\@,$(sysconfdir),g' \
165 -e 's,@bindir\@,$(bindir),g' \
166 -e 's,@docdir\@,$(docdir),g'
168 mutt.1: $(srcdir)/mutt.man
169 $(EDIT) $(srcdir)/mutt.man > $@
171 stamp-doc-xml: makedoc$(EXEEXT) $(top_srcdir)/init.h \
172 manual.xml.head $(top_srcdir)/functions.h $(top_srcdir)/OPS* manual.xml.tail \
173 $(srcdir)/gen-map-doc $(top_srcdir)/VERSION $(top_srcdir)/ChangeLog
174 ( date=`head -n 1 $(top_srcdir)/ChangeLog | LC_ALL=C cut -d ' ' -f 1` && \
175 sed -e "s/@VERSION\@/`cat $(top_srcdir)/VERSION` ($$date)/" $(srcdir)/manual.xml.head && \
176 $(MAKEDOC_CPP) $(top_srcdir)/init.h | ./makedoc$(EXEEXT) -s && \
177 $(MAKEDOC_CPP) $(top_srcdir)/functions.h | \
178 perl $(srcdir)/gen-map-doc $(srcdir)/manual.xml.tail $(top_srcdir)/OPS* \