Skip to content

Commit

Permalink
[bf] modernize infrastructure with setup.pir (distutils)
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Nov 22, 2009
1 parent 4348920 commit 943e040
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 267 deletions.
66 changes: 0 additions & 66 deletions Configure.pl

This file was deleted.

6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ DESCRIPTION

This is a Brainfuck interpreter for Parrot. Brainfuck is a full
computer programming language with only eight commands. For more
information, see http://www.catseye.mb.ca/esoteric/bf/ or
information, see http://www.catseye.mb.ca/esoteric/bf/ or
http://en.wikipedia.org/wiki/Brainfuck.

To compile the files:

$ make
$ parrot setup.pir

To check that the compiler is working:

$ make test
$ parrot setup.pir test

To run an example Brainfuck program:

Expand Down
164 changes: 0 additions & 164 deletions config/makefiles/root.in

This file was deleted.

62 changes: 62 additions & 0 deletions setup.pir
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#! /usr/local/bin/parrot
# Copyright (C) 2009, Parrot Foundation.
# $Id$

=head1 NAME

setup.pir - Python distutils style

=head1 DESCRIPTION

No Configure step, no Makefile generated.

=head1 USAGE

$ parrot setup.pir build
$ parrot setup.pir test
$ sudo parrot setup.pir install

=cut

.sub 'main' :main
.param pmc args
$S0 = shift args
load_bytecode 'distutils.pbc'

$P0 = new 'Hash'
$P0['name'] = 'bf'
$P0['abstract'] = 'Brainfuck'
$P0['description'] = 'This is a Brainfuck interpreter for Parrot.'
$P0['license_type'] = 'Artistic License 2.0'
$P0['license_uri'] = 'http://www.perlfoundation.org/artistic_license_2_0'
$P0['copyright_holder'] = 'Parrot Foundation'
$P0['generated_by'] = 'Francois Perrad <francois.perrad@gadz.org>'
$P0['checkout_uri'] = 'https://svn.parrot.org/languages/bf/trunk'
$P0['browser_uri'] = 'https://trac.parrot.org/languages/browser/bf'
$P0['project_uri'] = 'https://trac.parrot.org/parrot/wiki/Languages'

# build
$P1 = new 'Hash'
$P1['bf.pbc'] = 'bf.pasm'
$P1['bfc.pbc'] = 'bfc.pir'
$P1['bfco.pbc'] = 'bfco.pir'
$P0['pbc_pir'] = $P1

$P2 = new 'Hash'
$P2['parrot-bf'] = 'bf.pbc'
$P2['parrot-bfc'] = 'bfc.pbc'
$P2['parrot-bfco'] = 'bfco.pbc'
$P0['installable_pbc'] = $P2

# test
$S0 = get_parrot()
$P0['prove_exec'] = $S0

.tailcall setup(args :flat, $P0 :flat :named)
.end

# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
31 changes: 0 additions & 31 deletions t/harness

This file was deleted.

6 changes: 5 additions & 1 deletion t/test_bf.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
# Test bf compiler
# Print TAP, Test Anything Protocol

system( "../parrot -r bf/bf.pbc bf/test.bf" );
.sub 'main' :main
$S0 = 'parrot -r bf.pbc test.bf'
$I0 = spawnw $S0
.end
6 changes: 5 additions & 1 deletion t/test_bfc.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
# Test bf interpreter
# Print TAP, Test Anything Protocol

system( "../parrot -r bf/bfc.pbc bf/test.bf" );
.sub 'main' :main
$S0 = 'parrot -r bfc.pbc test.bf'
$I0 = spawnw $S0
.end
6 changes: 5 additions & 1 deletion t/test_bfco.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
# Test bf interpreter
# Print TAP, Test Anything Protocol

system( "../parrot -r bf/bfco.pbc bf/test.bf" );
.sub 'main' :main
$S0 = 'parrot -r bfco.pbc test.bf'
$I0 = spawnw $S0
.end

0 comments on commit 943e040

Please sign in to comment.