This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Generate utils/Makefile from utils/Makefile.PL, and remove it at clean time.
authorNicholas Clark <nick@ccl4.org>
Wed, 3 Jul 2013 20:50:08 +0000 (22:50 +0200)
committerNicholas Clark <nick@ccl4.org>
Sun, 7 Jul 2013 10:42:02 +0000 (12:42 +0200)
Add rules to the Win32 Makefiles to call utils/Makefile.PL to generate
utils/Makefile, and rules to both them and the *nix Makefile to delete
the generated file as part of the cleanup targets.

VMS continues to do its own thing, rather than using utils/Makefile.

MANIFEST
Makefile.SH
Porting/makerel
utils/Makefile [deleted file]
utils/Makefile.PL
win32/Makefile
win32/makefile.mk

index a0ed4d1..4ed41e3 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -5438,7 +5438,6 @@ utils/instmodsh.PL                Give information about installed extensions
 utils/json_pp.PL               JSON::PP command line utility
 utils/libnetcfg.PL             libnet
 utils.lst                      Lists utilities bundled with Perl
-utils/Makefile                 Pregenerated from utils/Makefile.SH
 utils/Makefile.PL              Extract the utility scripts
 utils/perlbug.PL               A simple tool to submit a bug report
 utils/perldoc.PL               A simple tool to find & display perl's documentation
index ccc857c..2d5006d 100755 (executable)
@@ -1247,7 +1247,7 @@ _cleaner2:
        rm -rf t/tmp*
        rm -f so_locations $(LIBPERL_NONSHR) $(MINIPERL_NONSHR)
        rm -rf $(addedbyconf)
-       rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old
+       rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old makefile.old utils/Makefile
        rm -f $(private)
        rm -rf $(unidatafiles) $(unidatadirs)
        rm -rf lib/auto
index 8822aff..9e6779f 100755 (executable)
@@ -160,7 +160,6 @@ my @writables = qw(
     win32/config_H.ce
     win32/config_H.gc
     win32/config_H.vc
-    utils/Makefile
     uconfig.h
 );
 system("chmod u+w @writables") == 0
diff --git a/utils/Makefile b/utils/Makefile
deleted file mode 100644 (file)
index f8934e8..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-# Generated from utils/Makefile.SH.  The generated file is
-# shipped with the source kit for systems such as win32
-# which don't do .SH extraction.
-
-PERL = ../miniperl
-REALPERL = ../perl
-RUN =   # Used mainly cross-compilation setups.
-
-
-# Files to be built with variable substitution after miniperl is
-# available.  Dependencies handled manually below (for now).
-
-pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL ptargrep.PL shasum.PL splain.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL pod2html.PL zipdetails.PL
-plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc perlivp pl2pm prove ptar ptardiff ptargrep shasum splain libnetcfg piconv enc2xs xsubpp pod2html zipdetails
-plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep ./shasum ./splain ./libnetcfg ./piconv ./enc2xs ./xsubpp ./pod2html ./zipdetails
-
-all: $(plextract) 
-
-$(plextract):
-       $(RUN) $(PERL) -I../lib $@.PL
-
-c2ph:          c2ph.PL ../config.sh
-
-cpan:          cpan.PL ../config.sh
-
-config_data:   config_data.PL ../config.sh
-
-corelist:      corelist.PL ../config.sh
-
-h2ph:          h2ph.PL ../config.sh
-
-h2xs:          h2xs.PL ../config.sh
-
-instmodsh:     instmodsh.PL ../config.sh
-
-json_pp:       json_pp.PL ../config.sh
-
-perlbug:       perlbug.PL ../config.sh ../patchlevel.h
-
-perldoc:       perldoc.PL ../config.sh
-
-perlivp:       perlivp.PL ../config.sh
-
-prove:         prove.PL ../config.sh
-
-ptar:          ptar.PL ../config.sh
-
-ptardiff:      ptardiff.PL ../config.sh
-
-ptargrep:      ptargrep.PL ../config.sh
-
-pl2pm:         pl2pm.PL ../config.sh
-
-shasum:                shasum.PL ../config.sh
-
-splain:                splain.PL ../config.sh ../lib/diagnostics.pm
-
-libnetcfg:     libnetcfg.PL ../config.sh
-
-piconv:                piconv.PL ../config.sh
-
-enc2xs:                enc2xs.PL ../config.sh
-
-xsubpp:                xsubpp.PL ../config.sh
-
-zipdetails:    zipdetails.PL ../config.sh
-
-pod2html:      pod2html.PL ../config.sh ../ext/Pod-Html/bin/pod2html
-
-clean:
-
-realclean:
-       rm -rf $(plextract) pstruct $(plextractexe)
-       rm -f ../t/_h2ph_pre.ph
-
-clobber:       realclean
-
-distclean:     clobber
-
-veryclean:     distclean
-       -rm -f *~ *.org
index 7e33806..c5e3694 100644 (file)
@@ -7,21 +7,23 @@ if (@ARGV) {
     chdir $dir or die "Can't chdir '$dir': $!";
 }
 
