]> git.cworth.org Git - tar/blob - doc/Makefile.am
Imported Upstream version 1.24
[tar] / doc / Makefile.am
1 # Makefile for GNU tar documentation.
2
3 # Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2006,
4 # 2007 Free Software Foundation, Inc.
5
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 3, or (at your option)
9 ## any later version.
10
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
15
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software Foundation,
18 ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
20 info_TEXINFOS = tar.texi
21 tar_TEXINFOS = \
22  dumpdir.texi\
23  tar-snapshot-edit.texi\
24  fdl.texi\
25  freemanuals.texi\
26  genfile.texi\
27  header.texi\
28  intern.texi\
29  parse-datetime.texi\
30  rendition.texi\
31  snapshot.texi\
32  sparse.texi\
33  value.texi
34 EXTRA_DIST = gendocs_template mastermenu.el texify.sed untabify.el
35
36 # The rendering level is anyone of PUBLISH, DISTRIB or PROOF.
37 # Just call `make RENDITION=PROOF [target]' if you want PROOF rendition.
38 RENDITION = DISTRIB
39
40 MAKEINFOFLAGS=-D$(RENDITION)
41
42 header.texi: $(top_srcdir)/src/tar.h
43         sed -f $(srcdir)/texify.sed $(top_srcdir)/src/tar.h \
44           | expand >$@
45
46 master-menu: $(tar_TEXINFOS)
47         emacs -batch -l mastermenu.el -f make-master-menu $(info_TEXINFOS)
48
49 untabify:
50         emacs -batch -l untabify.el $(info_TEXINFOS) $(tar_TEXINFOS)
51
52 final: untabify master-menu
53
54 # Checking
55 check-format:
56         @if test -n "`cat $(info_TEXINFOS) $(tar_TEXINFOS) | tr -d -c '\t'`"; then \
57                 echo "Sources contain tabs; run make untabify"; \
58                 false; \
59         fi
60
61 check-options:
62         @ARGP_HELP_FMT='usage-indent=0,short-opt-col=0,long-opt-col=0,doc-opt-col=0,opt-doc-col=0,header-col=0,rmargin=1' \
63         $(top_builddir)/src/tar --usage | \
64         sed -n 's/^\[--\([^]\=\[]*\).*/\1/p' | sort | uniq > opts.$$$$;\
65         $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
66             $(info_TEXINFOS) | \
67         sed -n '/^@macro/,/^@end macro/d;s/@opindex *\([^@,]*\).*/\1/p' \
68              | sort | uniq > docs.$$$$;\
69         status=0;\
70         join -v1 opts.$$$$ docs.$$$$ > report.$$$$;\
71         if test -s report.$$$$; then \
72           echo 'Not documented options:'; \
73           cat report.$$$$; \
74           status=1; \
75         fi; \
76         join -v2 opts.$$$$ docs.$$$$ > report.$$$$;\
77         if test -s report.$$$$; then \
78           echo 'Non-existing options:';\
79           cat report.$$$$; \
80           status=1; \
81         fi; \
82         rm opts.$$$$ docs.$$$$ report.$$$$;\
83         test $$status -ne 0 && exit $$status
84
85 check-refs:
86         @for file in $(info_TEXINFOS) $(tar_TEXINFOS); \
87         do \
88           sed -e = $$file | \
89            sed -n 'N;/@FIXME-.*ref/{s/\(^[0-9][0-9]*\).*@FIXME-.*ref{\([^}]*\).*/'$$file':\1: \2/gp}'; \
90         done > $@-t; \
91         if [ -s $@-t ]; then \
92           echo "Unresolved cross-references:"; \
93           cat $@-t;\
94           rm $@-t; \
95         else \
96           rm -f $@-t; \
97         fi
98
99 check-fixmes:
100         @for file in $(info_TEXINFOS); \
101         do \
102           sed -e = $$file | \
103            sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/'$$file':\1: \2/gp}'; \
104         done > $@-t; \
105         if [ -s $@-t ]; then \
106           echo "Unresolved FIXMEs:"; \
107           cat $@-t; \
108           rm $@-t; \
109           false; \
110         else \
111           rm -f $@-t; \
112         fi
113
114 check-unrevised:
115         @grep -Hn @UNREVISED $(info_TEXINFOS) > $@-t; \
116         if [ -s $@-t ]; then \
117           echo "Unrevised nodes:"; \
118           cat $@-t; \
119           rm $@-t; \
120           false;\
121         else \
122           rm $@-t; \
123         fi
124
125 all-check-docs: check-format check-options check-refs check-fixmes check-unrevised
126
127 check-docs:
128         $(MAKE) -k all-check-docs
129
130 #
131
132 clean-local:
133         rm -rf manual
134
135 GENDOCS=gendocs.sh
136
137 TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
138
139 # Make sure you set TEXINPUTS
140 # Usual value is:
141 # /usr/share/texmf/pdftex/plain/misc:/usr/share/texmf/pdftex/config
142 manual:
143         TEXINPUTS=$(srcdir):$(top_srcdir)/build-tex:$(TEXINPUTS) \
144          MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
145          TEXI2DVI="$(TEXI2DVI) -t @finalout" \
146         $(GENDOCS) --texi2html tar 'GNU tar manual'