summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am37
1 files changed, 32 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index 36e715d5..fb4af272 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
# Make coreutils. -*-Makefile-*-
-# Copyright (C) 1990-2013 Free Software Foundation, Inc.
+# Copyright (C) 1990-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -50,6 +50,7 @@ EXTRA_DIST = \
bootstrap \
bootstrap.conf \
build-aux/gen-lists-of-programs.sh \
+ build-aux/gen-single-binary.sh \
cfg.mk \
dist-check.mk \
maint.mk \
@@ -57,6 +58,7 @@ EXTRA_DIST = \
thanks-gen
gen_progs_lists = $(top_srcdir)/build-aux/gen-lists-of-programs.sh
+gen_single_binary = $(top_srcdir)/build-aux/gen-single-binary.sh
# Keep these in sync with bootstrap.conf:bootstrap_post_import_hook().
# Use '$(top_srcdir)/m4' and '$(srcdir)/src' for the benefit of non-GNU
@@ -70,6 +72,10 @@ $(srcdir)/src/cu-progs.mk: $(gen_progs_lists)
$(AM_V_GEN)rm -f $@ $@-t \
&& $(SHELL) $(gen_progs_lists) --automake >$@-t \
&& chmod a-w $@-t && mv -f $@-t $@
+$(srcdir)/src/single-binary.mk: $(gen_single_binary) $(srcdir)/src/local.mk
+ $(AM_V_GEN)rm -f $@ $@-t \
+ && $(SHELL) $(gen_single_binary) $(srcdir)/src/local.mk >$@-t \
+ && chmod a-w $@-t && mv -f $@-t $@
ACLOCAL_AMFLAGS = -I m4
@@ -105,11 +111,14 @@ gen_start_date = 2008-02-08
.PHONY: gen-ChangeLog
gen-ChangeLog:
$(AM_V_GEN)if test -d .git; then \
+ log_fix="$(srcdir)/build-aux/git-log-fix"; \
+ test -e "$$log_fix" \
+ && amend_git_log="--amend=$$log_fix" \
+ || amend_git_log=; \
$(top_srcdir)/build-aux/gitlog-to-changelog \
- --amend=$(srcdir)/build-aux/git-log-fix \
- --since=$(gen_start_date) > $(distdir)/cl-t; \
- rm -f $(distdir)/ChangeLog; \
- mv $(distdir)/cl-t $(distdir)/ChangeLog; \
+ $$amend_git_log --since=$(gen_start_date) > $(distdir)/cl-t && \
+ { rm -f $(distdir)/ChangeLog && \
+ mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
fi
ALL_RECURSIVE_TARGETS += distcheck-hook
@@ -177,6 +186,24 @@ check-git-hook-script-sync:
rm -rf $$t; \
test $$fail = 0
+# If we are building a single-binary, create symlinks or shebangs for
+# the selected tools when installing.
+install-exec-hook:
+ $(AM_V_at)ctrans=$$(printf coreutils | sed -e "$(transform)"); \
+ for p in $(single_binary_progs); do \
+ ptrans=$$(printf '%s' "$$p" | sed -e "$(transform)"); \
+ rm -f $(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
+ if test "x$(single_binary_install_type)" = xshebangs; then \
+ printf '#!%s --coreutils-prog-shebang=%s\n' \
+ $(bindir)/$$ctrans$(EXEEXT) $$p \
+ >$(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
+ chmod a+x,a-w $(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?;\
+ else \
+ $(LN_S) -s $$ctrans$(EXEEXT) \
+ $(DESTDIR)$(bindir)/$$ptrans$(EXEEXT) || exit $$?; \
+ fi \
+ done
+
noinst_LIBRARIES =
MOSTLYCLEANFILES =
CLEANFILES =