1 # Makefile for GNU tar documentation.
3 # Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2006,
4 # 2007 Free Software Foundation, Inc.
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)
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.
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.
20 info_TEXINFOS = tar.texi
23 tar-snapshot-edit.texi\
34 EXTRA_DIST = gendocs_template mastermenu.el texify.sed untabify.el
36 # The rendering level is anyone of PUBLISH, DISTRIB or PROOF.
37 # Just call `make RENDITION=PROOF [target]' if you want PROOF rendition.
40 MAKEINFOFLAGS=-D$(RENDITION)
42 header.texi: $(top_srcdir)/src/tar.h
43 sed -f $(srcdir)/texify.sed $(top_srcdir)/src/tar.h \
46 master-menu: $(tar_TEXINFOS)
47 emacs -batch -l mastermenu.el -f make-master-menu $(info_TEXINFOS)
50 emacs -batch -l untabify.el $(info_TEXINFOS) $(tar_TEXINFOS)
52 final: untabify master-menu
56 @if test -n "`cat $(info_TEXINFOS) $(tar_TEXINFOS) | tr -d -c '\t'`"; then \
57 echo "Sources contain tabs; run make untabify"; \
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 - \
67 sed -n '/^@macro/,/^@end macro/d;s/@opindex *\([^@,]*\).*/\1/p' \
68 | sort | uniq > docs.$$$$;\
70 join -v1 opts.$$$$ docs.$$$$ > report.$$$$;\
71 if test -s report.$$$$; then \
72 echo 'Not documented options:'; \
76 join -v2 opts.$$$$ docs.$$$$ > report.$$$$;\
77 if test -s report.$$$$; then \
78 echo 'Non-existing options:';\
82 rm opts.$$$$ docs.$$$$ report.$$$$;\
83 test $$status -ne 0 && exit $$status
86 @for file in $(info_TEXINFOS) $(tar_TEXINFOS); \
89 sed -n 'N;/@FIXME-.*ref/{s/\(^[0-9][0-9]*\).*@FIXME-.*ref{\([^}]*\).*/'$$file':\1: \2/gp}'; \
91 if [ -s $@-t ]; then \
92 echo "Unresolved cross-references:"; \
100 @for file in $(info_TEXINFOS); \
103 sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/'$$file':\1: \2/gp}'; \
105 if [ -s $@-t ]; then \
106 echo "Unresolved FIXMEs:"; \
115 @grep -Hn @UNREVISED $(info_TEXINFOS) > $@-t; \
116 if [ -s $@-t ]; then \
117 echo "Unrevised nodes:"; \
125 all-check-docs: check-format check-options check-refs check-fixmes check-unrevised
128 $(MAKE) -k all-check-docs
137 TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
139 # Make sure you set TEXINPUTS
141 # /usr/share/texmf/pdftex/plain/misc:/usr/share/texmf/pdftex/config
143 TEXINPUTS=$(srcdir):$(top_srcdir)/build-tex:$(TEXINPUTS) \
144 MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
145 TEXI2DVI="$(TEXI2DVI) -t @finalout" \
146 $(GENDOCS) --texi2html tar 'GNU tar manual'