diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-04-25 18:28:39 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-07-13 12:32:14 +0200 |
commit | 07f58f840247dc1b28a31da1bab0207872fdce2e (patch) | |
tree | da34614d343e4bd2dde091b06f1286a878d083c6 /Makefile.SH | |
parent | 97f2b15752001f1cd927e4b339e45c5d631ba590 (diff) | |
download | perl-07f58f840247dc1b28a31da1bab0207872fdce2e.tar.gz |
Refactor Makefile.SH to generate the install-* targets in a loop.
This slightly reduces the line count, merges five-fold duplication into one,
and works toward removing 5 recursive calls from Makefile to itself.
Diffstat (limited to 'Makefile.SH')
-rwxr-xr-x | Makefile.SH | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/Makefile.SH b/Makefile.SH index 0a9660e051..42dc12af1b 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -1006,27 +1006,26 @@ extras.install: $(PERL_EXE) .PHONY: install install-strip install-all install-verbose install-silent \ no-install install.perl install.man install.html -install_strip install-strip: - $(MAKE) STRIPFLAGS=--strip install DESTDIR="$(DESTDIR)" - -install_all install-all: - $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) DESTDIR="$(DESTDIR)" - -install_verbose install-verbose: - $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=--verbose DESTDIR="$(DESTDIR)" - -install_silent install-silent: - $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=--silent DESTDIR="$(DESTDIR)" - -install_notify install-notify: - $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) INSTALLFLAGS=--notify DESTDIR="$(DESTDIR)" - # Set this to an empty string to avoid an attempt of rebuild before install INSTALL_DEPENDENCE = all no_install no-install: install-notify install: install-all +!NO!SUBS! + +for name in all notify silent strip verbose; do + flags="--$name"; + $spitshell >>$Makefile <<EOT + +install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman + \$(RUN_PERL) installperl --destdir=\$(DESTDIR) ${flags%--all} \$(INSTALLFLAGS) \$(STRIPFLAGS) + -@test ! -s extras.lst || \$(MAKE) extras.install + \$(RUN_PERL) installman --destdir=\$(DESTDIR) ${flags%--all} +EOT +done + +$spitshell >>$Makefile <<'!NO!SUBS!' install.perl: $(INSTALL_DEPENDENCE) installperl $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS) |