Move parent from ext/ to cpan/
[p5sagit/p5-mst-13.2.git] / Makefile.SH
index f9f9984..58fd626 100644 (file)
@@ -218,7 +218,11 @@ done
 nonxs_list=' '
 for f in $nonxs_ext; do
     p=`echo "$f" | tr / -`
-    nonxs_list="$nonxs_list ext/$p/pm_to_blib"
+    for d in ext dist cpan; do
+       if test -d $d/$p; then
+           nonxs_list="$nonxs_list $d/$p/pm_to_blib"
+       fi
+    done
 done
 
 dtrace_h=''
@@ -473,7 +477,7 @@ obj = $(ndt_obj) $(DTRACE_O)
 perltoc_pod_prereqs = extra.pods pod/perlapi.pod pod/perldelta.pod pod/perlintern.pod pod/perlmodlib.pod
 generated_pods = pod/perltoc.pod $(perltoc_pod_prereqs)
 
-Icwd = -Iext/Cwd -Iext/Cwd/lib
+Icwd = -Icpan/Cwd -Icpan/Cwd/lib
 
 lintflags = \
     -b \
@@ -975,7 +979,7 @@ x2p/s2p: $(MINIPERL_EXE) $(CONFIGPM) $(dynamic_ext) x2p/s2p.PL
 unidatafiles $(unidatafiles): uni.data
 
 uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
-       $(MINIPERL) -Iext/Cwd/lib lib/unicore/mktables -C lib/unicore -w
+       $(MINIPERL) $(Icwd) lib/unicore/mktables -C lib/unicore -w
        touch uni.data
 
 # perl$(EXE_EXT) and ext because buildtoc uses Text::Wrap uses re
@@ -1015,7 +1019,7 @@ extras.install: perl$(EXE_EXT)
        no-install install.perl install.man install.html
 
 META.yml:      Porting/makemeta Porting/Maintainers.pl Porting/Maintainers.pm
-       $(MINIPERL) Porting/makemeta
+       $(PERL) Porting/makemeta
 
 install-strip:
        $(MAKE) STRIPFLAGS=-s install DESTDIR="$(DESTDIR)"
@@ -1222,7 +1226,10 @@ _cleaner1:
        sh $(CLEAN).sh ; \
        fi
        rm -f realclean.sh veryclean.sh
-       -@test ! -f ./$(MINIPERL_EXE) || $(MINIPERL) mkppport --clean
+       -for file in `find cpan dist ext -name ppport.h` ; do rm -f $$file; done
+
+# Dear POSIX, thanks for making the default to xargs to be
+# run once if nothhing is passed in. It is such a great help.
 
 # Some systems do not support "?", so keep these files separate.
 _cleaner2:
@@ -1297,59 +1304,42 @@ depend: makedepend
 makedepend: makedepend.SH config.sh
        sh ./makedepend.SH
 
-.PHONY: test check test_prep test_prep_nodll test_prep_pre _test_prep \
-       test_tty test-tty _test_tty test_notty test-notty _test_notty \
+.PHONY: test check test_prep test_prep_nodll test_prep_pre \
+       test_tty test-tty test_notty test-notty \
        utest ucheck test.utf8 check.utf8 test.torture torturetest \
        test.utf16 check.utf16 utest.utf16 ucheck.utf16 \
        test.third check.third utest.third ucheck.third test_notty.third \
        test.deparse test_notty.deparse test_harness test_harness_notty \
-       minitest coretest test.taintwarn test-reonly
+       minitest coretest test.taintwarn test-reonly _test
+
+_test:
+       echo >&2 The _test target is deprecated. Please upgrade your smoker
+       PERL=./perl ./runtests choose
 
 # Cannot delegate rebuilding of t/perl to make
 # to allow interlaced test and minitest
 
-TESTFILE=TEST
-
-_test_prep:
-       cd t && (rm -f $(PERL)$(EXE_EXT); $(LNS) ../$(PERL)$(EXE_EXT) $(PERL)$(EXE_EXT))
-
 # Architecture-neutral stuff:
 
 test_prep_pre: preplibrary utilities $(nonxs_ext)
 
 test_prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) perl$(EXE_EXT) $(dynamic_ext) $(TEST_PERL_DLL)
-       PERL=./perl $(MAKE) _test_prep
-
-_test_tty:
-       cd t && $(PERL_DEBUG) $(LDLIBPTH) $(PERL) $(TESTFILE) $(TEST_ARGS) $(TEST_FILES) </dev/tty
-
-_test_notty:
-       cd t && $(PERL_DEBUG) PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) $(PERL) $(TESTFILE) $(TEST_ARGS) $(TEST_FILES)
-
-# The second branch is for testing without a tty or controlling terminal,
-# see t/op/stat.t
-_test:
-       if (true </dev/tty) >/dev/null 2>&1; then \
-         $(MAKE) TEST_ARGS='$(TEST_ARGS)' TESTFILE=$(TESTFILE) _test_tty   ; \
-       else \
-         $(MAKE) TEST_ARGS='$(TEST_ARGS)' TESTFILE=$(TESTFILE) _test_notty ; \
-       fi
-       @echo "Ran tests" > t/rantests
+       cd t && (rm -f perl$(EXE_EXT); $(LNS) ../perl$(EXE_EXT) perl$(EXE_EXT))
 
 test check: test_prep
