Treat all arguments that /=/ as passthrough, the rest being extensions.
This will converge the argument passing conventions for make_ext.pl and
win32/buildext.pl
$(DYNALOADER): preplibrary FORCE
- @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
d_dummy $(dynamic_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE
- @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross --target=dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE
- @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary $(DYNALOADER) FORCE
- @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ @$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --cross --target=nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
!NO!SUBS!
$spitshell >>$Makefile <<EOF
# DynaLoader may be needed for extensions that use Makefile.PL.
$(DYNALOADER): miniperl$(EXE_EXT) preplibrary FORCE
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
d_dummy $(dynamic_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
s_dummy $(static_ext): miniperl$(EXE_EXT) preplibrary makeppport $(DYNALOADER) FORCE
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=$(STATIC) $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
n_dummy $(nonxs_ext): miniperl$(EXE_EXT) preplibrary FORCE
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=nonxs $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
!NO!SUBS!
$spitshell >>$Makefile <<EOF
-cd x2p; $(LDLIBPTH) $(MAKE) clean
-rm -f lib/Config_git.pl git_version.h
-@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl clean $$x MAKE=$(MAKE) ; \
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=clean $$x MAKE=$(MAKE) ; \
done
_cleaner1:
-cd x2p; $(LDLIBPTH) $(MAKE) $(CLEAN)
-@if test -f miniperl$(EXE_EXT) ; then \
for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
- $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl $(CLEAN) $$x MAKE=$(MAKE) ; \
+ $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_ext.pl --target=$(CLEAN) $$x MAKE=$(MAKE) ; \
done ; \
else \
sh $(CLEAN).sh ; \
# It primarily used by the perl Makefile:
#
# d_dummy $(dynamic_ext): miniperl preplibrary FORCE
-# @$(RUN) ./miniperl ext/util/make_ext.pl dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
+# @$(RUN) ./miniperl make_ext.pl --target=dynamic $@ MAKE=$(MAKE) LIBPERL_A=$(LIBPERL)
#
# It may be deleted in a later release of perl so try to
# avoid using it for other purposes.
-my (%excl, %incl, %opts, @argv);
+my (%excl, %incl, %opts, @extspec, @passthrough);
foreach (@ARGV) {
if (/^!(.*)$/) {
$incl{$1} = 1;
} elsif (/^--([\w\-]+)$/) {
$opts{$1} = 1;
+ } elsif (/^--([\w\-]+)=(.*)$/) {
+ $opts{$1} = $2;
+ } elsif (/^--([\w\-]+)=(.*)$/) {
+ $opts{$1} = $2;
+ } elsif (/=/) {
+ push @passthrough, $_;
} else {
- push @argv, $_;
+ push @extspec, $_;
}
}
-my $target = shift @argv;
-my $extspec = shift @argv;
-my $makecmd = shift @argv; # Should be something like MAKE=make
-my $passthru = join ' ', @argv; # allow extra macro=value to be passed through
+my $target = $opts{target};
+my $extspec = $extspec[0];
+my $makecmd = shift @passthrough; # Should be something like MAKE=make
+my $passthru = join ' ', @passthrough; # allow extra macro=value to be passed through
print "\n";
# Previously, $make was taken from config.sh. However, the user might