This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Stop 'sub a { // }; %::=()' panicing because the backreference array
[perl5.git] / Makefile.SH
index 12555da..d7e39dd 100644 (file)
@@ -255,6 +255,10 @@ LIB_EXT = $_a
 OBJ_EXT = $_o
 PATH_SEP = $p_
 
+# If you're going to use valgrind and it can't be invoked as plain valgrind
+# then you'll need to change this, or override it on the make command line.
+VALGRIND=valgrind
+
 FIRSTMAKEFILE = $firstmakefile
 
 # Any special object files needed by this architecture, e.g. os2/os2.obj
@@ -648,7 +652,7 @@ perl.valgrind.config: config.sh
        @grep "^usemymalloc="    config.sh
        @grep "^usemymalloc='n'" config.sh >/dev/null || exit 1
        @echo "And of course you have to have valgrind..."
-       valgrind ./perl -e 1 2>/dev/null || exit 1
+       $(VALGRIND) ./perl -e 1 2>/dev/null || exit 1
 
 # Third Degree Perl (Tru64 only)
 
@@ -792,7 +796,7 @@ uni.data: miniperl$(EXE_EXT) $(CONFIGPM) lib/unicore/mktables
        touch uni.data
 
 extra.pods: miniperl$(EXE_EXT)
-       -@test -f extra.pods && rm -f `cat extra.pods`
+       -@test ! -f extra.pods || rm -f `cat extra.pods`
        -@rm -f extra.pods
        -@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
            nx=`echo $$x | sed -e "s/README\.//"`; \
@@ -803,14 +807,15 @@ extra.pods: miniperl$(EXE_EXT)
        -@test -f vms/perlvms.pod && cd pod && $(LNS) ../vms/perlvms.pod perlvms.pod && cd .. && echo "pod/perlvms.pod" >> extra.pods
        -@rm -f pod/perldelta.pod
        -@test -f pod/perl593delta.pod && cd pod && $(LNS) perl593delta.pod perldelta.pod && cd .. && echo "pod/perldelta.pod" >> extra.pods # See buildtoc
+
 extras.make: perl$(EXE_EXT)
-       -@test -s extras.lst && PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`
+       -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&make(@ARGV)' `cat extras.lst`
 
 extras.test: perl$(EXE_EXT)
-       -@test -s extras.lst && PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst`
+       -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&test(@ARGV)' `cat extras.lst`
 
 extras.install: perl$(EXE_EXT)
-       -@test -s extras.lst && PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
+       -@test ! -s extras.lst || PATH="`pwd`:${PATH}" PERL5LIB="`pwd`/lib" $(LDLIBPTH) ./perl -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
 
 .PHONY: install install-strip install-all install-verbose install-silent \
        no-install install.perl install.man install.html
@@ -1164,7 +1169,7 @@ test_prep.valgrind: test_prep perl.valgrind
        PERL=./perl $(MAKE) _test_prep
 
 test.valgrind check.valgrind:  test_prep perl.valgrind.config
-       PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 $(MAKE) _test
+       PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' $(MAKE) _test
 
 utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind
        PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 TEST_ARGS=-utf8 $(MAKE) _test