/
setup.winxed
69 lines (58 loc) · 2.24 KB
/
setup.winxed
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
// Copyright (C) 2012, Parrot Foundation.
// Build system for PACT, using Rosella.Winxed.Distutils
////// Helpers to add a series of steps for a file.
// Prefix arguments should not have .winxed, .pir, etc
// Convert winxed file to a packfile
function pbc_winxed(var pact, string prefix) {
pact['pir_winxed'][prefix+'.pir'] = prefix+'.winxed';
pact['pbc_pir' ][prefix+'.pbc'] = prefix+'.pir';
}
// Create an installable program from winxed
function installable_winxed(var pact, string name, string prefix) {
pbc_winxed(pact, prefix);
pact['installable_pbc'][name] = prefix+'.pbc';
}
// Create an installable library from winxed
function library_winxed(var pact, string prefix) {
pbc_winxed(pact, prefix);
push(pact['inst_lib'], prefix+'.pbc');
}
function main[main](var argv) {
int exit_code = 0;
try {
// Load and setup Rosella.Winxed.Distutils
load_bytecode('rosella/winxed.pbc');
Rosella.Winxed.Distutils.winxed_setup();
// Setup build hash
var pact = {
'name' : 'PACT',
'abstract' : 'Parrot Alternate Compiler Toolkit',
'authority' : 'http://github.com/parrot',
'copyright_holder' : 'Parrot Foundation',
'keywords' : ['compiler'],
'license_type' : 'Artistic License 2.0',
'license_uri' : 'http://www.perlfoundation.org/artistic_license_2_0',
'checkout_uri' : 'git://github.com/parrot/PACT.git',
'browser_uri' : 'http://github.com/parrot/PACT',
'project_uri' : 'http://github.com/parrot/PACT',
'winxed_debug' : false,
'pir_winxed' : {},
'pbc_pir' : {},
'installable_pbc' : {},
'inst_lib' : []
};
library_winxed(pact, 'pact/packfile');
library_winxed(pact, 'pact/packfile/decompile');
installable_winxed(pact, 'pact_disasm', 'src/disasm');
// Invoke distutils
argv.shift();
setup(argv, pact);
} catch (e) {
say(e['message']);
for (string bt in e.backtrace_strings())
say(bt);
exit_code = 1;
}
if (exit_code != 0)
exit(exit_code);
}