]> git.cworth.org Git - tar/blob - doc/Makefile.am
Imported Upstream version 1.20
[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  getdate.texi\
28  header.texi\
29  intern.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,\
63 doc-opt-col=0,opt-doc-col=0,header-col=0,rmargin=1' \
64         $(top_builddir)/src/tar --usage | \
65         sed -n 's/^\[--\([^]\=\[]*\).*/\1/p' | sort | uniq > opts.$$$$;\
66         $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
67             $(info_TEXINFOS) | \
68         sed -n '/^@macro/,/^@end macro/d;s/@opindex *\([^@,]*\).*/\1/p' \
69              | sort | uniq > docs.$$$$;\
70         (echo 'Not documented options:';\
71          join -v1 opts.$$$$ docs.$$$$;\
72          echo 'Non-existing options:';\
73          join -v2 opts.$$$$ docs.$$$$) > report.$$$$;\
74          rm opts.$$$$ docs.$$$$;\
75          if [ -n "`sed '1,2d' report.$$$$`" ]; then \
76            cat report.$$$$;\
77            rm report.$$$$;\
78            exit 1;\
79          fi;\
80          rm report.$$$$
81
82 check-refs:
83         @for file in $(info_TEXINFOS) $(tar_TEXINFOS); \
84         do \
85           sed -e = $$file | \
86            sed -n 'N;/@FIXME-.*ref/{s/\(^[0-9][0-9]*\).*@FIXME-.*ref{\([^}]*\).*/'$$file':\1: \2/gp}'; \
87         done > $@-t; \
88         if [ -s $@-t ]; then \
89           echo "Unresolved cross-references:"; \
90           cat $@-t;\
91           rm $@-t; \
92         else \
93           rm -f $@-t; \
94         fi
95
96 check-fixmes:
97         @for file in $(info_TEXINFOS); \
98         do \
99           sed -e = $$file | \
100            sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/'$$file':\1: \2/gp}'; \
101         done > $@-t; \
102         if [ -s $@-t ]; then \
103           echo "Unresolved FIXMEs:"; \
104           cat $@-t; \
105           rm $@-t; \
106           false; \
107         else \
108           rm -f $@-t; \
109         fi
110
111 check-unrevised:
112         @grep -Hn @UNREVISED $(info_TEXINFOS) > $@-t; \
113         if [ -s $@-t ]; then \
114           echo "Unrevised nodes:"; \
115           cat $@-t; \
116           rm $@-t; \
117           false;\
118         else \
119           rm $@-t; \
120         fi
121
122 all-check-docs: check-format check-options check-refs check-fixmes check-unrevised
123
124 check-docs: 
125         $(MAKE) -k all-check-docs
126
127 #
128
129 clean-local:
130         rm -rf manual
131
132 GENDOCS=gendocs.sh
133
134 TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
135
136 # Make sure you set TEXINPUTS
137 # Usual value is:
138 # /usr/share/texmf/pdftex/plain/misc:/usr/share/texmf/pdftex/config
139 manual:
140         TEXINPUTS=$(srcdir):$(top_srcdir)/build-tex:$(TEXINPUTS) \
141          MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
142          TEXI2DVI="$(TEXI2DVI) -t @finalout" \
143         $(GENDOCS) --texi2html tar 'GNU tar manual'
144