tests: ls/stat-free-color: fix unwarranted failure on a 32-bit system
[coreutils.git] / Makefile.am
bloba003dbdf5ecf0575d78f1038ba560ab1e39277da
1 # Make coreutils.                                       -*-Makefile-*-
3 # Copyright (C) 1990, 1993-2011 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 EXTRA_DIST =                            \
42   $(changelog_etc)                      \
43   .mailmap                              \
44   .prev-version                         \
45   .version                              \
46   .vg-suppressions                      \
47   THANKS.in                             \
48   THANKS-to-translators                 \
49   THANKStt.in                           \
50   bootstrap                             \
51   bootstrap.conf                        \
52   build-aux/cvsu                        \
53   cfg.mk                                \
54   dist-check.mk                         \
55   gl/modules/getloadavg.diff            \
56   maint.mk                              \
57   thanks-gen
59 ALL_RECURSIVE_TARGETS += install-root
60 install-root:
61         cd src && $(MAKE) $@
63 ACLOCAL_AMFLAGS = -I m4
65 # Some tests always need root privileges, others need them only sometimes.
66 ALL_RECURSIVE_TARGETS += check-root
67 check-root:
68         cd tests && $(MAKE) $@ SUBDIRS=
70 # Just prior to distribution, ...
71 # transform the automake-generated rule that runs `rm -f rm'.
72 # On some systems, that command would fail with a diagnostic like
73 # `rm: cannot unlink `rm': Text file busy' when `.' appears so early
74 # in the shell's search path that running `rm' would run the `rm'
75 # executable in the current directory.
76 # Similarly, adjust the clean-binPROGRAMS rule.
77 rm_subst = \
78   s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
80 BUILT_SOURCES = .version
81 .version:
82         $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
84 # Arrange so that .tarball-version appears only in the distribution
85 # tarball, and never in a checked-out repository.
86 # The perl substitution is to change some key uses of "rm" to "/bin/rm".
87 # See the rm_subst comment for details.
88 dist-hook: gen-ChangeLog
89         $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
90         $(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
92 gen_start_date = 2008-02-08
93 .PHONY: gen-ChangeLog
94 gen-ChangeLog:
95         $(AM_V_GEN)if test -d .git; then                                \
96           $(top_srcdir)/build-aux/gitlog-to-changelog                   \
97             --since=$(gen_start_date) > $(distdir)/cl-t;                \
98           rm -f $(distdir)/ChangeLog;                                   \
99           mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
100         fi
102 ALL_RECURSIVE_TARGETS += distcheck-hook
103 distcheck-hook: check-ls-dircolors
104         $(MAKE) my-distcheck
105         $(MAKE) taint-distcheck
107 DISTCLEANFILES = VERSION
108 MAINTAINERCLEANFILES = THANKS-to-translators
109 THANKS-to-translators: po/LINGUAS THANKStt.in
110         $(AM_V_GEN)(                                                    \
111           cat $(srcdir)/THANKStt.in;                                    \
112           for lang in `cat $(srcdir)/po/LINGUAS`; do                    \
113             echo http://translationproject.org/team/$$lang.html;        \
114           done;                                                         \
115         ) > $@-tmp && mv $@-tmp $@
117 # Ensure that the sets of two-letter codes in ls.c and dircolors.c
118 # remain in sync.
119 .PHONY: check-ls-dircolors
120 check-ls-dircolors:
121         $(AM_V_GEN)dc=$$(sed -n '/static.*ls_codes\[/,/};'/p    \
122             $(srcdir)/src/dircolors.c                           \
123           |sed -n '/^  *"/p'|tr , '\n'|sed 's/^  *//'           \
124           |sed -n 's/^"\(..\)"/\1/p'|sort -u);                  \
125         ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p        \
126             $(srcdir)/src/ls.c                                  \
127           |sed -n '/^  *"/p'|tr , '\n'|sed 's/^  *//'           \
128           |sed -n 's/^"\(..\)"/\1/p'|sort -u);                  \
129         test "$$dc" = "$$ls"
131 # Sort in traditional ASCII order, regardless of the current locale;
132 # otherwise we may get into trouble with distinct strings that the
133 # current locale considers to be equal.
134 ASSORT = LC_ALL=C sort
136 # Extract all lines up to the first one starting with "##".
137 prologue = perl -ne '/^\#\#/ and exit; print' $(srcdir)/THANKS.in
139 THANKS: THANKS.in Makefile.am .mailmap thanks-gen .version
140         $(AM_V_GEN)                                                     \
141         {                                                               \
142           $(prologue); echo;                                            \
143           { perl -ne '/^$$/.../^$$/ and print' $(srcdir)/THANKS.in      \
144               | grep -v '^$$' | perl -pe 's/  +/\0/';                   \
145             git log --pretty=format:'%aN%x00%aE'                        \
146               | $(ASSORT) -u;                                           \
147           } | $(srcdir)/thanks-gen                                      \
148             | LC_ALL=en_US.UTF-8 sort -f;                               \
149           echo;                                                         \
150           printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:;     \
151         } > $@-t && mv $@-t $@