1
1
# Make coreutils. -*-Makefile-*-
3
# Copyright (C) 1990, 1993-2011 Free Software Foundation, Inc.
3
# Copyright (C) 1990-2012 Free Software Foundation, Inc.
5
5
# This program is free software: you can redistribute it and/or modify
6
6
# it under the terms of the GNU General Public License as published by
52
build-aux/gen-lists-of-programs.sh \
58
ALL_RECURSIVE_TARGETS += install-root
59
gen_progs_lists = $(top_srcdir)/build-aux/gen-lists-of-programs.sh
61
# Keep these in sync with bootstrap.conf:bootstrap_post_import_hook().
62
# Use '$(top_srcdir)/m4' and '$(srcdir)/src' for the benefit of non-GNU
63
# makes: it is with those directories that 'cu-progs.m4' and 'cu-progs.mk'
64
# appear in our dependencies.
65
$(top_srcdir)/m4/cu-progs.m4: $(gen_progs_lists)
66
$(AM_V_GEN)rm -f $@ $@-t \
67
&& $(SHELL) $(gen_progs_lists) --autoconf >$@-t \
68
&& chmod a-w $@-t && mv -f $@-t $@
69
$(srcdir)/src/cu-progs.mk: $(gen_progs_lists)
70
$(AM_V_GEN)rm -f $@ $@-t \
71
&& $(SHELL) $(gen_progs_lists) --automake >$@-t \
72
&& chmod a-w $@-t && mv -f $@-t $@
62
74
ACLOCAL_AMFLAGS = -I m4
64
# Some tests always need root privileges, others need them only sometimes.
65
ALL_RECURSIVE_TARGETS += check-root
67
cd tests && $(MAKE) $@ SUBDIRS=
76
# Shortcut targets to make it easier to run (very) expensive tests.
78
$(MAKE) check RUN_EXPENSIVE_TESTS=yes
80
$(MAKE) check-expensive RUN_VERY_EXPENSIVE_TESTS=yes
69
82
# Just prior to distribution, ...
70
# transform the automake-generated rule that runs `rm -f rm'.
83
# transform the automake-generated rule that runs 'rm -f rm'.
71
84
# On some systems, that command would fail with a diagnostic like
72
# `rm: cannot unlink `rm': Text file busy' when `.' appears so early
73
# in the shell's search path that running `rm' would run the `rm'
85
# "rm: cannot unlink 'rm': Text file busy" when '.' appears so early
86
# in the shell's search path that running 'rm' would run the 'rm'
74
87
# executable in the current directory.
75
88
# Similarly, adjust the clean-binPROGRAMS rule.
81
94
$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
96
# In general, we run help2man to build a man page from the binary's --help
97
# output, but when building from a just-unpacked distribution tarball, we
98
# must not do that, since help2man uses perl. We don't want to depend on
99
# perl in that case. In general, the .1 file does indeed depend on the
100
# binary. I.e., for cat, we have this Makefile dependency:
102
# That means that once we build src/cat, we would trigger the .x.1
103
# rule which runs help2man. The trick is simply to change the RHS to
104
# "src/cat.c" in the $(distdir) that we're about to tar and compress.
105
# Also handle the three exceptions corresponding to the three binaries
106
# for which there is no like-named .c file: dir, vdir, ginstall.
107
.PHONY: do-not-require-help2man
108
do-not-require-help2man:
109
perl -pi -e 's,^(man/.+?\.1:\s*src/.+?)$$,$$1.c,;' \
110
-e 's,^(man/.+?\.1:\s*src)/ginstall\.c$$,$$1/install.c,;' \
111
-e 's,^(man/.+?\.1:\s*src)/v?dir\.c$$,$$1/ls.c,;' \
112
$(distdir)/Makefile.in
83
114
# Arrange so that .tarball-version appears only in the distribution
84
115
# tarball, and never in a checked-out repository.
85
116
# The perl substitution is to change some key uses of "rm" to "/bin/rm".
86
117
# See the rm_subst comment for details.
87
dist-hook: gen-ChangeLog
118
dist-hook: gen-ChangeLog do-not-require-help2man
88
119
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
89
$(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
120
$(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/Makefile.in
91
122
gen_start_date = 2008-02-08
92
123
.PHONY: gen-ChangeLog
94
125
$(AM_V_GEN)if test -d .git; then \
95
126
$(top_srcdir)/build-aux/gitlog-to-changelog \
127
--amend=$(srcdir)/build-aux/git-log-fix \
96
128
--since=$(gen_start_date) > $(distdir)/cl-t; \
97
129
rm -f $(distdir)/ChangeLog; \
98
130
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
147
179
| LC_ALL=en_US.UTF-8 sort -f; \
149
181
printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:; \
150
} > $@-t && mv $@-t $@
182
} > $@-t && chmod a-w $@-t && mv $@-t $@
184
# Some of our git hook scripts are supposed to be identical to git's samples.
185
# See if they are still in sync.
186
.PHONY: check-git-hook-script-sync
187
check-git-hook-script-sync:
190
&& cd $$t && git init -q && cd .git/hooks \
191
&& for i in pre-commit pre-applypatch applypatch-msg; do \
192
diff $(abs_top_srcdir)/scripts/git-hooks/$$i $$i.sample \
203
AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src
205
include $(top_srcdir)/lib/local.mk
206
include $(top_srcdir)/src/local.mk
207
include $(top_srcdir)/doc/local.mk
208
include $(top_srcdir)/man/local.mk
209
include $(top_srcdir)/tests/local.mk