In perl.git, the branch smoke-me/Makefile-norecurse has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/c66fb86289e09716893afdc43ebea09ee2535977?hp=63c6c7fd05a8e3406dd98c1929cf7673253f5b0d>

- Log -----------------------------------------------------------------
commit c66fb86289e09716893afdc43ebea09ee2535977
Author: Nicholas Clark <[email protected]>
Date:   Wed Apr 25 22:33:47 2012 +0200

    Move the /usr/bin/atom detection logic from the Makefile to Makefile.SH.
    
    Makefile.SH was simply spitting out a Makefile rule which used shell 
commands
    to determine whether /usr/bin/atom exists, and then call back to the 
Makefile
    to execute either the target perl.pixie.irix or perl.pixie.atom for the
    actual rule appropriate for the platform.
    
    /usr/bin/atom won't appear or disappear between make runs, so move the shell
    logic into Makefile.SH and write out the appropriate rule directly. This
    eliminates two more calls from Makefile back to itself.

M       Makefile.SH

commit 6b989e2c17adb1c01989bc4df201121c6e1ce93e
Author: Nicholas Clark <[email protected]>
Date:   Wed Apr 25 22:21:07 2012 +0200

    In Makefile.SH, inline perl.config.dashpg into perl.gprof.config
    
    perl.gprof.config is the only user of the target perl.config.dashpg
    This eliminates 1 recursive call from the Makefile to itself, and makes
    the structure for the perl.gprof target analogous to that of the
    perl.gcov target.

M       Makefile.SH

commit 2f1d0b8dd983836e0c253cbbc68957cefe6e1bbf
Author: Nicholas Clark <[email protected]>
Date:   Wed Apr 25 22:00:09 2012 +0200

    Don't call CPAN to install and "extra" modules for the install-notify 
target.
    
    Previously the Makefile's install-notify target built extra.install just 
like
    the other 5 install targets. However, the other 5 actually install perl,
    whereas install-notify (a.k.a. no-install) runs installperl and installman
    with the --notify option (formerly -n), to cause them to print what they 
would
    do but take no action. Hence if -Dextras was used, make no-install would
    actually install the extra modules, but nothing else. This is inconsistent.

M       Makefile.SH

commit d11c615c9666253072703a04ea5b014803417d96
Author: Nicholas Clark <[email protected]>
Date:   Wed Apr 25 20:04:08 2012 +0200

    Inline the Makefile rule for extra.install into all 6 targets which use it.
    
    This eliminates 6 recursive calls from Makefile to itself.
    
    Additionally, if the user has specified extra modules to download and build
    from CPAN using Configure's -Dextra, this avoids building perl, the non-XS
    modules and the CPAN modules twice on make install.

M       Makefile.SH

commit 37a0f2688833a34cb40e391526e00f2b15956661
Author: Nicholas Clark <[email protected]>
Date:   Wed Apr 25 18:28:39 2012 +0200

    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.

M       Makefile.SH

commit 1dfa5b7491b7b7dc78d30a14267e1f77badd0e88
Author: Nicholas Clark <[email protected]>
Date:   Wed Apr 25 18:05:24 2012 +0200

    In Makefile.SH, use the long names for options passed to install{perl,man}
    
    This makes it clearer what is going on, and enables a simplifying 
refactoring.

M       Makefile.SH

commit 98dfedd034257e4fcb5d99acaae2b26cb19a2837
Author: Nicholas Clark <[email protected]>
Date:   Tue Apr 24 18:41:47 2012 +0200

    Refactor the Makefile so that the install target depends on install-all.
    
    Also, add targets install_notify and install-notify, as synonyms for
    no_install and no-install. Previously install, install-all and install_all
    were all generated by the same rule.
    
    These changes make future refactoring easier.

M       Makefile.SH

commit c54695d0962b1cdbdfb4174addaf2107ac0dc867
Author: Nicholas Clark <[email protected]>
Date:   Wed Apr 25 15:48:33 2012 +0200

    Add a no-op option --strip to installman.
    
    This intentionally does nothing.
    
    --strip for installperl instructs it to strip the installed binaries. Hence
    by permitting installman to accept --strip without error Makefile.SH can be
    simplified, as it's possible to pass identical flags to both install 
scripts.

M       installman
-----------------------------------------------------------------------

Summary of changes:
 Makefile.SH |   59 +++++++++++++++++++++++++++++++----------------------------
 installman  |    5 ++++-
 2 files changed, 35 insertions(+), 29 deletions(-)

diff --git a/Makefile.SH b/Makefile.SH
index ba5ab79..52605f5 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -938,31 +938,30 @@ perl.pixie.config: config.sh
        @echo "To build perl.pixie you must Configure -Doptimize=-g, 
checking..."
        @$(MAKE) perl.config.dashg
 