+# Note, the generated utils/Makefile isn't used by VMS yet.
+# The next step on cleaning this is up is probably to work to reduce the size
+# of the "problem" in both this file and vms/descrip_mms.template by
+# attempting to move the work from them to the extension directories and
+# ExtUtils::MakeMaker.
+
 require 'regen/regen_lib.pl';
 
 my $target = 'utils/Makefile';
 print "Extracting $target (with variable substitutions)\n";
-my $fh = open_new($target, undef, undef, 1);
+my $fh = open_new($target, undef, {by => $0}, 1);
 
 # These use the Cwd extension.  For statically-built perls, we
 # need perl, not just miniperl.
 my $perl = defined $Config{usedl} ? '../miniperl' : '../perl';
 
 print $fh <<"EOT";
-# Generated from utils/Makefile.SH.  The generated file is
-# shipped with the source kit for systems such as win32
-# which don't do .SH extraction.
-
 PERL = $perl
 REALPERL = ../perl
 RUN = $Config{run}  # Used mainly cross-compilation setups.
@@ -104,4 +106,4 @@ veryclean:  distclean
        -rm -f *~ *.org
 EOT
 
-close_and_rename($fh);
+read_only_bottom_close_and_rename($fh);
index deec493..521db48 100644 (file)
@@ -1115,10 +1115,13 @@ doc: $(PERLEXE) ..\pod\perltoc.pod
            --podpath=pod:lib:utils --htmlroot="file://$(INST_HTML::=|)" \
            --recurse
 
+..\utils\Makefile: $(CONFIGPM) ..\utils\Makefile.PL
+       $(MINIPERL) -I..\lib ..\utils\Makefile.PL ..
+
 # Note that this next section is parsed (and regenerated) by pod/buildtoc
 # so please check that script before making structural changes here
 
-utils: $(PERLEXE) $(X2P)
+utils: $(PERLEXE) $(X2P) ..\utils\Makefile
        cd ..\utils
        $(MAKE) PERL=$(MINIPERL)
        cd ..\pod
@@ -1269,6 +1272,7 @@ distclean: realclean
        -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
        -cd $(DISTDIR) && del /s *.def Makefile Makefile.old
        -cd $(CPANDIR) && del /s *.def Makefile Makefile.old
+       -del /s ..\utils\Makefile
        -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
        -if exist $(COREDIR) rmdir /s /q $(COREDIR)
        -if exist pod2htmd.tmp del pod2htmd.tmp
index c6a23fd..6a9d620 100644 (file)
@@ -1295,9 +1295,12 @@ doc: $(PERLEXE) ..\pod\perltoc.pod
            --podpath=pod:lib:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
            --recurse
 
+..\utils\Makefile: $(CONFIGPM) ..\utils\Makefile.PL
+       $(MINIPERL) -I..\lib ..\utils\Makefile.PL ..
+
 # Note that this next section is parsed (and regenerated) by pod/buildtoc
 # so please check that script before making structural changes here
-utils: $(PERLEXE) $(X2P)
+utils: $(PERLEXE) $(X2P) ..\utils\Makefile
        cd ..\utils && $(MAKE) PERL=$(MINIPERL)
        copy ..\README.aix      ..\pod\perlaix.pod
        copy ..\README.amiga    ..\pod\perlamiga.pod
@@ -1445,6 +1448,7 @@ distclean: realclean
        -cd $(EXTDIR) && del /s *.def Makefile Makefile.old
        -cd $(DISTDIR) && del /s *.def Makefile Makefile.old
        -cd $(CPANDIR) && del /s *.def Makefile Makefile.old
+       -del /s ..\utils\Makefile
        -if exist $(AUTODIR) rmdir /s /q $(AUTODIR)
        -if exist $(COREDIR) rmdir /s /q $(COREDIR)
        -if exist pod2htmd.tmp del pod2htmd.tmp