-       PERL=./perl $(MAKE) _test
+       ./runtests choose
 
 test_tty: test_prep
-       PERL=./perl $(MAKE) _test_tty
+       ./runtests tty
 
 test_notty: test_prep
-       PERL=./perl $(MAKE) _test_notty
+       ./runtests no-tty
 
 utest ucheck test.utf8 check.utf8: test_prep
-       PERL=./perl TEST_ARGS=-utf8 $(MAKE) _test
+       TEST_ARGS=-utf8 ./runtests choose
 
 coretest: test_prep
-       PERL=./perl TEST_ARGS=-core $(MAKE) _test
+       TEST_ARGS=-core ./runtests choose
 
 test-prep:     test_prep
 
@@ -1360,7 +1350,7 @@ test-notty:       test_notty
 # Torture testing
 
 test.torture torturetest:      test_prep
-       PERL=./perl TEST_ARGS=-torture $(MAKE) _test
+       TEST_ARGS=-torture ./runtests choose
 
 # Targets for UTF16 testing:
 
@@ -1369,51 +1359,50 @@ minitest.utf16: minitest.prep
                && $(LDLIBPTH) $(RUN) ./perl TEST -minitest -utf16 base/*.t comp/*.t cmd/*.t run/*.t io/*.t op/*.t uni/*.t </dev/tty
 
 test.utf16 check.utf16: test_prep
-       PERL=./perl $(MAKE) TEST_ARGS=-utf16 _test
+       TEST_ARGS=-utf16 ./runtests choose
 
 utest.utf16 ucheck.utf16: test_prep
-       PERL=./perl $(MAKE) TEST_ARGS="-utf8 -utf16" _test
+       TEST_ARGS="-utf8 -utf16" ./runtests choose
 
 # Targets for valgrind testing:
 
 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 VALGRIND='$(VALGRIND)' $(MAKE) _test
+       PERL_VALGRIND=1 VALGRIND='$(VALGRIND)' ./runtests choose
 
 utest.valgrind ucheck.valgrind: test_prep.valgrind perl.valgrind.config
-       PERL=./perl PERL_DEBUG=PERL_VALGRIND=1 TEST_ARGS=-utf8 $(MAKE) _test
+       PERL_VALGRIND=1 TEST_ARGS=-utf8 ./runtests choose
 
 test_notty.valgrind: test_prep.valgrind perl.valgrind.config
-       PERL=./perl $(MAKE) PERL_DEBUG=PERL_VALGRIND=1 _test_notty
+       PERL_VALGRIND=1 ./runtests no-tty
 
 # Targets for Third Degree testing.
 
 test_prep.third: test_prep perl.third
-       PERL=./perl.third $(MAKE) _test_prep
+       cd t && (rm -f ./perl.third$(EXE_EXT); $(LNS) ../perl.third$(EXE_EXT) perl.third(EXE_EXT))
 
 test.third check.third:        test_prep.third perl.third
-       PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 $(MAKE) _test
+       PERL=./perl.third PERL_3LOG=1 ./runtests choose
 
 utest.third ucheck.third: test_prep.third perl.third
-       PERL=./perl.third PERL_DEBUG=PERL_3LOG=1 TEST_ARGS=-utf8 $(MAKE) _test
+       PERL=./perl.third PERL_3LOG=1 TEST_ARGS=-utf8 ./runtests choose
 
 test_notty.third: test_prep.third perl.third
-       PERL=./perl.third $(MAKE) PERL_DEBUG=PERL_3LOG=1 _test_notty
+       PERL=./perl.third PERL_3LOG=1 ./runtests choose
 
 # Targets for Deparse testing.
 
 test.deparse:  test_prep
-       PERL=./perl TEST_ARGS=-deparse $(MAKE) _test
+       TEST_ARGS=-deparse ./runtests choose
 
 test_notty.deparse:    test_prep
-       PERL=./perl TEST_ARGS=-deparse $(MAKE) _test_notty
+       TEST_ARGS=-deparse ./runtests no-tty
 
 # Targets to run the test suite with -t
 
 test.taintwarn:        test_prep
-       PERL=./perl TEST_ARGS=-taintwarn $(MAKE) _test
+       TEST_ARGS=-taintwarn ./runtests choose
 
 minitest.prep:
        -@test test -f lib/Config.pm || $(MAKE) lib/Config.pm $(unidatafiles)
@@ -1431,13 +1420,13 @@ minitest: $(MINIPERL_EXE) lib/re.pm minitest.prep
 # Test via harness
 
 test_harness: test_prep
-       PERL=./perl $(MAKE) TESTFILE=harness _test
+       TESTFILE=harness ./runtests choose
 
 test_harness_notty: test_prep
-       PERL=./perl HARNESS_NOTTY=1 $(MAKE) TESTFILE=harness _test
+       HARNESS_NOTTY=1 TESTFILE=harness ./runtests choose
 
 test-reonly: test_prep
-       PERL=./perl TEST_ARGS='-re \\bre\\/' $(MAKE) TESTFILE=harness _test
+       TEST_ARGS='-re \bre\/' TESTFILE=harness ./runtests choose
 
 # Handy way to run perlbug -ok without having to install and run the
 # installed perlbug. We don't re-run the tests here - we trust the user.