seq: improve quality of format-checking code
[coreutils.git] / Makefile.am
blob2bb096552f74d55efcdf354c27894dec22b7831d
1 # Make coreutils.                                       -*-Makefile-*-
3 # Copyright (C) 1990, 1993-2008 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 SUBDIRS = lib src doc man po tests gnulib-tests
19 EXTRA_DIST = cfg.mk maint.mk \
20   .prev-version THANKS-to-translators THANKStt.in \
21   .version \
22   .vg-suppressions \
23   .x-po-check \
24   .x-sc_GPL_version \
25   .x-sc_file_system \
26   .x-sc_obsolete_symbols \
27   .x-sc_program_name \
28   .x-sc_prohibit_atoi_atof \
29   .x-sc_prohibit_stat_st_blocks \
30   .x-sc_prohibit_strcmp \
31   .x-sc_require_config_h \
32   .x-sc_space_tab .x-sc_sun_os_names \
33   .x-sc_trailing_blank \
34   .x-sc_unmarked_diagnostics \
35   .x-sc_useless_cpp_parens \
36   ChangeLog-2005 \
37   ChangeLog-2006 \
38   ChangeLog-2007 \
39   ChangeLog-2008 \
40   bootstrap \
41   bootstrap.conf \
42   build-aux/cvsu \
43   build-aux/git-version-gen \
44   build-aux/vc-list-files \
45   gl/modules/getloadavg.diff \
46   m4/ChangeLog \
47   old/fileutils/ChangeLog \
48   old/fileutils/ChangeLog-1997 \
49   old/fileutils/NEWS \
50   old/sh-utils/ChangeLog \
51   old/sh-utils/ChangeLog.0 \
52   old/sh-utils/NEWS \
53   old/textutils/ChangeLog \
54   old/textutils/NEWS
56 install-root:
57         cd src && $(MAKE) $@
59 ACLOCAL_AMFLAGS = -I m4
61 # Some tests always need root privileges, others need them only sometimes.
62 check-root:
63         cd tests && $(MAKE) $@ SUBDIRS=
65 # Just prior to distribution, ...
66 # transform the automake-generated rule that runs `rm -f rm'.
67 # On some systems, that command would fail with a diagnostic like
68 # `rm: cannot unlink `rm': Text file busy' when `.' appears so early
69 # in the shell's search path that running `rm' would run the `rm'
70 # executable in the current directory.
71 # Similarly, adjust the clean-binPROGRAMS rule.
72 rm_subst = \
73   s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
75 BUILT_SOURCES = .version
76 .version:
77         echo $(VERSION) > $@-t && mv $@-t $@
79 # Arrange so that .tarball-version appears only in the distribution
80 # tarball, and never in a checked-out repository.
81 # The perl substitution is to change some key uses of "rm" to "/bin/rm".
82 # See the rm_subst comment for details.
83 dist-hook: gen-ChangeLog
84         echo $(VERSION) > $(distdir)/.tarball-version
85         perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
87 gen_start_date = 2008-02-08
88 .PHONY: gen-ChangeLog
89 gen-ChangeLog:
90         if test -d .git; then                                           \
91           $(top_srcdir)/build-aux/gitlog-to-changelog                   \
92             --since=$(gen_start_date) > $(distdir)/cl-t;                \
93           rm -f $(distdir)/ChangeLog;                                   \
94           mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
95         fi
97 distcheck-hook: check-ls-dircolors
98         $(MAKE) my-distcheck
100 DISTCLEANFILES = VERSION
101 MAINTAINERCLEANFILES = THANKS-to-translators
102 THANKS-to-translators: po/LINGUAS THANKStt.in
103         (                                                               \
104           cat $(srcdir)/THANKStt.in;                                    \
105           for lang in `cat $(srcdir)/po/LINGUAS`; do                            \
106             echo http://www.iro.umontreal.ca/contrib/po/HTML/team-$$lang.html; \
107           done;                                                         \
108         ) > $@-tmp && mv $@-tmp $@
110 # Ensure that the sets of two-letter codes in ls.c and dircolors.c
111 # remain in sync.
112 .PHONY: check-ls-dircolors
113 check-ls-dircolors:
114         dc=$$(sed -n '/static.*ls_codes\[/,/};'/p               \
115             $(srcdir)/src/dircolors.c                           \
116           |sed -n '/^  *"/p'|tr , '\n'|sed 's/^  *//'           \
117           |sed -n 's/^"\(..\)"/\1/p'|sort -u);                  \
118         ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p        \
119             $(srcdir)/src/ls.c                                  \
120           |sed -n '/^  *"/p'|tr , '\n'|sed 's/^  *//'           \
121           |sed -n 's/^"\(..\)"/\1/p'|sort -u);                  \
122         test "$$dc" = "$$ls"