From: Nicholas Clark Date: Sat, 31 Jan 2009 13:56:28 +0000 (+0000) Subject: Make dir and target --options to buildext.pl. Update the documentation. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a76ca1adb00f0a79fbb2893732a88fcd33fce31;p=p5sagit%2Fp5-mst-13.2.git Make dir and target --options to buildext.pl. Update the documentation. --- diff --git a/win32/Makefile b/win32/Makefile index 69f8c78..d5389d5 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)" $(EXTDIR) --dynamic + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynamic Extensions_reonly: buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --dynamic +re + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynamic +re Extensions_static : buildext.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --static + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --static $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static Extensions_clean: - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --all clean + -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --all --target=clean Extensions_realclean: - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --all realclean + -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --all --target=realclean #------------------------------------------------------------------------------- diff --git a/win32/buildext.pl b/win32/buildext.pl index e7e32ed..fbc82de 100644 --- a/win32/buildext.pl +++ b/win32/buildext.pl @@ -4,17 +4,17 @@ buildext.pl - build extensions =head1 SYNOPSIS - buildext.pl make [-make_opts] directory [target] [--static|--dynamic|--all] +ext2 !ext1 + buildext.pl "MAKE=make [-make_opts]" --dir=directory [--target=target] [--static|--dynamic|--all] +ext2 !ext1 E.g. - buildext.pl nmake -nologo ..\ext + buildext.pl "MAKE=nmake -nologo" --dir=..\ext - buildext.pl nmake -nologo ..\ext clean + buildext.pl "MAKE=nmake -nologo" --dir=..\ext --target=clean - buildext.pl dmake ..\ext + buildext.pl MAKE=dmake --dir=..\ext - buildext.pl dmake ..\ext clean + buildext.pl MAKE=dmake --dir=..\ext --target=clean Will skip building extensions which are marked with an '!' char. Mostly because they still not ported to specified platform. @@ -46,6 +46,8 @@ foreach (@ARGV) { $incl{$1} = 1; } elsif (/^--([\w\-]+)$/) { $opts{$1} = 1; + } elsif (/^--([\w\-]+)=(.*)$/) { + $opts{$1} = $2; } else { push @argv, $_; } @@ -55,16 +57,16 @@ my $static = $opts{static} || $opts{all}; my $dynamic = $opts{dynamic} || $opts{all}; my $makecmd = shift @argv; -my $dir = shift @argv; -my $targ = shift @argv; +my $dir = $opts{dir} || 'ext'; +my $targ = $opts{target}; my $make; if (defined($makecmd) and $makecmd =~ /^MAKE=(.*)$/) { $make = $1; } else { - print "ext/util/make_ext: WARNING: Please include MAKE=\$(MAKE)\n"; - print "\tin your call to make_ext. See ext/util/make_ext for details.\n"; + print "$0: WARNING: Please include MAKE=\$(MAKE)\n"; + print "\tin your call to buildext.pl. See buildext.pl for details.\n"; exit(1); } @@ -84,11 +86,12 @@ unless (-f "$pl2bat.bat") { system(@args) unless defined $::Cross::platform; } +print "In ", getcwd(); chdir($dir) || die "Cannot cd to $dir\n"; (my $ext = getcwd()) =~ s{/}{\\}g; my $code; FindExt::scan_ext($ext); -FindExt::set_static_extensions(split ' ', $Config{static_ext}) if $ext ne "ext"; +FindExt::set_static_extensions(split ' ', $Config{static_ext}); my @ext; push @ext, FindExt::static_ext() if $static; diff --git a/win32/makefile.mk b/win32/makefile.mk index a01421f..7f9c6a0 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)" $(EXTDIR) --dynamic + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynamic Extensions_reonly : buildext.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --dynamic +re + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --dynamic +re Extensions_static : buildext.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM) $(XCOPY) ..\*.h $(COREDIR)\*.* - $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --static + $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --static $(MINIPERL) -I..\lib list_static_libs.pl > Extensions_static Extensions_clean : - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) --all clean + -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --all --target=clean Extensions_realclean : - -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" $(EXTDIR) realclean + -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl "MAKE=$(MAKE)" --dir=$(EXTDIR) --target=realclean #-------------------------------------------------------------------------------