-perl.pixie.atom: /usr/bin/atom perl
-       atom -tool pixie -L. -all -toolargs="-quiet" perl
-
-perl.pixie.irix: perl
-       pixie perl
+!NO!SUBS!
 
+if test -x /usr/bin/atom; then
+    $spitshell >>$Makefile <<'!NO!SUBS!'
+perl.pixie: /usr/bin/atom /usr/bin/pixie perl.pixie.config perl
+       atom -tool pixie -L. -all -toolargs="-quiet" perl
+!NO!SUBS!
+else
+    $spitshell >>$Makefile <<'!NO!SUBS!'
 perl.pixie: /usr/bin/pixie perl.pixie.config perl
-       if test -x /usr/bin/atom; then \
-         $(MAKE) perl.pixie.atom; \
-       else \
-         $(MAKE) perl.pixie.irix; \
-       fi
+       pixie perl
+!NO!SUBS!
+fi
+$spitshell >>$Makefile <<'!NO!SUBS!'
        @echo "Now you may run perl.pixie and then run pixie."
 
 # Gprof Perl
 
-perl.config.dashpg:
+perl.gprof.config: config.sh
+       @echo "To build perl.gprof you must Configure -Doptimize=-pg, 
checking..."
        @echo "Checking optimize='-pg' in config.sh..."
        @grep "^optimize="      config.sh
        @grep "^optimize='.*-pg.*'" config.sh >/dev/null || exit 1
 
-perl.gprof.config: config.sh
-       @echo "To build perl.gprof you must Configure -Doptimize=-pg, 
checking..."
-       @$(MAKE) perl.config.dashpg
-
 perl.gprof: /usr/bin/gprof perl.gprof.config
        @-rm -f perl
        $(MAKE) PERL_SUFFIX=.gprof PERL_PROFILE_LDFLAGS=-pg perl
@@ -1082,27 +1081,31 @@ 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=-s install DESTDIR="$(DESTDIR)"
+# Set this to an empty string to avoid an attempt of rebuild before install
+INSTALL_DEPENDENCE = all
 
-install install_all install-all:
-       $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) 
DESTDIR="$(DESTDIR)"
+no_install no-install: install-notify
 
-install_verbose install-verbose:
-       $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) 
INSTALLFLAGS=-V DESTDIR="$(DESTDIR)"
+install: install-all
+!NO!SUBS!
 
-install_silent install-silent:
-       $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) 
INSTALLFLAGS=-S DESTDIR="$(DESTDIR)"
+for name in all notify silent strip verbose; do
+    flags="--$name";
+    $spitshell >>$Makefile <<EOT
 
-no_install no-install:
-       $(MAKE) install.perl install.man STRIPFLAGS=$(STRIPFLAGS) 
INSTALLFLAGS=-n DESTDIR="$(DESTDIR)"
+install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman
+       \$(RUN_PERL) installperl --destdir=\$(DESTDIR) ${flags%--all} 
\$(INSTALLFLAGS) \$(STRIPFLAGS)
+       \$(RUN_PERL) installman --destdir=\$(DESTDIR) ${flags%--all}
+EOT
 
-# Set this to an empty string to avoid an attempt of rebuild before install
-INSTALL_DEPENDENCE = all
+    test $name = notify || echo '      -@test ! -s extras.lst || 
PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(RUN_PERL) -Ilib -MCPAN -e 
'\''@ARGV&&install(@ARGV)'\'' `cat extras.lst`' >>$Makefile
+done
+
+$spitshell >>$Makefile <<'!NO!SUBS!'
 
 install.perl:  $(INSTALL_DEPENDENCE) installperl
        $(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) 
$(STRIPFLAGS)
-       -@test ! -s extras.lst || $(MAKE) extras.install
+       -@test ! -s extras.lst || PATH="`pwd`:\${PATH}" PERL5LIB="`pwd`/lib" 
\$(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
 
 install.man:   all installman
        $(RUN_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
diff --git a/installman b/installman
index 73cf9e2..59903e4 100755
--- a/installman
+++ b/installman
@@ -36,9 +36,12 @@ my $usage =
         --verbose (or -V) report all progress.
         --silent  (or -S) be silent. Only report errors.\n";
 
+# --strip intentionally does nothing. By permitting installman to accept it
+# without error, the Makefile can pass the same options to installperl and
+# installman, which permits more simplification there than this comment costs.
 GetOptions( \%opts,
             qw( man1dir=s man1ext=s man3dir=s man3ext=s
-                destdir:s notify|n help|h|? silent|S verbose|V))
+                destdir:s notify|n help|h|? silent|S verbose|V strip))
        || die $usage;
 die $usage if $opts{help};
 $opts{destdir} //= '';

--
Perl5 Master Repository

Reply via email to