ac5b400bf8f65a07c7c9bfcc374e6e46834ff72f
[platform/upstream/coreutils.git] / doc / Makefile.am
1 ## Process this file with automake to produce Makefile.in -*-Makefile-*-
2 info_TEXINFOS = coreutils.texi
3
4 EXTRA_DIST = perm.texi getdate.texi constants.texi doclicense.texi
5
6 # The following is necessary if the package name is 8 characters or longer.
7 # If the info documentation would be split into 10 or more separate files,
8 # then this is necessary even if the package name is 7 characters long.
9 #
10 # Tell makeinfo to put everything in a single info file: <package>.info.
11 # Otherwise, it would also generate files with names like <package>.info-[123],
12 # and those names all map to one 14-byte name (<package>.info-) on some crufty
13 # old systems.
14 AM_MAKEINFOFLAGS = --no-split
15
16 constants.texi: $(top_srcdir)/src/tail.c
17         LC_ALL=C \
18         sed -n -e 's/^#define \(DEFAULT_MAX[_A-Z]*\) \(.*\)/@set \1 \2/p' \
19           $(top_srcdir)/src/tail.c > t-$@
20         mv t-$@ $@
21
22 MAINTAINERCLEANFILES = constants.texi
23
24 $(DVIS): $(EXTRA_DIST)
25 $(INFO_DEPS): $(EXTRA_DIST)
26
27 # Extended regular expressions to match word starts and ends.
28 _W = (^|[^A-Za-z0-9_])
29 W_ = ([^A-Za-z0-9_]|$$)
30
31 # List words/regexps here that should not appear in the texinfo documentation.
32 # E.g., use @sc{nul}, not `NUL'
33 # Use `time zone', not `timezone'.
34 # Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent).
35 check-texinfo:
36         fail=0; \
37         grep timezone $(srcdir)/*.texi && fail=1; \
38         $(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && fail=1; \
39         grep non-zero $(srcdir)/*.texi && fail=1; \
40         grep '@url{' $(srcdir)/*.texi && fail=1; \
41         $(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && fail=1; \
42         grep '\$$@"' $(srcdir)/*.texi && fail=1; \
43         grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \
44         grep -n filename $(srcdir)/*.texi|$(EGREP) -v 'setfilename|[{]filename[}]' \
45           && fail=1; \
46         $(PERL) -e 1 2> /dev/null && { $(PERL) -ne \
47           '/\bPOSIX\b/ && !/\@acronym{POSIX}/ && !/^\* / || /{posix}/ and print,exit 1' \
48           $(srcdir)/*.texi 2> /dev/null || fail=1; }; \
49         $(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && fail=1; \
50         $(EGREP) -i '$(_W)builtins?$(W_)' $(srcdir)/*.texi && fail=1; \
51         $(EGREP) -i '$(_W)path(name)?s?$(W_)' $(srcdir)/*.texi \
52           | $(EGREP) -v '@vindex PATH$$|@env[{]PATH[}]' && fail=1; \
53         exit $$fail
54
55 check: check-texinfo