1 # Make coreutils man pages. -*-Makefile-*-
3 # Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software
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 2 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, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 base64.1 basename.1 cat.1 chgrp.1 chmod.1 chown.1 cksum.1 comm.1 \
23 cp.1 csplit.1 cut.1 date.1 dd.1 df.1 dir.1 dircolors.1 dirname.1 du.1 \
24 echo.1 env.1 expand.1 expr.1 factor.1 false.1 fmt.1 fold.1 groups.1 \
25 head.1 hostname.1 id.1 install.1 join.1 kill.1 \
26 link.1 ln.1 logname.1 \
27 ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nl.1 nohup.1 od.1 \
28 paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
29 rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \
30 shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
31 su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
32 tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
35 chroot.1 hostid.1 nice.1 pinky.1 stty.1 uname.1 uptime.1 users.1 who.1
38 man_aux = $(dist_man_MANS:.1=.x) $(optional_mans:.1=.x)
40 EXTRA_DIST = $(man_aux) help2man $(optional_mans)
41 MAINTAINERCLEANFILES = $(dist_man_MANS)
43 # Depend on configure.ac to get version number changes.
44 common_dep = $(top_srcdir)/configure.ac
46 base64.1: $(common_dep) $(srcdir)/base64.x ../src/base64.c
47 basename.1: $(common_dep) $(srcdir)/basename.x ../src/basename.c
48 cat.1: $(common_dep) $(srcdir)/cat.x ../src/cat.c
49 chgrp.1: $(common_dep) $(srcdir)/chgrp.x ../src/chgrp.c
50 chmod.1: $(common_dep) $(srcdir)/chmod.x ../src/chmod.c
51 chown.1: $(common_dep) $(srcdir)/chown.x ../src/chown.c
52 chroot.1: $(common_dep) $(srcdir)/chroot.x ../src/chroot.c
53 cksum.1: $(common_dep) $(srcdir)/cksum.x ../src/cksum.c
54 comm.1: $(common_dep) $(srcdir)/comm.x ../src/comm.c
55 cp.1: $(common_dep) $(srcdir)/cp.x ../src/cp.c
56 csplit.1: $(common_dep) $(srcdir)/csplit.x ../src/csplit.c
57 cut.1: $(common_dep) $(srcdir)/cut.x ../src/cut.c
58 date.1: $(common_dep) $(srcdir)/date.x ../src/date.c
59 dd.1: $(common_dep) $(srcdir)/dd.x ../src/dd.c
60 df.1: $(common_dep) $(srcdir)/df.x ../src/df.c
62 # Note that dir depends on ls.c, since that's where it's --help text is.
63 dir.1: $(common_dep) $(srcdir)/dir.x ../src/ls.c
65 dircolors.1: $(common_dep) $(srcdir)/dircolors.x ../src/dircolors.c
66 dirname.1: $(common_dep) $(srcdir)/dirname.x ../src/dirname.c
67 du.1: $(common_dep) $(srcdir)/du.x ../src/du.c
68 echo.1: $(common_dep) $(srcdir)/echo.x ../src/echo.c
69 env.1: $(common_dep) $(srcdir)/env.x ../src/env.c
70 expand.1: $(common_dep) $(srcdir)/expand.x ../src/expand.c
71 expr.1: $(common_dep) $(srcdir)/expr.x ../src/expr.c
72 factor.1: $(common_dep) $(srcdir)/factor.x ../src/factor.c
73 false.1: $(common_dep) $(srcdir)/false.x ../src/false.c
74 fmt.1: $(common_dep) $(srcdir)/fmt.x ../src/fmt.c
75 fold.1: $(common_dep) $(srcdir)/fold.x ../src/fold.c
76 groups.1: $(common_dep) $(srcdir)/groups.x ../src/groups.sh
77 head.1: $(common_dep) $(srcdir)/head.x ../src/head.c
78 hostid.1: $(common_dep) $(srcdir)/hostid.x ../src/hostid.c
79 hostname.1: $(common_dep) $(srcdir)/hostname.x ../src/hostname.c
80 id.1: $(common_dep) $(srcdir)/id.x ../src/id.c
81 install.1: $(common_dep) $(srcdir)/install.x ../src/install.c
82 join.1: $(common_dep) $(srcdir)/join.x ../src/join.c
83 kill.1: $(common_dep) $(srcdir)/kill.x ../src/kill.c
84 link.1: $(common_dep) $(srcdir)/link.x ../src/link.c
85 ln.1: $(common_dep) $(srcdir)/ln.x ../src/ln.c
86 logname.1: $(common_dep) $(srcdir)/logname.x ../src/logname.c
87 ls.1: $(common_dep) $(srcdir)/ls.x ../src/ls.c
88 md5sum.1: $(common_dep) $(srcdir)/md5sum.x ../src/md5sum.c
89 mkdir.1: $(common_dep) $(srcdir)/mkdir.x ../src/mkdir.c
90 mkfifo.1: $(common_dep) $(srcdir)/mkfifo.x ../src/mkfifo.c
91 mknod.1: $(common_dep) $(srcdir)/mknod.x ../src/mknod.c
92 mv.1: $(common_dep) $(srcdir)/mv.x ../src/mv.c
93 nice.1: $(common_dep) $(srcdir)/nice.x ../src/nice.c
94 nl.1: $(common_dep) $(srcdir)/nl.x ../src/nl.c
95 nohup.1: $(common_dep) $(srcdir)/nohup.x ../src/nohup.c
96 od.1: $(common_dep) $(srcdir)/od.x ../src/od.c
97 paste.1: $(common_dep) $(srcdir)/paste.x ../src/paste.c
98 pathchk.1: $(common_dep) $(srcdir)/pathchk.x ../src/pathchk.c
99 pinky.1: $(common_dep) $(srcdir)/pinky.x ../src/pinky.c
100 pr.1: $(common_dep) $(srcdir)/pr.x ../src/pr.c
101 printenv.1: $(common_dep) $(srcdir)/printenv.x ../src/printenv.c
102 printf.1: $(common_dep) $(srcdir)/printf.x ../src/printf.c
103 ptx.1: $(common_dep) $(srcdir)/ptx.x ../src/ptx.c
104 pwd.1: $(common_dep) $(srcdir)/pwd.x ../src/pwd.c
105 readlink.1: $(common_dep) $(srcdir)/readlink.x ../src/readlink.c
106 rm.1: $(common_dep) $(srcdir)/rm.x ../src/rm.c
107 rmdir.1: $(common_dep) $(srcdir)/rmdir.x ../src/rmdir.c
108 seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c
109 sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c
110 sha224sum.1: $(common_dep) $(srcdir)/sha224sum.x ../src/md5sum.c
111 sha256sum.1: $(common_dep) $(srcdir)/sha256sum.x ../src/md5sum.c
112 sha384sum.1: $(common_dep) $(srcdir)/sha384sum.x ../src/md5sum.c
113 sha512sum.1: $(common_dep) $(srcdir)/sha512sum.x ../src/md5sum.c
114 shred.1: $(common_dep) $(srcdir)/shred.x ../src/shred.c
115 shuf.1: $(common_dep) $(srcdir)/shuf.x ../src/shuf.c
116 sleep.1: $(common_dep) $(srcdir)/sleep.x ../src/sleep.c
117 sort.1: $(common_dep) $(srcdir)/sort.x ../src/sort.c
118 split.1: $(common_dep) $(srcdir)/split.x ../src/split.c
119 stat.1: $(common_dep) $(srcdir)/stat.x ../src/stat.c
120 stty.1: $(common_dep) $(srcdir)/stty.x ../src/stty.c
121 su.1: $(common_dep) $(srcdir)/su.x ../src/su.c
122 sum.1: $(common_dep) $(srcdir)/sum.x ../src/sum.c
123 sync.1: $(common_dep) $(srcdir)/sync.x ../src/sync.c
124 tac.1: $(common_dep) $(srcdir)/tac.x ../src/tac.c
125 tail.1: $(common_dep) $(srcdir)/tail.x ../src/tail.c
126 tee.1: $(common_dep) $(srcdir)/tee.x ../src/tee.c
127 test.1: $(common_dep) $(srcdir)/test.x ../src/test.c
128 touch.1: $(common_dep) $(srcdir)/touch.x ../src/touch.c
129 tr.1: $(common_dep) $(srcdir)/tr.x ../src/tr.c
130 true.1: $(common_dep) $(srcdir)/true.x ../src/true.c
131 tsort.1: $(common_dep) $(srcdir)/tsort.x ../src/tsort.c
132 tty.1: $(common_dep) $(srcdir)/tty.x ../src/tty.c
133 uname.1: $(common_dep) $(srcdir)/uname.x ../src/uname.c
134 unexpand.1: $(common_dep) $(srcdir)/unexpand.x ../src/unexpand.c
135 uniq.1: $(common_dep) $(srcdir)/uniq.x ../src/uniq.c
136 unlink.1: $(common_dep) $(srcdir)/unlink.x ../src/unlink.c
137 uptime.1: $(common_dep) $(srcdir)/uptime.x ../src/uptime.c
138 users.1: $(common_dep) $(srcdir)/users.x ../src/users.c
139 vdir.1: $(common_dep) $(srcdir)/vdir.x ../src/ls.c
140 wc.1: $(common_dep) $(srcdir)/wc.x ../src/wc.c
141 who.1: $(common_dep) $(srcdir)/who.x ../src/who.c
142 whoami.1: $(common_dep) $(srcdir)/whoami.x ../src/whoami.c
143 yes.1: $(common_dep) $(srcdir)/yes.x ../src/yes.c
147 # Ensure that help2man runs the ../src/ginstall binary as
148 # `install' when creating install.1.
149 # Similarly, ensure that it uses the ../src/[ binary to create test.1.
151 mapped_name = `echo $*|sed 's/install/ginstall/; s/test/[/'`
153 # Note the use of $t/$*, rather than just `$*' as in other packages.
154 # That is necessary to avoid failures for programs that are also shell built-in
155 # functions like echo, false, printf, pwd.
158 @echo "Updating man page $@"; \
161 (cd $t && $(LN_S) ../../src/$(mapped_name) $*); \
162 $(PERL) -- $(srcdir)/help2man \
163 --include=$(srcdir)/$*.x \
165 @sed 's|$*\.td/||g' $t/$@ > $@
169 check-local: check-x-vs-1 check-programs-vs-x
171 # Sort in traditional ASCII order, regardless of the current locale;
172 # otherwise we may get into trouble with distinct strings that the
173 # current locale considers to be equal.
174 ASSORT = LC_ALL=C sort
176 # Ensure that for each .x file in this directory, there is a
177 # corresponding .1 file in the definition of $(dist_man_MANS) above.
180 PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \
182 (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\
183 echo $(dist_man_MANS) | tr -s ' ' '\n' | sed 's/\.1$$//' \
184 | $(ASSORT) | diff - $$t || { rm $$t; exit 1; }; \
188 (cd ../src && MAKEFLAGS= $(MAKE) -s all_programs.list) \
191 .PHONY: check-programs-vs-x
194 for p in dummy `$(all_programs)`; do \
195 test $$p = dummy && continue; \
196 test $$p = ginstall && p=install || : ; \
197 test -f $(srcdir)/$$p.x \
198 || { echo missing $$p.x 1>&2; status=1; }; \