This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In the Makefile, generate the value of shextract programmatically.
authorNicholas Clark <nick@ccl4.org>
Wed, 15 May 2013 14:54:40 +0000 (16:54 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 20 May 2013 19:50:45 +0000 (21:50 +0200)
shextract lists the files generated by shell scripts named *.SH which need
deleting. Instead of maintaining it by hand, generate it in Makefile.SH from
the list of *.SH files.

This indirectly eliminates the last reference to F<makedir>. makedir.SH
was eliminated by commit ebca06e95b02d1a8 and the reference to makedir.SH in
Makefile.SH eliminated by commit 847471027aa42997 (both Sept 2009), but
that commit missed that the reference to makedir a few lines later was
related.

Makefile.SH

index 720075e..91ad66a 100755 (executable)
@@ -443,16 +443,24 @@ xconfig.h: config_h.SH Cross/config-\$(CROSS_NAME).sh
        ;;
 esac
 
+SH='Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH pod/Makefile.SH'
+shextract=`echo $SH | sed -e s/\\\.SH//g -e s/_/./g`
+
+
 ## In the following dollars and backticks do not need the extra backslash.
-$spitshell >>$Makefile <<'!NO!SUBS!'
+$spitshell >>$Makefile <<!GROK!THIS!
 
-private = preplibrary $(CONFIGPM) $(CONFIGPOD) lib/ExtUtils/Miniperl.pm git_version.h lib/buildcustomize.pl
+private = preplibrary \$(CONFIGPM) \$(CONFIGPOD) lib/ExtUtils/Miniperl.pm git_version.h lib/buildcustomize.pl
 
 # Files to be built with variable substitution before miniperl
 # is available.
-sh = Makefile.SH cflags.SH config_h.SH makedepend.SH myconfig.SH pod/Makefile.SH
+sh = $SH
 
-shextract = Makefile cflags config.h makedepend makedir myconfig pod/Makefile
+shextract = $shextract
+!GROK!THIS!
+
+## In the following dollars and backticks do not need the extra backslash.
+$spitshell >>$Makefile <<'!NO!SUBS!'
 
 addedbyconf = UU $(shextract) pstruct