summaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-05-21 23:08:11 +0200
committerJim Meyering <meyering@redhat.com>2008-05-26 12:10:21 +0200
commit9d595099372e2eabbecce2f303058743e93f0748 (patch)
tree782480be88d0e8be94618c202959da9090b4b72d /src/Makefile.am
parent26552f27565a518b8536bd1e158f8c28ef98cb94 (diff)
downloadcoreutils-9d595099372e2eabbecce2f303058743e93f0748.tar.xz
install many binaries at once, when possible
* src/Makefile.am (install-exec-am): Override the standard automake-generated target, so we can decide whether to use the usual install-one-by-one rule, or whether we can use the new install-many-at-once rule: (cu-install-binPROGRAMS): New rule.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c8cfe5eee..8e0091fbd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -218,7 +218,7 @@ copy_sources = copy.c cp-hash.c
# confusion with the `install' target. The install rule transforms `ginstall'
# to install before applying any user-specified name transformations.
-transform = s/ginstall/install/; @program_transform_name@
+transform = s/ginstall/install/; $(program_transform_name)
ginstall_SOURCES = install.c prog-fprintf.c $(copy_sources)
# This is for the '[' program. Automake transliterates '[' to '_'.
@@ -427,3 +427,36 @@ sc_tight_scope: $(all_programs)
| grep -Ev -f $$t && \
{ echo 'the above variables should have static scope' 1>&2; \
exit 1; } || :
+
+.PHONY: cu-install-binPROGRAMS
+install-exec-am:
+ @case '$(program_transform_name):$(EXEEXT)' in \
+ 's,x,x,:') cu=cu-;; *) cu= ;; esac; \
+ $(MAKE) $(AM_MAKEFLAGS) binPROGRAMS_INSTALL=./ginstall \
+ $${cu}install-binPROGRAMS
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+
+# The following rule is used only when --program-transform-name
+# has not been used and there is no .exe "extension".
+# Override the automake-generated rule so that we can install
+# all binaries with a single install command. However, ...
+# install ginstall and [ separately. "ginstall" because we rename
+# it to "install", and "[" because using it unquoted will cause a
+# syntax error with some shells. Be careful to install each of these
+# exceptions only if it is to be installed (i.e., not excluded via
+# --enable-no-install-program=PROG_LIST.
+filtered_PROGS = \
+ `echo "$(bin_PROGRAMS)" | sed 's/ *\<ginstall\> */ /;s/ *\[ */ /'`
+d_bindir = $(DESTDIR)$(bindir)
+cu-install-binPROGRAMS: $(bin_PROGRAMS)
+ $(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(d_bindir)"
+ test x = 'x$(bin_PROGRAMS)' && exit || :
+ case '$(bin_PROGRAMS)' in *\[*) \
+ echo "$(binPROGRAMS_INSTALL) '[' '$(d_bindir)/['"; \
+ $(binPROGRAMS_INSTALL) '[' '$(d_bindir)/[';; esac
+ case '$(bin_PROGRAMS)' in *ginstall*) \
+ echo "$(binPROGRAMS_INSTALL) ginstall '$(d_bindir)/install'";\
+ $(binPROGRAMS_INSTALL) ginstall '$(d_bindir)/install';; esac
+ $(binPROGRAMS_INSTALL) $(filtered_PROGS) '$(d_bindir)'