stat,tail: support "AAFS" AppArmor file system
[coreutils.git] / man / local.mk
blob4b98bfd0824e6de28cf49cd6aa135b2e384053a6
1 # Make coreutils man pages. -*-Makefile-*-
2 # This is included by the top-level Makefile.am.
4 # Copyright (C) 2002-2017 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 of the License, or
9 # (at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
19 EXTRA_DIST += man/help2man man/dummy-man
21 ## Graceful degradation for systems lacking perl.
22 if HAVE_PERL
23 run_help2man = $(PERL) -- $(srcdir)/man/help2man
24 else
25 run_help2man = $(SHELL) $(srcdir)/man/dummy-man
26 endif
28 man1_MANS = @man1_MANS@
29 EXTRA_DIST += $(man1_MANS:.1=.x)
31 EXTRA_MANS = @EXTRA_MANS@
32 EXTRA_DIST += $(EXTRA_MANS:.1=.x)
34 ALL_MANS = $(man1_MANS) $(EXTRA_MANS)
36 CLEANFILES += $(ALL_MANS)
38 # This is a kludge to remove generated 'man/*.1' from a non-srcdir build.
39 # Without this, "make distcheck" might fail.
40 distclean-local:
41 test x$(srcdir) = x$(builddir) || rm -f $(ALL_MANS)
43 # Dependencies common to all man pages. Updated below.
44 mandeps =
46 # Depend on this to get version number changes.
47 mandeps += .version
49 # This is required so that changes to e.g., emit_bug_reporting_address
50 # provoke regeneration of all the manpages.
51 mandeps += $(top_srcdir)/src/system.h
53 $(ALL_MANS): $(mandeps)
55 if SINGLE_BINARY
56 mandeps += src/coreutils$(EXEEXT)
57 else
58 # Most prog.1 man pages depend on src/prog. List the exceptions:
59 man/install.1: src/ginstall$(EXEEXT)
60 man/test.1: src/[$(EXEEXT)
62 man/arch.1: src/arch$(EXEEXT)
63 man/b2sum.1: src/b2sum$(EXEEXT)
64 man/base32.1: src/base32$(EXEEXT)
65 man/base64.1: src/base64$(EXEEXT)
66 man/basename.1: src/basename$(EXEEXT)
67 man/cat.1: src/cat$(EXEEXT)
68 man/chcon.1: src/chcon$(EXEEXT)
69 man/chgrp.1: src/chgrp$(EXEEXT)
70 man/chmod.1: src/chmod$(EXEEXT)
71 man/chown.1: src/chown$(EXEEXT)
72 man/chroot.1: src/chroot$(EXEEXT)
73 man/cksum.1: src/cksum$(EXEEXT)
74 man/comm.1: src/comm$(EXEEXT)
75 man/coreutils.1: src/coreutils$(EXEEXT)
76 man/cp.1: src/cp$(EXEEXT)
77 man/csplit.1: src/csplit$(EXEEXT)
78 man/cut.1: src/cut$(EXEEXT)
79 man/date.1: src/date$(EXEEXT)
80 man/dd.1: src/dd$(EXEEXT)
81 man/df.1: src/df$(EXEEXT)
82 man/dir.1: src/dir$(EXEEXT)
83 man/dircolors.1: src/dircolors$(EXEEXT)
84 man/dirname.1: src/dirname$(EXEEXT)
85 man/du.1: src/du$(EXEEXT)
86 man/echo.1: src/echo$(EXEEXT)
87 man/env.1: src/env$(EXEEXT)
88 man/expand.1: src/expand$(EXEEXT)
89 man/expr.1: src/expr$(EXEEXT)
90 man/factor.1: src/factor$(EXEEXT)
91 man/false.1: src/false$(EXEEXT)
92 man/fmt.1: src/fmt$(EXEEXT)
93 man/fold.1: src/fold$(EXEEXT)
94 man/groups.1: src/groups$(EXEEXT)
95 man/head.1: src/head$(EXEEXT)
96 man/hostid.1: src/hostid$(EXEEXT)
97 man/hostname.1: src/hostname$(EXEEXT)
98 man/id.1: src/id$(EXEEXT)
99 man/join.1: src/join$(EXEEXT)
100 man/kill.1: src/kill$(EXEEXT)
101 man/link.1: src/link$(EXEEXT)
102 man/ln.1: src/ln$(EXEEXT)
103 man/logname.1: src/logname$(EXEEXT)
104 man/ls.1: src/ls$(EXEEXT)
105 man/md5sum.1: src/md5sum$(EXEEXT)
106 man/mkdir.1: src/mkdir$(EXEEXT)
107 man/mkfifo.1: src/mkfifo$(EXEEXT)
108 man/mknod.1: src/mknod$(EXEEXT)
109 man/mktemp.1: src/mktemp$(EXEEXT)
110 man/mv.1: src/mv$(EXEEXT)
111 man/nice.1: src/nice$(EXEEXT)
112 man/nl.1: src/nl$(EXEEXT)
113 man/nohup.1: src/nohup$(EXEEXT)
114 man/nproc.1: src/nproc$(EXEEXT)
115 man/numfmt.1: src/numfmt$(EXEEXT)
116 man/od.1: src/od$(EXEEXT)
117 man/paste.1: src/paste$(EXEEXT)
118 man/pathchk.1: src/pathchk$(EXEEXT)
119 man/pinky.1: src/pinky$(EXEEXT)
120 man/pr.1: src/pr$(EXEEXT)
121 man/printenv.1: src/printenv$(EXEEXT)
122 man/printf.1: src/printf$(EXEEXT)
123 man/ptx.1: src/ptx$(EXEEXT)
124 man/pwd.1: src/pwd$(EXEEXT)
125 man/readlink.1: src/readlink$(EXEEXT)
126 man/realpath.1: src/realpath$(EXEEXT)
127 man/rm.1: src/rm$(EXEEXT)
128 man/rmdir.1: src/rmdir$(EXEEXT)
129 man/runcon.1: src/runcon$(EXEEXT)
130 man/seq.1: src/seq$(EXEEXT)
131 man/sha1sum.1: src/sha1sum$(EXEEXT)
132 man/sha224sum.1: src/sha224sum$(EXEEXT)
133 man/sha256sum.1: src/sha256sum$(EXEEXT)
134 man/sha384sum.1: src/sha384sum$(EXEEXT)
135 man/sha512sum.1: src/sha512sum$(EXEEXT)
136 man/shred.1: src/shred$(EXEEXT)
137 man/shuf.1: src/shuf$(EXEEXT)
138 man/sleep.1: src/sleep$(EXEEXT)
139 man/sort.1: src/sort$(EXEEXT)
140 man/split.1: src/split$(EXEEXT)
141 man/stat.1: src/stat$(EXEEXT)
142 man/stdbuf.1: src/stdbuf$(EXEEXT)
143 man/stty.1: src/stty$(EXEEXT)
144 man/sum.1: src/sum$(EXEEXT)
145 man/sync.1: src/sync$(EXEEXT)
146 man/tac.1: src/tac$(EXEEXT)
147 man/tail.1: src/tail$(EXEEXT)
148 man/tee.1: src/tee$(EXEEXT)
149 man/timeout.1: src/timeout$(EXEEXT)
150 man/touch.1: src/touch$(EXEEXT)
151 man/tr.1: src/tr$(EXEEXT)
152 man/true.1: src/true$(EXEEXT)
153 man/truncate.1: src/truncate$(EXEEXT)
154 man/tsort.1: src/tsort$(EXEEXT)
155 man/tty.1: src/tty$(EXEEXT)
156 man/uname.1: src/uname$(EXEEXT)
157 man/unexpand.1: src/unexpand$(EXEEXT)
158 man/uniq.1: src/uniq$(EXEEXT)
159 man/unlink.1: src/unlink$(EXEEXT)
160 man/uptime.1: src/uptime$(EXEEXT)
161 man/users.1: src/users$(EXEEXT)
162 man/vdir.1: src/vdir$(EXEEXT)
163 man/wc.1: src/wc$(EXEEXT)
164 man/who.1: src/who$(EXEEXT)
165 man/whoami.1: src/whoami$(EXEEXT)
166 man/yes.1: src/yes$(EXEEXT)
167 endif
169 .x.1:
170 $(AM_V_GEN)name=`echo $@ | sed 's|.*/||; s|\.1$$||'` || exit 1; \
171 ## Ensure that help2man runs the 'src/ginstall' binary as 'install' when
172 ## creating 'install.1'. Similarly, ensure that it uses the 'src/[' binary
173 ## to create 'test.1'.
174 case $$name in \
175 install) prog='ginstall'; argv=$$name;; \
176 test) prog='['; argv='[';; \
177 *) prog=$$name; argv=$$prog;; \
178 esac; \
179 ## Note the use of $$t/$*, rather than just '$*' as in other packages.
180 ## That is necessary to avoid failures for programs that are also shell
181 ## built-in functions like echo, false, printf, pwd.
182 rm -f $@ $@-t \
183 && t=$*.td \
184 && rm -rf $$t \
185 && $(MKDIR_P) $$t \
186 && (cd $$t && $(LN_S) '$(abs_top_builddir)/src/'$$prog$(EXEEXT) \
187 $$argv$(EXEEXT)) \
188 && : $${SOURCE_DATE_EPOCH=`cat $(srcdir)/.timestamp 2>/dev/null || :`} \
189 && export SOURCE_DATE_EPOCH && $(run_help2man) \
190 --source='$(PACKAGE_STRING)' \
191 --include=$(srcdir)/man/$$name.x \
192 --output=$$t/$$name.1 \
193 --info-page='\(aq(coreutils) '$$name' invocation\(aq' \
194 $$t/$$argv$(EXEEXT) \
195 && sed \
196 -e 's|$*\.td/||g' \
197 -e '/For complete documentation/d' \
198 $$t/$$name.1 > $@-t \
199 && rm -rf $$t \
200 && chmod a-w $@-t \
201 && mv $@-t $@