Skip to content

Commit

Permalink
refactor with the opcode load_language
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Sep 20, 2009
1 parent 2dfe9b5 commit a262bbd
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 46 deletions.
22 changes: 22 additions & 0 deletions blizkost.pir
@@ -0,0 +1,22 @@
=head1 TITLE

blizkost.pir - A entry point

=cut

.sub 'main' :main
.param pmc args

load_language 'perl5'

$P0 = compreg 'perl5'
$P1 = $P0.'command_line'(args)
.end


# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:

47 changes: 18 additions & 29 deletions build/Makefile.in
Expand Up @@ -13,9 +13,6 @@ LOAD_EXT := @load_ext@
O := @o@

# Various paths
PERL6GRAMMAR := $(LIB_DIR)/library/PGE/Perl6Grammar.pbc
NQP := $(LIB_DIR)/languages/nqp/nqp.pbc
PCT := $(LIB_DIR)/library/PCT.pbc
PMC_DIR := src/pmc

## Setup some commands
Expand Down Expand Up @@ -46,19 +43,17 @@ PMC_DEPS := \
$(PMC_DIR)/p5scalar.pmc \
$(PMC_DIR)/p5sub.pmc

SOURCES := \
perl5.pir

DOCS := README

BUILD_CLEANUPS := \
perl5.pbc \
"src/gen_*.pir" \
perl5/perl5.pbc \
blizkost.pbc \
"*.c" \
"*$(O)" \
blizkost@exe@ \
#IF(win32): parrot-blizkost.exe \
#IF(win32): parrot-blizkost.iss \
#IF(win32): *.bak \
#IF(win32): "setup-parrot-*.exe" \
installable_blizkost@exe@

Expand All @@ -67,34 +62,28 @@ TEST_CLEANUPS :=
# the default target
build: \
$(BLIZKOST_GROUP) \
perl5.pbc
perl5/perl5.pbc \
blizkost.pbc

all: build blizkost@exe@ installable

perl5.pbc: $(SOURCES)
$(PARROT) $(PARROT_ARGS) -o perl5.pbc perl5.pir
perl5/perl5.pbc: src/perl5.pir
$(PARROT) $(PARROT_ARGS) -o perl5/perl5.pbc src/perl5.pir

blizkost.pbc: blizkost.pir
$(PARROT) $(PARROT_ARGS) -o blizkost.pbc blizkost.pir

blizkost@exe@: perl5.pbc
$(PBC_TO_EXE) perl5.pbc
$(CP) perl5@exe@ blizkost@exe@
$(RM_F) perl5@exe@
$(CHMOD) 0775 blizkost@exe@
blizkost@exe@: blizkost.pbc
$(PBC_TO_EXE) blizkost.pbc
#IF(win32): copy $(BIN_DIR)\libparrot.dll .

$(BLIZKOST_GROUP): $(PMC_DEPS)
$(MAKE) $(PMC_DIR)


src/gen_builtins.pir: build/gen_builtins_pir.pl
$(PERL) build/gen_builtins_pir.pl $(BUILTINS_PIR) > src/gen_builtins.pir

installable: installable_blizkost@exe@

installable_blizkost@exe@: perl5.pbc
$(PBC_TO_EXE) perl5.pbc --install
$(CP) installable_perl5@exe@ installable_blizkost@exe@
$(RM_F) installable_perl5@exe@
$(CHMOD) 0775 installable_blizkost@exe@
installable_blizkost@exe@: blizkost.pbc
$(PBC_TO_EXE) blizkost.pbc --install

Makefile: build/Makefile.in
$(PERL) Configure.pl
Expand Down Expand Up @@ -137,7 +126,7 @@ install: installable
$(CP) installable_blizkost@exe@ $(BIN_DIR)/parrot-blizkost@exe@
$(CHMOD) 0755 $(BIN_DIR)/parrot-blizkost@exe@
-$(MKPATH) $(LIB_DIR)/languages/perl5
$(CP) perl5.pbc $(LIB_DIR)/languages/perl5/perl5.pbc
$(CP) perl5/perl5.pbc $(LIB_DIR)/languages/perl5/perl5.pbc
-$(MKPATH) $(MANDIR)/man1
-$(MKPATH) $(DOC_DIR)/languages/perl5
$(CP) $(DOCS) $(DOC_DIR)/languages/perl5
Expand All @@ -155,9 +144,9 @@ win32-inno-installer: installable
# -$(MKPATH) man/html
# pod2html --infile doc/running.pod --outfile man/html/parrot-blizkost.html
$(CP) installable_blizkost@exe@ parrot-blizkost.exe
$(PERL) -I$(LIB_DIR)/tools/lib $(LIB_DIR)/tools/dev/mk_inno_language.pl blizkost
$(PERL) -i.bak -pe "s|languages\\blizkost|languages\\perl5|" parrot-blizkost.iss
iscc parrot-blizkost.iss
$(PERL) -I$(LIB_DIR)/tools/lib $(LIB_DIR)/tools/dev/mk_inno_language.pl perl5
$(PERL) -i.bak -pe "s|\-perl5|-blizkost|; s|\-Perl5|-Blizkost|;" parrot-perl5.iss
iscc parrot-perl5.iss

testclean:
$(RM_F) $(TEST_CLEANUPS)
Expand Down
2 changes: 2 additions & 0 deletions perl5/.gitignore
@@ -0,0 +1,2 @@

*.pbc
17 changes: 1 addition & 16 deletions perl5.pir → src/perl5.pir
Expand Up @@ -32,21 +32,6 @@ Creates the compiler using a C<PCT::HLLCompiler> object.
.end


=item main(args :slurpy) :main

Start compilation by passing any command line C<args>
to the blizkost compiler.

=cut

.sub 'main' :main
.param pmc args

$P0 = compreg 'perl5'
$P1 = $P0.'command_line'(args)
.end


=item make_interp()

=cut
Expand Down Expand Up @@ -80,7 +65,7 @@ to the blizkost compiler.
.param pmc code
.param pmc args :slurpy
.param pmc adverbs :slurpy :named

$P0 = self.'compile'(code, adverbs :flat :named)
($P1 :slurpy, $P2 :slurpy :named) = $P0()
.return ($P1 :flat, $P2 :flat :named)
Expand Down
2 changes: 1 addition & 1 deletion t/harness
Expand Up @@ -8,7 +8,7 @@ use warnings;
use Getopt::Long;
use 5.008;

my $pbc = 'perl5.pbc';
my $pbc = 'blizkost.pbc';

my @tests = (<t/*.t>,<t/*/*.t>, <t/spec/*/*.t>);

Expand Down

0 comments on commit a262bbd

Please sign in to comment.