From 291c8c21fa7694b3f01d0795030f8057228e1db2 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 30 Jan 2012 12:01:08 +0100 Subject: Add a dependency for ext/Pod-Functions/Functions_pm.PL on pod/perlfunc.pod This ensures that it gets re-run, and lib/Pod/Functions.pm rebuilt, if perlfunc.pod is changed. --- Makefile.SH | 2 +- ext/Pod-Functions/Makefile.PL | 20 +++++++++++++++++++- vms/descrip_mms.template | 2 +- win32/Makefile | 2 +- win32/makefile.mk | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/Makefile.SH b/Makefile.SH index d579deed2b..0c96f97492 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -178,7 +178,7 @@ done dynamic_list=' ' dynamic_ext_re="lib/auto/re/re.$dlext" extra_dep=' -ext/Pod-Functions/pm_to_blib: cpan/Pod-Simple/pm_to_blib +ext/Pod-Functions/pm_to_blib: cpan/Pod-Simple/pm_to_blib pod/perlfunc.pod ' for f in $dynamic_ext; do : the dependency named here will never exist diff --git a/ext/Pod-Functions/Makefile.PL b/ext/Pod-Functions/Makefile.PL index 64936dc840..ae6dca38d2 100644 --- a/ext/Pod-Functions/Makefile.PL +++ b/ext/Pod-Functions/Makefile.PL @@ -2,6 +2,7 @@ use strict; use ExtUtils::MakeMaker; +use File::Spec::Functions; WriteMakefile(NAME => 'Pod::Functions', VERSION_FROM => 'Functions_pm.PL', @@ -10,7 +11,24 @@ WriteMakefile(NAME => 'Pod::Functions', ABSTRACT_FROM => 'Functions_pm.PL', AUTHOR => 'Perl 5 Porters ', INSTALLDIRS => 'perl', - PL_FILES => {'Functions_pm.PL' => 'Functions.pm'}, + PL_FILES => {}, # Stop EU::MM defaulting this to run our PL PM => {'Functions.pm' => '$(INST_LIBDIR)/Functions.pm'}, clean => {FILES => 'Functions.pm'}, ); + +# There doesn't seem to be any way to get ExtUtils::MakeMaker to add a +# dependency on another file (or target), and as it's using :: rules, not : +# rules, then we can't simply add a one line dependency. So we need to provide +# the entire thing. Fortunately, the same code in MM_Unix.pm is actually used +# for all platforms, so this code below should also be portable: + +sub MY::postamble { + my $pf = catfile(updir, updir, 'pod', 'perlfunc.pod'); + return <<"EOT"; +all :: Functions.pm + \$(NOECHO) \$(NOOP) + +Functions.pm :: Functions_pm.PL $pf + \$(PERLRUN) Functions_pm.PL $pf +EOT +} diff --git a/vms/descrip_mms.template b/vms/descrip_mms.template index 1e17a39aba..cf30131609 100644 --- a/vms/descrip_mms.template +++ b/vms/descrip_mms.template @@ -468,7 +468,7 @@ DynaLoader$(O) : [.lib]buildcustomize.pl $(ARCHDIR)Config.pm $(MINIPERL_EXE) [.l dynext : $(LIBPREREQ) $(DBG)perlshr$(E) unidatafiles.ts DynaLoader$(O) preplibrary makeppport $(MINIPERL_EXE) $(MINIPERL) make_ext.pl "MAKE=$(MMS)" "--dynamic" "--static" -nonxsext : $(LIBPREREQ) preplibrary $(MINIPERL_EXE) +nonxsext : $(LIBPREREQ) preplibrary $(MINIPERL_EXE) [.pod]perlfunc.pod $(MINIPERL) make_ext.pl "MAKE=$(MMS)" "--nonxs" [.lib.VMS]Filespec.pm : [.vms.ext]Filespec.pm diff --git a/win32/Makefile b/win32/Makefile index 3efc70e494..4e81bd0d27 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -1010,7 +1010,7 @@ Extensions_static : ..\make_ext.pl ..\lib\buildcustomize.pl list_static_libs.pl $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static -Extensions_nonxs: ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) +Extensions_nonxs: ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) ..\pod\perlfunc.pod $(XCOPY) ..\*.h $(COREDIR)\*.* $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs diff --git a/win32/makefile.mk b/win32/makefile.mk index 939ac4b403..32cfbf16e0 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1198,7 +1198,7 @@ Extensions_static : ..\make_ext.pl ..\lib\buildcustomize.pl list_static_libs.pl $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static -Extensions_nonxs : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) +Extensions_nonxs : ..\make_ext.pl ..\lib\buildcustomize.pl $(PERLDEP) $(CONFIGPM) ..\pod\perlfunc.pod $(XCOPY) ..\*.h $(COREDIR)\*.* $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --nonxs -- cgit v1.2.1