From: Nicholas Clark Date: Fri, 30 Jan 2009 17:53:45 +0000 (+0000) Subject: Replace the one file timestamp dependency check with a call to 'make config' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=42fe6305f0858c20b777cec2d43a7e452f8c6168;p=p5sagit%2Fp5-mst-13.2.git Replace the one file timestamp dependency check with a call to 'make config' The timestamp check was from the original checkin of buidlext.pl in 2001 (17af6fb0658e86e2f4a472e3392fc688e0c25b43) by Nick I-S. The 'make config' approach of make_ext was in the 5.000 release. --- diff --git a/win32/Makefile b/win32/Makefile index 178517f..69f8c78 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -1063,22 +1063,22 @@ MakePPPort_clean: #------------------------------------------------------------------------------- Extensions: buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) --dynamic + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --dynamic Extensions_reonly: buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) --dynamic +re + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --dynamic +re Extensions_static : buildext.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) --static + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --static $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static Extensions_clean: - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) --all clean + -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --all clean Extensions_realclean: - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) --all realclean + -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --all realclean #------------------------------------------------------------------------------- diff --git a/win32/buildext.pl b/win32/buildext.pl index eb676f2..e7e32ed 100644 --- a/win32/buildext.pl +++ b/win32/buildext.pl @@ -4,17 +4,17 @@ buildext.pl - build extensions =head1 SYNOPSIS - buildext.pl make [-make_opts] dep directory [target] [--static|--dynamic|--all] +ext2 !ext1 + buildext.pl make [-make_opts] directory [target] [--static|--dynamic|--all] +ext2 !ext1 E.g. - buildext.pl nmake -nologo perldll.def ..\ext + buildext.pl nmake -nologo ..\ext - buildext.pl nmake -nologo perldll.def ..\ext clean + buildext.pl nmake -nologo ..\ext clean - buildext.pl dmake perldll.def ..\ext + buildext.pl dmake ..\ext - buildext.pl dmake perldll.def ..\ext clean + buildext.pl dmake ..\ext clean Will skip building extensions which are marked with an '!' char. Mostly because they still not ported to specified platform. @@ -55,7 +55,6 @@ my $static = $opts{static} || $opts{all}; my $dynamic = $opts{dynamic} || $opts{all}; my $makecmd = shift @argv; -my $dep = shift @argv; my $dir = shift @argv; my $targ = shift @argv; @@ -85,7 +84,6 @@ unless (-f "$pl2bat.bat") { system(@args) unless defined $::Cross::platform; } -my $dmod = -M $dep; chdir($dir) || die "Cannot cd to $dir\n"; (my $ext = getcwd()) =~ s{/}{\\}g; my $code; @@ -109,8 +107,7 @@ foreach $dir (sort @ext) } if (chdir("$ext\\$dir")) { - my $mmod = -M 'Makefile'; - if (!(-f 'Makefile') || $mmod > $dmod) + if (!-f 'Makefile') { print "\nRunning Makefile.PL in $dir\n"; my @perl = ($perl, "-I$here\\..\\lib", 'Makefile.PL', @@ -124,12 +121,13 @@ foreach $dir (sort @ext) print join(' ', @perl), "\n"; $code = system(@perl); warn "$code from $dir\'s Makefile.PL" if $code; - $mmod = -M 'Makefile'; - if ($mmod > $dmod) - { - warn "Makefile $mmod > $dmod ($dep)\n"; - } } + if (!$targ or $targ !~ /clean$/) { + # Give makefile an opportunity to rewrite itself. + # reassure users that life goes on... + system("$make config") + and print "$make config failed, continuing anyway...\n"; + } if ($targ) { print "Making $targ in $dir\n$make $targ\n"; diff --git a/win32/makefile.mk b/win32/makefile.mk index 7cfd451..a01421f 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1389,22 +1389,22 @@ MakePPPort_clean: #------------------------------------------------------------------------------- Extensions : buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) --dynamic + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --dynamic Extensions_reonly : buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) --dynamic +re + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --dynamic +re Extensions_static : buildext.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) --static + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --static $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static Extensions_clean : - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) --all clean + -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --all clean Extensions_realclean : - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(PERLDEP) $(EXTDIR) realclean + -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) realclean #-------------------------------------------------------------------------------