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