Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

enabled build of the modules in lib/

  • Loading branch information...
commit 8918eb5443efe4c9c450a55a759fe85526239469 1 parent 9ad43f2
@masak authored
Showing with 74 additions and 0 deletions.
  1. +2 −0  .gitignore
  2. +46 −0 Makefile.PL
  3. +17 −0 Makefile.in
  4. +9 −0 README
View
2  .gitignore
@@ -0,0 +1,2 @@
+*.pir
+Makefile
View
46 Makefile.PL
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+$|++;
+
+use strict;
+use warnings;
+
+use File::Spec;
+use File::HomeDir;
+
+my $parrot_dir = $ENV{PARROT_DIR}
+ or die 'Please set $PARROT_DIR (see README).'."\n";
+
+$ENV{PERL6LIB}
+ or die 'Please set $PERL6LIB (see README).'."\n";
+
+if ( ! -d $parrot_dir ) {
+ print STDERR "Not a directory $parrot_dir, exiting...\n";
+ exit 1;
+} elsif ( ! -x File::Spec->catfile( $parrot_dir, 'parrot' )) {
+ print STDERR "Couldn't find parrot executable in $parrot_dir, "
+ . "have you compiled?";
+ exit 1;
+}
+
+my @infiles = map { $_.'.in' } qw< Makefile >;
+
+my %replacements = (
+ PARROT_DIR => $parrot_dir,
+);
+
+for my $infile (@infiles) {
+ if ((my $outfile = $infile) =~ s/\.in$//g) {
+ open my $IN, '<', $infile or die "Couldn't open $infile, $!, $?";
+ open my $OUT, '>', $outfile or die "Couldn't open $outfile, $!, $?";
+ while (my $line = <$IN>) {
+ while ( $line =~ /<(.*?)>/g ) {
+ my $repl = $1;
+ if (exists $replacements{$repl}) {
+ $line =~ s/<$repl>/$replacements{$repl}/g;
+ }
+ }
+ print $OUT $line;
+ }
+ print "Created $outfile \n";
+ }
+}
View
17 Makefile.in
@@ -0,0 +1,17 @@
+PARROT_DIR=<PARROT_DIR>
+
+SOURCES=lib/Druid/Game/Observer.pm lib/Druid/Game/Subject.pm \
+ lib/Druid/Game.pm lib/Druid/Board.pm lib/Druid/Board/Text.pm
+
+PIRS=$(SOURCES:.pm=.pir)
+
+all: $(PIRS)
+
+%.pir: %.pm
+ $(PARROT_DIR)/parrot \
+ $(PARROT_DIR)/languages/perl6/perl6.pbc \
+ --target=pir --output=$@ \
+ $<
+
+clean:
+ rm -f $(PIRS)
View
9 README
@@ -42,6 +42,15 @@ Yup, you're ready to go.
% perl6 druid --size=10 --computer=1
% perl6 druid --help
+== For those who want to compile things
+
+% perl Makefile.PL
+% make
+
+Remember that you still need to set $PERL6LIB and $PARROT_DIR as above. The
+file Makefile.PL will complain if you don't. The 'make' process will not
+complain, just fail.
+
== License
This Druid implementation is released under Artistic 2.0. See LICENSE.
Please sign in to comment.
Something went wrong with that request. Please try again.