build (man/): use automake's new $(AM_V_GEN) variable
[coreutils.git] / Makefile.am
blob7670cd650e41abcb18076c21e98a3fba2b6de4e4
1 # Make coreutils.                                       -*-Makefile-*-
3 # Copyright (C) 1990, 1993-2009 Free Software Foundation, Inc.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 ALL_RECURSIVE_TARGETS =
20 SUBDIRS = lib src doc man po tests gnulib-tests
22 changelog_etc =                         \
23   ChangeLog-2005                        \
24   ChangeLog-2006                        \
25   ChangeLog-2007                        \
26   ChangeLog-2008                        \
27   build-aux/ChangeLog-2007              \
28   doc/ChangeLog-2007                    \
29   lib/ChangeLog-2007                    \
30   m4/ChangeLog-2007                     \
31   old/fileutils/ChangeLog               \
32   old/fileutils/ChangeLog-1997          \
33   old/fileutils/NEWS                    \
34   old/sh-utils/ChangeLog                \
35   old/sh-utils/ChangeLog.0              \
36   old/sh-utils/NEWS                     \
37   old/textutils/ChangeLog               \
38   old/textutils/NEWS                    \
39   po/ChangeLog-2007
41 syntax_check_exceptions =               \
42   .x-sc_GPL_version                     \
43   .x-sc_file_system                     \
44   .x-sc_obsolete_symbols                \
45   .x-sc_po_check                        \
46   .x-sc_program_name                    \
47   .x-sc_prohibit_atoi_atof              \
48   .x-sc_prohibit_stat_st_blocks         \
49   .x-sc_prohibit_strcmp                 \
50   .x-sc_require_config_h                \
51   .x-sc_space_tab                       \
52   .x-sc_sun_os_names                    \
53   .x-sc_trailing_blank                  \
54   .x-sc_unmarked_diagnostics            \
55   .x-sc_useless_cpp_parens
57 EXTRA_DIST =                            \
58   $(changelog_etc)                      \
59   $(syntax_check_exceptions)            \
60   .prev-version                         \
61   .version                              \
62   .vg-suppressions                      \
63   THANKS-to-translators                 \
64   THANKStt.in                           \
65   bootstrap                             \
66   bootstrap.conf                        \
67   build-aux/cvsu                        \
68   cfg.mk                                \
69   dist-check.mk                         \
70   gl/modules/getloadavg.diff            \
71   maint.mk
73 ALL_RECURSIVE_TARGETS += install-root
74 install-root:
75         cd src && $(MAKE) $@
77 ACLOCAL_AMFLAGS = -I m4
79 # Some tests always need root privileges, others need them only sometimes.
80 ALL_RECURSIVE_TARGETS += check-root
81 check-root:
82         cd tests && $(MAKE) $@ SUBDIRS=
84 # Just prior to distribution, ...
85 # transform the automake-generated rule that runs `rm -f rm'.
86 # On some systems, that command would fail with a diagnostic like
87 # `rm: cannot unlink `rm': Text file busy' when `.' appears so early
88 # in the shell's search path that running `rm' would run the `rm'
89 # executable in the current directory.
90 # Similarly, adjust the clean-binPROGRAMS rule.
91 rm_subst = \
92   s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
94 BUILT_SOURCES = .version
95 .version:
96         echo $(VERSION) > $@-t && mv $@-t $@
98 # Arrange so that .tarball-version appears only in the distribution
99 # tarball, and never in a checked-out repository.
100 # The perl substitution is to change some key uses of "rm" to "/bin/rm".
101 # See the rm_subst comment for details.
102 dist-hook: gen-ChangeLog
103         echo $(VERSION) > $(distdir)/.tarball-version
104         perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
106 gen_start_date = 2008-02-08
107 .PHONY: gen-ChangeLog
108 gen-ChangeLog:
109         if test -d .git; then                                           \
110           $(top_srcdir)/build-aux/gitlog-to-changelog                   \
111             --since=$(gen_start_date) > $(distdir)/cl-t;                \
112           rm -f $(distdir)/ChangeLog;                                   \
113           mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
114         fi
116 ALL_RECURSIVE_TARGETS += distcheck-hook
117 distcheck-hook: check-ls-dircolors
118         $(MAKE) my-distcheck
120 DISTCLEANFILES = VERSION
121 MAINTAINERCLEANFILES = THANKS-to-translators
122 THANKS-to-translators: po/LINGUAS THANKStt.in
123         (                                                               \
124           cat $(srcdir)/THANKStt.in;                                    \
125           for lang in `cat $(srcdir)/po/LINGUAS`; do                    \
126             echo http://translationproject.org/team/$$lang.html;        \
127           done;                                                         \
128         ) > $@-tmp && mv $@-tmp $@
130 # Ensure that the sets of two-letter codes in ls.c and dircolors.c
131 # remain in sync.
132 .PHONY: check-ls-dircolors
133 check-ls-dircolors:
134         dc=$$(sed -n '/static.*ls_codes\[/,/};'/p               \
135             $(srcdir)/src/dircolors.c                           \
136           |sed -n '/^  *"/p'|tr , '\n'|sed 's/^  *//'           \
137           |sed -n 's/^"\(..\)"/\1/p'|sort -u);                  \
138         ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p        \
139             $(srcdir)/src/ls.c                                  \
140           |sed -n '/^  *"/p'|tr , '\n'|sed 's/^  *//'           \
141           |sed -n 's/^"\(..\)"/\1/p'|sort -u);                  \
142         test "$$dc" = "$$ls"