Skip to content
This repository
Browse code

Change search path for Parrot: auto-find it in sibling Rakudo subdir

  • Loading branch information...
commit fb6400e5cd626bacd4d65b9d00bcf158982105ea 1 parent dc4fd26
Chris Dolan authored February 22, 2009

Showing 2 changed files with 11 additions and 8 deletions. Show diff stats Hide diff stats

  1. 14  Makefile
  2. 5  t/harness
14  Makefile
... ...
@@ -1,5 +1,7 @@
1 1
 PERL      = perl
2  
-PARROTDIR = ../..
  2
+
  3
+# Look for parrot in sibling Rakudo subdir, or own subdir, or up two (indicating we're in parrot/languages/perk)
  4
+PARROTDIR = $(shell $(PERL) -le'print -e "../rakudo/parrot/parrot" ? "../rakudo/parrot" : -e "parrot/parrot" ? "parrot" : "../.."')
3 5
 PARROT    = $(PARROTDIR)/parrot
4 6
 MERGEPBC  = $(PARROTDIR)/pbc_merge
5 7
 PCTDIR    = $(PARROTDIR)/runtime/parrot/library
@@ -28,14 +30,16 @@ perk.pir:	$(PIR) perk.pl $(PERL6PBC)
28 30
 $(PERL6PBC):	$(PERL6DIR)/perl6.pbc Makefile
29 31
 	$(CP) $< $@
30 32
 
  33
+TEST_HARNESS = $(ENV) PARROTEXE=$(PARROT) $(PERL) t/harness
  34
+
31 35
 test:	build
32  
-	$(ENV) $(PERL) t/harness
  36
+	$(TEST_HARNESS)
33 37
 test-parse:	build
34  
-	$(ENV) $(PERL) t/harness --target=parse
  38
+	$(TEST_HARNESS) --target=parse
35 39
 test-past:	build
36  
-	$(ENV) $(PERL) t/harness --target=past
  40
+	$(TEST_HARNESS) --target=past
37 41
 test-pir:	build
38  
-	$(ENV) $(PERL) t/harness --target=pir
  42
+	$(TEST_HARNESS) --target=pir
39 43
 
40 44
 clean:
41 45
 	$(RM) $(PIR) $(PBC) perk.pbc perk.pir perl6.pbc
5  t/harness
@@ -7,10 +7,11 @@ use strict;
7 7
 use warnings;
8 8
 use 5.008;
9 9
 
10  
-use lib qw( . lib ../lib ../../lib ../../lib );
11 10
 use File::Find qw(find);
12 11
 use File::Spec;
13 12
 
  13
+my $parrot = $ENV{PARROTEXE} || File::Spec->catfile('..', '..', 'parrot');
  14
+
14 15
 my @tests;
15 16
 find({wanted => sub {
16 17
    return unless m/\.java\z/;
@@ -25,11 +26,9 @@ find({wanted => sub {
25 26
    }
26 27
 }, no_chdir => 1}, 't');
27 28
 
28  
-my $parrot = File::Spec->catfile('..', '..', 'parrot');
29 29
 for my $test (sort @tests) {
30 30
    print "==== $test ====\n";
31 31
    my @cmd = ($parrot, 'perk.pbc', @ARGV, $test);
32  
-   #print "  cmd: env PERL6LIB=$ENV{PERL6LIB} @cmd\n";
33 32
    print "  cmd: @cmd\n";
34 33
    system(@cmd);
35 34
 }

0 notes on commit fb6400e

Please sign in to comment.
Something went wrong with that request. Please try again.