/
gen_makefile.pl
48 lines (40 loc) · 1011 Bytes
/
gen_makefile.pl
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
#! perl
# Copyright (C) 2009, Parrot Foundation.
# $Id$
use 5.008;
use strict;
use warnings;
use FindBin qw($Bin);
use lib "$Bin/../lib"; # install location
use lib "$Bin/../../lib"; # build location
use Parrot::Configure;
use Parrot::Configure::Options qw( process_options );
$| = 1; # $OUTPUT_AUTOFLUSH = 1;
my $args = process_options(
{
step => 'gen::makefiles',
mode => 'reconfigure',
}
);
exit(1) unless ( defined $args );
my $template = $ARGV[0];
my $makefile = $ARGV[1];
my $conf = Parrot::Configure->new();
$conf->options->set( %{$args} );
$conf->data()->get_PConfig(); #load configuration data
foreach (@ARGV) {
next unless (/--(\w+)=(\w+)/);
$conf->data->set( $1 => $2 );
}
$conf->genfile(
$template => $makefile,
file_type => 'makefile',
expand_gmake_syntax => 1,
);
exit(0);
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: