This repository has been archived by the owner on Dec 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.pir
107 lines (84 loc) · 2.13 KB
/
setup.pir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env parrot
# $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'
.local int reqsvn
$P0 = new 'FileHandle'
$P0.'open'('PARROT_REVISION', 'r')
$S0 = $P0.'readline'()
reqsvn = $S0
$P0.'close'()
.local pmc config
config = get_config()
$I0 = config['revision']
unless $I0 goto L1
unless reqsvn > $I0 goto L1
$S1 = "Parrot revision r"
$S0 = reqsvn
$S1 .= $S0
$S1 .= " required (currently r"
$S0 = $I0
$S1 .= $S0
$S1 .= ")\n"
print $S1
end
L1:
$P0 = new 'Hash'
$P0['name'] = 'mantra'
$P0['abstract'] = 'the mantra compiler'
$P0['description'] = 'the mantra for Parrot VM.'
# build
# $P1 = new 'Hash'
# $P1['mantra_ops'] = 'src/ops/mantra.ops'
# $P0['dynops'] = $P1
# $P2 = new 'Hash'
# $P3 = split ' ', 'src/pmc/mantra.pmc'
# $P2['mantra_group'] = $P3
# $P0['dynpmc'] = $P2
$P4 = new 'Hash'
$P4['src/gen_actions.pir'] = 'src/mantra/Actions.pm'
$P4['src/gen_compiler.pir'] = 'src/mantra/Compiler.pm'
$P4['src/gen_grammar.pir'] = 'src/mantra/Grammar.pm'
$P4['src/gen_runtime.pir'] = 'src/mantra/Runtime.pm'
$P0['pir_nqp-rx'] = $P4
$P5 = new 'Hash'
$P6 = split "\n", <<'SOURCES'
src/mantra.pir
src/gen_actions.pir
src/gen_compiler.pir
src/gen_grammar.pir
src/gen_runtime.pir
SOURCES
$S0 = pop $P6
$P5['mantra/mantra.pbc'] = $P6
$P5['mantra.pbc'] = 'mantra.pir'
$P0['pbc_pir'] = $P5
$P7 = new 'Hash'
$P7['parrot-mantra'] = 'mantra.pbc'
$P0['installable_pbc'] = $P7
# test
$S0 = get_parrot()
$S0 .= ' mantra.pbc'
$P0['prove_exec'] = $S0
# install
$P0['inst_lang'] = 'mantra/mantra.pbc'
# dist
$P0['doc_files'] = 'README'
.tailcall setup(args :flat, $P0 :flat :named)
.end
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: