perl: detect new files in MakeMaker builds
authorJunio C Hamano <gitster@pobox.com>
Fri, 27 Jul 2012 20:04:20 +0000 (20:04 +0000)
committerEric Wong <normalperson@yhbt.net>
Fri, 27 Jul 2012 22:14:02 +0000 (22:14 +0000)
While Makefile.PL now finds .pm files on its own, it does not
detect new files after it generates perl/perl.mak.

[ew: commit message, minor tweaks]

ref: http://mid.gmane.org/7vlii51xz4.fsf@alter.siamese.dyndns.org

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Makefile
perl/.gitignore
perl/Makefile

index b0b3493364550f9f443039708974902df1896413..e2a4ac72439aba7347887e571a7d4541fda287e4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2090,6 +2090,13 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
 ifndef NO_PERL
 $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
 
+perl/perl.mak: perl/PM.stamp
+
+perl/PM.stamp: FORCE
+       $(QUIET_GEN)find perl -type f -name '*.pm' | sort >$@+ && \
+       { cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@; } && \
+       $(RM) $@+
+
 perl/perl.mak: GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL
        $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
 
index d5c6e22d0f74e075a49dd50cde6cbee5049a336c..0f1fc27f862f61015db843f272e61b29c14223af 100644 (file)
@@ -5,3 +5,4 @@ MYMETA.yml
 blib
 blibdirs
 pm_to_blib
+PM.stamp
index 6ca7d472ebad5c93c014ddaac556e6a4f2284990..7667c903d22c625f9c781311f7631870cd02e0d4 100644 (file)
@@ -20,6 +20,9 @@ clean:
        $(RM) ppport.h
        $(RM) $(makfile)
        $(RM) $(makfile).old
+       $(RM) PM.stamp
+
+$(makfile): PM.stamp
 
 ifdef NO_PERL_MAKEMAKER
 instdir_SQ = $(subst ','\'',$(prefix)/lib)