1 # Make coreutils. -*-Makefile-*-
3 # Copyright (C) 1990-2012 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 po . gnulib-tests
27 build-aux/ChangeLog-2007 \
31 old/fileutils/ChangeLog \
32 old/fileutils/ChangeLog-1997 \
34 old/sh-utils/ChangeLog \
35 old/sh-utils/ChangeLog.0 \
37 old/textutils/ChangeLog \
48 THANKS-to-translators \
52 build-aux/gen-lists-of-programs.sh \
58 gen_progs_lists = $(top_srcdir)/build-aux/gen-lists-of-programs.sh
60 # Keep these in sync with bootstrap.conf:bootstrap_post_import_hook().
61 # Use '$(top_srcdir)/m4' and '$(srcdir)/src' for the benefit of non-GNU
62 # makes: it is with those directories that 'cu-progs.m4' and 'cu-progs.mk'
63 # appear in our dependencies.
64 $(top_srcdir)/m4/cu-progs.m4: $(gen_progs_lists)
65 $(AM_V_GEN)rm -f $@ $@-t \
66 && $(SHELL) $(gen_progs_lists) --autoconf >$@-t \
67 && chmod a-w $@-t && mv -f $@-t $@
68 $(srcdir)/src/cu-progs.mk: $(gen_progs_lists)
69 $(AM_V_GEN)rm -f $@ $@-t \
70 && $(SHELL) $(gen_progs_lists) --automake >$@-t \
71 && chmod a-w $@-t && mv -f $@-t $@
73 ACLOCAL_AMFLAGS = -I m4
75 # Shortcut targets to make it easier to run (very) expensive tests.
77 $(MAKE) check RUN_EXPENSIVE_TESTS=yes
79 $(MAKE) check-expensive RUN_VERY_EXPENSIVE_TESTS=yes
81 # Just prior to distribution, ...
82 # transform the automake-generated rule that runs 'rm -f rm'.
83 # On some systems, that command would fail with a diagnostic like
84 # "rm: cannot unlink 'rm': Text file busy" when '.' appears so early
85 # in the shell's search path that running 'rm' would run the 'rm'
86 # executable in the current directory.
87 # Similarly, adjust the clean-binPROGRAMS rule.
89 s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
91 BUILT_SOURCES = .version
93 $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
95 # Arrange so that .tarball-version appears only in the distribution
96 # tarball, and never in a checked-out repository.
97 # The perl substitution is to change some key uses of "rm" to "/bin/rm".
98 # See the rm_subst comment for details.
99 dist-hook: gen-ChangeLog
100 $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
101 $(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/Makefile.in
103 gen_start_date = 2008-02-08
104 .PHONY: gen-ChangeLog
106 $(AM_V_GEN)if test -d .git; then \
107 $(top_srcdir)/build-aux/gitlog-to-changelog \
108 --amend=$(srcdir)/build-aux/git-log-fix \
109 --since=$(gen_start_date) > $(distdir)/cl-t; \
110 rm -f $(distdir)/ChangeLog; \
111 mv $(distdir)/cl-t $(distdir)/ChangeLog; \
114 ALL_RECURSIVE_TARGETS += distcheck-hook
115 distcheck-hook: check-ls-dircolors
117 $(MAKE) taint-distcheck
119 DISTCLEANFILES = VERSION
120 MAINTAINERCLEANFILES = THANKS-to-translators
121 THANKS-to-translators: po/LINGUAS THANKStt.in
123 cat $(srcdir)/THANKStt.in; \
124 for lang in `cat $(srcdir)/po/LINGUAS`; do \
125 echo http://translationproject.org/team/$$lang.html; \
127 ) > $@-tmp && mv $@-tmp $@
129 # Ensure that the sets of two-letter codes in ls.c and dircolors.c
131 .PHONY: check-ls-dircolors
133 $(AM_V_GEN)dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
134 $(srcdir)/src/dircolors.c \
135 |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
136 |sed -n 's/^"\(..\)"/\1/p'|sort -u); \
137 ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p \
139 |sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
140 |sed -n 's/^"\(..\)"/\1/p'|sort -u); \
143 # Sort in traditional ASCII order, regardless of the current locale;
144 # otherwise we may get into trouble with distinct strings that the
145 # current locale considers to be equal.
146 ASSORT = LC_ALL=C sort
148 # Extract all lines up to the first one starting with "##".
149 prologue = perl -ne '/^\#\#/ and exit; print' $(srcdir)/THANKS.in
151 THANKS: THANKS.in Makefile.am .mailmap thanks-gen .version
152 $(AM_V_GEN)rm -f $@-t $@; \
155 { perl -ne '/^$$/.../^$$/ and print' $(srcdir)/THANKS.in \
156 | grep -v '^$$' | perl -pe 's/ +/\0/'; \
157 git log --pretty=format:'%aN%x00%aE' \
159 } | $(srcdir)/thanks-gen \
160 | LC_ALL=en_US.UTF-8 sort -f; \
162 printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:; \
163 } > $@-t && chmod a-w $@-t && mv $@-t $@
165 # Some of our git hook scripts are supposed to be identical to git's samples.
166 # See if they are still in sync.
167 .PHONY: check-git-hook-script-sync
168 check-git-hook-script-sync:
171 && cd $$t && git init -q && cd .git/hooks \
172 && for i in pre-commit pre-applypatch applypatch-msg; do \
173 diff $(abs_top_srcdir)/scripts/git-hooks/$$i $$i.sample \
179 include $(top_srcdir)/src/local.mk
180 include $(top_srcdir)/doc/local.mk
181 include $(top_srcdir)/man/local.mk
182 include $(top_srcdir)/tests/local.mk