1 # Makefile for GNU tar documentation.
3 # Copyright 1994-1997, 1999-2001, 2003, 2006-2007, 2013-2014 Free
4 # Software Foundation, Inc.
6 # This file is part of GNU tar.
8 # GNU tar is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # GNU tar is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 info_TEXINFOS = tar.texi
24 tar-snapshot-edit.texi\
36 dist_man_MANS=tar.1 $(RMT_8)
41 EXTRA_DIST = gendocs_template mastermenu.el texify.sed untabify.el rmt.8
43 # The rendering level is anyone of PUBLISH, DISTRIB or PROOF.
44 # Just call 'make RENDITION=PROOF [target]' if you want PROOF rendition.
47 MAKEINFOFLAGS=-D$(RENDITION)
49 header.texi: $(top_srcdir)/src/tar.h
50 sed -f $(srcdir)/texify.sed $(top_srcdir)/src/tar.h \
53 master-menu: $(tar_TEXINFOS)
54 emacs -batch -l mastermenu.el -f make-master-menu $(info_TEXINFOS)
57 emacs -batch -l untabify.el $(info_TEXINFOS) $(tar_TEXINFOS)
59 final: untabify master-menu
63 @if test -n "`cat $(info_TEXINFOS) $(tar_TEXINFOS) | tr -d -c '\t'`"; then \
64 echo "Sources contain tabs; run make untabify"; \
69 @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' \
70 $(top_builddir)/src/tar --usage | \
71 sed -n 's/^\[--\([^]\=\[]*\).*/\1/p' | sort | uniq > opts.$$$$;\
72 $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
74 sed -n '/^@macro/,/^@end macro/d;s/@opindex *\([^@,]*\).*/\1/p' \
75 | sort | uniq > docs.$$$$;\
77 join -v1 opts.$$$$ docs.$$$$ > report.$$$$;\
78 if test -s report.$$$$; then \
79 echo 'Not documented options:'; \
83 join -v2 opts.$$$$ docs.$$$$ > report.$$$$;\
84 if test -s report.$$$$; then \
85 echo 'Non-existing options:';\
89 rm opts.$$$$ docs.$$$$ report.$$$$;\
90 test $$status -ne 0 && exit $$status
93 @for file in $(info_TEXINFOS) $(tar_TEXINFOS); \
96 sed -n 'N;/@FIXME-.*ref/{s/\(^[0-9][0-9]*\).*@FIXME-.*ref{\([^}]*\).*/'$$file':\1: \2/gp}'; \
98 if [ -s $@-t ]; then \
99 echo "Unresolved cross-references:"; \
107 @for file in $(info_TEXINFOS); \
110 sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/'$$file':\1: \2/gp}'; \
112 if [ -s $@-t ]; then \
113 echo "Unresolved FIXMEs:"; \
122 @grep -Hn @UNREVISED $(info_TEXINFOS) > $@-t; \
123 if [ -s $@-t ]; then \
124 echo "Unrevised nodes:"; \
132 all-check-docs: check-format check-options check-refs check-fixmes check-unrevised
135 $(MAKE) -k all-check-docs
144 TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
146 # Make sure you set TEXINPUTS
148 # /usr/share/texmf/pdftex/plain/misc:/usr/share/texmf/pdftex/config
150 TEXINPUTS=$(srcdir):$(top_srcdir)/build-tex:$(TEXINPUTS) \
151 MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
152 TEXI2DVI="$(TEXI2DVI) -t @finalout" \
153 $(GENDOCS) --texi2html tar 'GNU tar manual'