|
Packit Service |
2723c6 |
# Make coreutils. -*-Makefile-*-
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# Copyright (C) 1990-2018 Free Software Foundation, Inc.
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# This program is free software: you can redistribute it and/or modify
|
|
Packit Service |
2723c6 |
# it under the terms of the GNU General Public License as published by
|
|
Packit Service |
2723c6 |
# the Free Software Foundation, either version 3 of the License, or
|
|
Packit Service |
2723c6 |
# (at your option) any later version.
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# This program is distributed in the hope that it will be useful,
|
|
Packit Service |
2723c6 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
2723c6 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
2723c6 |
# GNU General Public License for more details.
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# You should have received a copy of the GNU General Public License
|
|
Packit Service |
2723c6 |
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
ALL_RECURSIVE_TARGETS =
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
SUBDIRS = po . gnulib-tests
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
EXTRA_DIST = \
|
|
Packit Service |
2723c6 |
.mailmap \
|
|
Packit Service |
2723c6 |
.prev-version \
|
|
Packit Service |
2723c6 |
.version \
|
|
Packit Service |
2723c6 |
.vg-suppressions \
|
|
Packit Service |
2723c6 |
THANKS.in \
|
|
Packit Service |
2723c6 |
THANKS-to-translators \
|
|
Packit Service |
2723c6 |
THANKStt.in \
|
|
Packit Service |
2723c6 |
bootstrap \
|
|
Packit Service |
2723c6 |
bootstrap.conf \
|
|
Packit Service |
2723c6 |
build-aux/gen-lists-of-programs.sh \
|
|
Packit Service |
2723c6 |
build-aux/gen-single-binary.sh \
|
|
Packit Service |
2723c6 |
cfg.mk \
|
|
Packit Service |
2723c6 |
dist-check.mk \
|
|
Packit Service |
2723c6 |
maint.mk \
|
|
Packit Service |
2723c6 |
tests/GNUmakefile \
|
|
Packit Service |
2723c6 |
thanks-gen
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
gen_progs_lists = $(top_srcdir)/build-aux/gen-lists-of-programs.sh
|
|
Packit Service |
2723c6 |
gen_single_binary = $(top_srcdir)/build-aux/gen-single-binary.sh
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# Keep these in sync with bootstrap.conf:bootstrap_post_import_hook().
|
|
Packit Service |
2723c6 |
# Use '$(top_srcdir)/m4' and '$(srcdir)/src' for the benefit of non-GNU
|
|
Packit Service |
2723c6 |
# makes: it is with those directories that 'cu-progs.m4' and 'cu-progs.mk'
|
|
Packit Service |
2723c6 |
# appear in our dependencies.
|
|
Packit Service |
2723c6 |
$(top_srcdir)/m4/cu-progs.m4: $(gen_progs_lists)
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)rm -f $@ $@-t \
|
|
Packit Service |
2723c6 |
&& $(SHELL) $(gen_progs_lists) --autoconf >$@-t \
|
|
Packit Service |
2723c6 |
&& chmod a-w $@-t && mv -f $@-t $@
|
|
Packit Service |
2723c6 |
$(srcdir)/src/cu-progs.mk: $(gen_progs_lists)
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)rm -f $@ $@-t \
|
|
Packit Service |
2723c6 |
&& $(SHELL) $(gen_progs_lists) --automake >$@-t \
|
|
Packit Service |
2723c6 |
&& chmod a-w $@-t && mv -f $@-t $@
|
|
Packit Service |
2723c6 |
$(srcdir)/src/single-binary.mk: $(gen_single_binary) $(srcdir)/src/local.mk
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)rm -f $@ $@-t \
|
|
Packit Service |
2723c6 |
&& $(SHELL) $(gen_single_binary) $(srcdir)/src/local.mk >$@-t \
|
|
Packit Service |
2723c6 |
&& chmod a-w $@-t && mv -f $@-t $@
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
ACLOCAL_AMFLAGS = -I m4
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# Shortcut targets to make it easier to run (very) expensive tests.
|
|
Packit Service |
2723c6 |
check-expensive:
|
|
Packit Service |
2723c6 |
$(MAKE) check RUN_EXPENSIVE_TESTS=yes
|
|
Packit Service |
2723c6 |
check-very-expensive:
|
|
Packit Service |
2723c6 |
$(MAKE) check-expensive RUN_VERY_EXPENSIVE_TESTS=yes
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# Just prior to distribution, ...
|
|
Packit Service |
2723c6 |
# transform the automake-generated rule that runs 'rm -f rm'.
|
|
Packit Service |
2723c6 |
# On some systems, that command would fail with a diagnostic like
|
|
Packit Service |
2723c6 |
# "rm: cannot unlink 'rm': Text file busy" when '.' appears so early
|
|
Packit Service |
2723c6 |
# in the shell's search path that running 'rm' would run the 'rm'
|
|
Packit Service |
2723c6 |
# executable in the current directory.
|
|
Packit Service |
2723c6 |
# Similarly, adjust the clean-binPROGRAMS rule.
|
|
Packit Service |
2723c6 |
rm_subst = \
|
|
Packit Service |
2723c6 |
s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
BUILT_SOURCES = .version
|
|
Packit Service |
2723c6 |
.version:
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# Have no read-only files in the tarball to allow easy removal.
|
|
Packit Service |
2723c6 |
# Have .tarball-version based versions only in tarball builds.
|
|
Packit Service |
2723c6 |
# Have .timestamp based dates only in tarball builds.
|
|
Packit Service |
2723c6 |
# The perl substitution is to change some key uses of "rm" to "/bin/rm".
|
|
Packit Service |
2723c6 |
# See the rm_subst comment for details.
|
|
Packit Service |
2723c6 |
# The touch avoids a subtle, spurious "make distcheck" failure.
|
|
Packit Service |
2723c6 |
dist-hook: gen-ChangeLog
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)chmod -R +rw $(distdir)
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)date +%s > $(distdir)/.timestamp
|
|
Packit Service |
2723c6 |
$(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/Makefile.in
|
|
Packit Service |
2723c6 |
$(AM_V_at)touch $(distdir)/doc/constants.texi \
|
|
Packit Service |
2723c6 |
$(distdir)/doc/coreutils.info
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
gen_start_ver = 8.20
|
|
Packit Service |
2723c6 |
.PHONY: gen-ChangeLog
|
|
Packit Service |
2723c6 |
gen-ChangeLog:
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)if test -d .git; then \
|
|
Packit Service |
2723c6 |
log_fix="$(srcdir)/build-aux/git-log-fix"; \
|
|
Packit Service |
2723c6 |
test -e "$$log_fix" \
|
|
Packit Service |
2723c6 |
&& amend_git_log="--amend=$$log_fix" \
|
|
Packit Service |
2723c6 |
|| amend_git_log=; \
|
|
Packit Service |
2723c6 |
$(top_srcdir)/build-aux/gitlog-to-changelog $$amend_git_log \
|
|
Packit Service |
2723c6 |
-- v$(gen_start_ver)~.. > $(distdir)/cl-t && \
|
|
Packit Service |
2723c6 |
{ printf '\n\nSee the source repo for older entries\n' \
|
|
Packit Service |
2723c6 |
>> $(distdir)/cl-t && \
|
|
Packit Service |
2723c6 |
rm -f $(distdir)/ChangeLog && \
|
|
Packit Service |
2723c6 |
mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
|
|
Packit Service |
2723c6 |
fi
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
ALL_RECURSIVE_TARGETS += distcheck-hook
|
|
Packit Service |
2723c6 |
distcheck-hook: check-ls-dircolors
|
|
Packit Service |
2723c6 |
$(MAKE) my-distcheck
|
|
Packit Service |
2723c6 |
$(MAKE) taint-distcheck
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
DISTCLEANFILES = VERSION
|
|
Packit Service |
2723c6 |
MAINTAINERCLEANFILES = THANKS-to-translators
|
|
Packit Service |
2723c6 |
THANKS-to-translators: po/LINGUAS THANKStt.in
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)( \
|
|
Packit Service |
2723c6 |
cat $(srcdir)/THANKStt.in; \
|
|
Packit Service |
2723c6 |
for lang in `cat $(srcdir)/po/LINGUAS`; do \
|
|
Packit Service |
2723c6 |
echo https://translationproject.org/team/$$lang.html; \
|
|
Packit Service |
2723c6 |
done; \
|
|
Packit Service |
2723c6 |
) > $@-tmp && mv $@-tmp $@
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# Ensure that the sets of two-letter codes in ls.c and dircolors.c
|
|
Packit Service |
2723c6 |
# remain in sync.
|
|
Packit Service |
2723c6 |
.PHONY: check-ls-dircolors
|
|
Packit Service |
2723c6 |
check-ls-dircolors:
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
|
|
Packit Service |
2723c6 |
$(srcdir)/src/dircolors.c \
|
|
Packit Service |
2723c6 |
|sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
|
|
Packit Service |
2723c6 |
|sed -n 's/^"\(..\)"/\1/p'|sort -u); \
|
|
Packit Service |
2723c6 |
ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p \
|
|
Packit Service |
2723c6 |
$(srcdir)/src/ls.c \
|
|
Packit Service |
2723c6 |
|sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
|
|
Packit Service |
2723c6 |
|sed -n 's/^"\(..\)"/\1/p'|sort -u); \
|
|
Packit Service |
2723c6 |
test "$$dc" = "$$ls"
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# Sort in traditional ASCII order, regardless of the current locale;
|
|
Packit Service |
2723c6 |
# otherwise we may get into trouble with distinct strings that the
|
|
Packit Service |
2723c6 |
# current locale considers to be equal.
|
|
Packit Service |
2723c6 |
ASSORT = LC_ALL=C sort
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# Extract all lines up to the first one starting with "##".
|
|
Packit Service |
2723c6 |
prologue = perl -ne '/^\#\#/ and exit; print' $(srcdir)/THANKS.in
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# FIXME: avoid dependency to build our own 'sort' for 'make dist' ...
|
|
Packit Service |
2723c6 |
# when common platforms have a functional case-folding implementation:
|
|
Packit Service |
2723c6 |
# $ test 'abácad' = "$(printf '%s\n' 'ab' 'ác' 'ad' \
|
|
Packit Service |
2723c6 |
# | LC_ALL=en_US.UTF-8 sort -f \
|
|
Packit Service |
2723c6 |
# | tr -d '\n')" && echo GOOD || echo BAD
|
|
Packit Service |
2723c6 |
# Note we don't enable case folding (-f) in the sort below, due to bugs
|
|
Packit Service |
2723c6 |
# in the I18N patch used in many distros (as of 2015). Also using our
|
|
Packit Service |
2723c6 |
# own src/sort here would induce awkward dependencies for `make dist`.
|
|
Packit Service |
2723c6 |
THANKS: THANKS.in Makefile.am .mailmap thanks-gen .version
|
|
Packit Service |
2723c6 |
$(AM_V_GEN)rm -f $@-t $@; \
|
|
Packit Service |
2723c6 |
{ \
|
|
Packit Service |
2723c6 |
$(prologue); echo; \
|
|
Packit Service |
2723c6 |
{ perl -ne '/^$$/.../^$$/ and !/^$$/ and s/ +/\0/ and print' \
|
|
Packit Service |
2723c6 |
$(srcdir)/THANKS.in; \
|
|
Packit Service |
2723c6 |
git log --pretty=format:'%aN%x00%aE' \
|
|
Packit Service |
2723c6 |
| $(ASSORT) -u; \
|
|
Packit Service |
2723c6 |
} | $(srcdir)/thanks-gen \
|
|
Packit Service |
2723c6 |
| LC_ALL=en_US.UTF-8 sort -k1,1; \
|
|
Packit Service |
2723c6 |
echo; \
|
|
Packit Service |
2723c6 |
printf ';; %s\n' 'Local Variables:' 'coding: utf-8' End:; \
|
|
Packit Service |
2723c6 |
} > $@-t && chmod a-w $@-t && mv $@-t $@
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# Some of our git hook scripts are supposed to be identical to git's samples.
|
|
Packit Service |
2723c6 |
# See if they are still in sync.
|
|
Packit Service |
2723c6 |
.PHONY: check-git-hook-script-sync
|
|
Packit Service |
2723c6 |
check-git-hook-script-sync:
|
|
Packit Service |
2723c6 |
@fail=0; \
|
|
Packit Service |
2723c6 |
t=$$(mktemp -d) \
|
|
Packit Service |
2723c6 |
&& cd $$t && git init -q && cd .git/hooks \
|
|
Packit Service |
2723c6 |
&& for i in pre-commit pre-applypatch applypatch-msg; do \
|
|
Packit Service |
2723c6 |
diff $(abs_top_srcdir)/scripts/git-hooks/$$i $$i.sample \
|
|
Packit Service |
2723c6 |
|| fail=1; \
|
|
Packit Service |
2723c6 |
done; \
|
|
Packit Service |
2723c6 |
rm -rf $$t; \
|
|
Packit Service |
2723c6 |
test $$fail = 0
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
# If we are building a single-binary, create symlinks or shebangs for
|
|
Packit Service |
2723c6 |
# the selected tools when installing.
|
|
Packit Service |
2723c6 |
install-exec-hook:
|
|
Packit Service |
2723c6 |
$(AM_V_at)ctrans=$$(printf coreutils | sed -e "$(transform)"); \
|
|
Packit Service |
2723c6 |
for p in x $(single_binary_progs); do \
|
|
Packit Service |
2723c6 |
test $$p = x && continue; \
|
|
Packit Service |
2723c6 |
ptrans=$$(printf '%s' "$$p" | sed -e "$(transform)"); \
|
|
Packit Service |
2723c6 |
rm -f $(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
|
|
Packit Service |
2723c6 |
if test "x$(single_binary_install_type)" = xshebangs; then \
|
|
Packit Service |
2723c6 |
printf '#!%s --coreutils-prog-shebang=%s\n' \
|
|
Packit Service |
2723c6 |
$(bindir)/$$ctrans$(EXEEXT) $$p \
|
|
Packit Service |
2723c6 |
>$(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
|
|
Packit Service |
2723c6 |
chmod a+x,a-w $(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?;\
|
|
Packit Service |
2723c6 |
else \
|
|
Packit Service |
2723c6 |
$(LN_S) -s $$ctrans$(EXEEXT) \
|
|
Packit Service |
2723c6 |
$(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
|
|
Packit Service |
2723c6 |
fi \
|
|
Packit Service |
2723c6 |
done
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
noinst_LIBRARIES =
|
|
Packit Service |
2723c6 |
MOSTLYCLEANFILES =
|
|
Packit Service |
2723c6 |
CLEANFILES =
|
|
Packit Service |
2723c6 |
MOSTLYCLEANDIRS =
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src
|
|
Packit Service |
2723c6 |
|
|
Packit Service |
2723c6 |
include $(top_srcdir)/lib/local.mk
|
|
Packit Service |
2723c6 |
include $(top_srcdir)/src/local.mk
|
|
Packit Service |
2723c6 |
include $(top_srcdir)/doc/local.mk
|
|
Packit Service |
2723c6 |
include $(top_srcdir)/man/local.mk
|
|
Packit Service |
2723c6 |
include $(top_srcdir)/tests/local.mk
|