Along with the previous commit, this enables us to run 'make test'
on the host and have the tests run on the target. We do this by
calling ./Cross/run ./TEST with -cwd $targetdir/t, and setting its
LD_LIBRARY_PATH to $targetdir, so that libperl.so is found.
test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
$(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE=$(MAKE) LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+!NO!SUBS!
+
+case "$targethost" in
+'') $spitshell >>$Makefile <<'!NO!SUBS!'
test check: test_prep
$(RUN_TESTS) choose
+!NO!SUBS!
+;;
+*) $spitshell >>$Makefile <<!GROK!THIS!
+
+test check: test_prep
+ $run -cwd $targetdir/t -env LD_LIBRARY_PATH=$targetdir ./TEST
+
+!GROK!THIS!
+;;
+esac
+
+$spitshell >>$Makefile <<'!NO!SUBS!'
test_tty test-tty: test_prep
$(RUN_TESTS) tty