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 SUBDIRS = lib src doc man po tests gnulib-tests
25 build-aux/ChangeLog-2007 \
29 old/fileutils/ChangeLog \
30 old/fileutils/ChangeLog-1997 \
32 old/sh-utils/ChangeLog \
33 old/sh-utils/ChangeLog.0 \
35 old/textutils/ChangeLog \
39 syntax_check_exceptions = \
42 .x-sc_obsolete_symbols \
45 .x-sc_prohibit_atoi_atof \
46 .x-sc_prohibit_stat_st_blocks \
47 .x-sc_prohibit_strcmp \
48 .x-sc_require_config_h \
51 .x-sc_trailing_blank \
52 .x-sc_unmarked_diagnostics \
53 .x-sc_useless_cpp_parens
57 $(syntax_check_exceptions) \
61 THANKS-to-translators \
67 gl/modules/getloadavg.diff \
73 ACLOCAL_AMFLAGS = -I m4
75 # Some tests always need root privileges, others need them only sometimes.
77 cd tests && $(MAKE) $@ SUBDIRS=
79 # Just prior to distribution, ...
80 # transform the automake-generated rule that runs `rm -f rm'.
81 # On some systems, that command would fail with a diagnostic like
82 # `rm: cannot unlink `rm': Text file busy' when `.' appears so early
83 # in the shell's search path that running `rm' would run the `rm'
84 # executable in the current directory.
85 # Similarly, adjust the clean-binPROGRAMS rule.
87 s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
89 BUILT_SOURCES = .version
91 echo $(VERSION) > $@-t && mv $@-t $@
93 # Arrange so that .tarball-version appears only in the distribution
94 # tarball, and never in a checked-out repository.
95 # The perl substitution is to change some key uses of "rm" to "/bin/rm".
96 # See the rm_subst comment for details.
97 dist-hook: gen-ChangeLog
98 echo $(VERSION) > $(distdir)/.tarball-version
99 perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
101 gen_start_date = 2008-02-08
102 .PHONY: gen-ChangeLog
104 if test -d .git; then \
105 $(top_srcdir)/build-aux/gitlog-to-changelog \
106 --since=$(gen_start_date) > $(distdir)/cl-t; \
107 rm -f $(distdir)/ChangeLog; \
108 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
111 distcheck-hook: check-ls-dircolors
114 DISTCLEANFILES = VERSION
115 MAINTAINERCLEANFILES = THANKS-to-translators
116 THANKS-to-translators: po/LINGUAS THANKStt.in
118 cat $(srcdir)/THANKStt.in; \
119 for lang in `cat $(srcdir)/po/LINGUAS`; do \
120 echo http://translationproject.org/team/$$lang.html; \
122 ) > $@-tmp && mv $@-tmp $@
124 # Ensure that the sets of two-letter codes in ls.c and dircolors.c
126 .PHONY: check-ls-dircolors
128 dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
129 $(srcdir)/src/dircolors.c \
130 |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
131 |sed -n 's/^"\(..\)"/\1/p'|sort -u); \
132 ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p \
134 |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
135 |sed -n 's/^"\(..\)"/\1/p'|sort -u); \