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