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
27 build-aux/ChangeLog-2007 \
28 build-aux/update-copyright \
32 old/fileutils/ChangeLog \
33 old/fileutils/ChangeLog-1997 \
35 old/sh-utils/ChangeLog \
36 old/sh-utils/ChangeLog.0 \
38 old/textutils/ChangeLog \
42 syntax_check_exceptions = \
44 .x-sc_error_message_uppercase \
46 .x-sc_obsolete_symbols \
49 .x-sc_prohibit_atoi_atof \
50 .x-sc_prohibit_stat_st_blocks \
51 .x-sc_prohibit_strcmp \
52 .x-sc_prohibit_tab_based_indentation \
53 .x-sc_require_config_h \
54 .x-sc_require_config_h_first \
57 .x-sc_system_h_headers \
58 .x-sc_trailing_blank \
59 .x-sc_unmarked_diagnostics \
60 .x-sc_useless_cpp_parens
64 $(syntax_check_exceptions) \
68 THANKS-to-translators \
75 gl/modules/getloadavg.diff \
78 ALL_RECURSIVE_TARGETS += install-root
82 ACLOCAL_AMFLAGS = -I m4
84 # Some tests always need root privileges, others need them only sometimes.
85 ALL_RECURSIVE_TARGETS += check-root
87 cd tests && $(MAKE) $@ SUBDIRS=
89 # Just prior to distribution, ...
90 # transform the automake-generated rule that runs `rm -f rm'.
91 # On some systems, that command would fail with a diagnostic like
92 # `rm: cannot unlink `rm': Text file busy' when `.' appears so early
93 # in the shell's search path that running `rm' would run the `rm'
94 # executable in the current directory.
95 # Similarly, adjust the clean-binPROGRAMS rule.
97 s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
99 BUILT_SOURCES = .version
101 echo $(VERSION) > $@-t && mv $@-t $@
103 # Arrange so that .tarball-version appears only in the distribution
104 # tarball, and never in a checked-out repository.
105 # The perl substitution is to change some key uses of "rm" to "/bin/rm".
106 # See the rm_subst comment for details.
107 dist-hook: gen-ChangeLog
108 echo $(VERSION) > $(distdir)/.tarball-version
109 perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
111 gen_start_date = 2008-02-08
112 .PHONY: gen-ChangeLog
114 if test -d .git; then \
115 $(top_srcdir)/build-aux/gitlog-to-changelog \
116 --since=$(gen_start_date) > $(distdir)/cl-t; \
117 rm -f $(distdir)/ChangeLog; \
118 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
121 ALL_RECURSIVE_TARGETS += distcheck-hook
122 distcheck-hook: check-ls-dircolors
125 DISTCLEANFILES = VERSION
126 MAINTAINERCLEANFILES = THANKS-to-translators
127 THANKS-to-translators: po/LINGUAS THANKStt.in
129 cat $(srcdir)/THANKStt.in; \
130 for lang in `cat $(srcdir)/po/LINGUAS`; do \
131 echo http://translationproject.org/team/$$lang.html; \
133 ) > $@-tmp && mv $@-tmp $@
135 # Ensure that the sets of two-letter codes in ls.c and dircolors.c
137 .PHONY: check-ls-dircolors
139 dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
140 $(srcdir)/src/dircolors.c \
141 |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
142 |sed -n 's/^"\(..\)"/\1/p'|sort -u); \
143 ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p \
145 |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
146 |sed -n 's/^"\(..\)"/\1/p'|sort -u); \