Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
A few Makefile improvements
  • Loading branch information
chrisdolan committed Feb 19, 2009
1 parent 248146a commit 020d701
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
37 changes: 17 additions & 20 deletions Makefile
@@ -1,51 +1,48 @@
PERL = perl
PARROTDIR = ../..
PARROT = $(PARROTDIR)/parrot
MERGEPBC = $(PARROTDIR)/pbc_merge
PCTDIR = $(PARROTDIR)/runtime/parrot/library
PCTPBC = $(PCTDIR)/PCT.pbc
PERL6DIR = ../rakudo
PERL6PBC = $(PERL6DIR)/perl6.pbc
ENV = env PERL6LIB='./t:./lib:$(PERL6DIR):$(PCTDIR)'
ENV = env PERL6LIB='./t:./lib:$(PCTDIR)'
PERL6 = $(ENV) $(PARROT) $(PERL6PBC)
CP = $(PERL) -MExtUtils::Command -e cp

PM = $(shell ls lib/Perk/*.pm lib/Perk/*/*.pm)
PIR = $(PM:.pm=.pir)
PBC = $(PM:.pm=.pbc) $(T:.t=.pbc)

all: build

check:
@ [ -e $(PARROT) ] || ( echo "Missing $(PARROT)" ; exit 1 )

prebuild: check $(PIR)

build: prebuild perk.pbc
perk.pir: perk.pl
$(PERL6) --target=pir --output=$@ $<
build: perk.pbc perl6.pbc
perk.pir: $(PIR) perk.pl
$(PERL6) --target=pir --output=$@ perk.pl

#perk.pbc: perk.pir $(PERL6PBC) $(PCTPBC)
# $(PARROT) -o perk_tmp.pbc perk.pir
# $(MERGEPBC) -o $@ perk_tmp.pbc $(PERL6PBC) $(PCTPBC)
# $(RM) perk_tmp.pbc

# Copy perl6.pbc to the local dir because the inc path doesn't seem to work...
perl6.pbc: $(PERL6PBC)
$(CP) $< $@

test: build
$(ENV) perl t/harness
$(ENV) $(PERL) t/harness
test-parse: build
$(ENV) perl t/harness --target=parse
$(ENV) $(PERL) t/harness --target=parse
test-past: build
$(ENV) perl t/harness --target=past
$(ENV) $(PERL) t/harness --target=past
test-pir: build
$(ENV) perl t/harness --target=pir
$(ENV) $(PERL) t/harness --target=pir

clean: cleanpir cleanpbc
cleanpir:
$(RM) $(PIR)
cleanpbc:
$(RM) $(PBC)
clean:
$(RM) $(PIR) $(PBC) perk.pbc perk.pir

%.pir: %.pm $(PERL6PBC)
$(PERL6) --target=pir --output=$@ $<
%.pbc: %.pir
$(PARROT) -o $@ $<

.PHONY: all check test test-parse test-pir test-past build prebuild clean cleanpir cleanpbc
.PHONY: all check test test-parse test-pir test-past build clean
1 change: 1 addition & 0 deletions t/harness
Expand Up @@ -29,6 +29,7 @@ my $parrot = File::Spec->catfile('..', '..', 'parrot');
for my $test (sort @tests) {
print "==== $test ====\n";
my @cmd = ($parrot, 'perk.pbc', @ARGV, $test);
#print " cmd: env PERL6LIB=$ENV{PERL6LIB} @cmd\n";
print " cmd: @cmd\n";
system(@cmd);
}

0 comments on commit 020d701

Please sign in to comment.