This repository has been archived by the owner on Jun 9, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re-run tools/dev/mk_language_shell.pl
- Loading branch information
Showing
3 changed files
with
144 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
Makefile | ||
|
||
*.pbc | ||
*.c | ||
*.o | ||
*.obj | ||
*.exe | ||
markdown | ||
installable_markdown | ||
|
||
man | ||
|
||
src/gen_*.pir | ||
|
||
t/*.text | ||
t/*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,66 @@ | ||
# $Id$ | ||
# Copyright (C) 2009, Parrot Foundation. | ||
# $Id$ | ||
|
||
use strict; | ||
use warnings; | ||
use 5.008; | ||
|
||
my $build_dir = '../..'; | ||
my $hll = 'markdown'; | ||
my $cmd = qq{$^X -Ilib tools/dev/reconfigure.pl --step=gen::languages --languages=$hll}; | ||
# Get a list of parrot-configs to invoke. | ||
my @parrot_config_exe = ( | ||
'parrot/parrot_config', | ||
'../../parrot_config', | ||
'parrot_config', | ||
); | ||
|
||
# Get configuration information from parrot_config | ||
my %config = read_parrot_config(@parrot_config_exe); | ||
unless (%config) { | ||
die "Unable to locate parrot_config."; | ||
} | ||
|
||
# Create the Makefile using the information we just got | ||
create_makefiles(%config); | ||
|
||
print "Running '$cmd' in $build_dir\n"; | ||
chdir $build_dir; | ||
`$cmd` | ||
sub read_parrot_config { | ||
my @parrot_config_exe = @_; | ||
my %config = (); | ||
for my $exe (@parrot_config_exe) { | ||
no warnings; | ||
if (open my $PARROT_CONFIG, '-|', "$exe --dump") { | ||
print "Reading configuration information from $exe\n"; | ||
while (<$PARROT_CONFIG>) { | ||
$config{$1} = $2 if (/(\w+) => '(.*)'/); | ||
} | ||
close $PARROT_CONFIG; | ||
last if %config; | ||
} | ||
} | ||
%config; | ||
} | ||
|
||
|
||
# Generate Makefiles from a configuration | ||
sub create_makefiles { | ||
my %config = @_; | ||
my %makefiles = ( | ||
'config/makefiles/root.in' => 'Makefile', | ||
# 'config/makefiles/pmc.in' => 'src/pmc/Makefile', | ||
# 'config/makefiles/ops.in' => 'src/ops/Makefile', | ||
); | ||
my $build_tool = $config{libdir} . $config{versiondir} | ||
. '/tools/dev/gen_makefile.pl'; | ||
|
||
foreach my $template (keys %makefiles) { | ||
my $makefile = $makefiles{$template}; | ||
print "Creating $makefile\n"; | ||
system($config{perl}, $build_tool, $template, $makefile); | ||
} | ||
} | ||
|
||
# Local Variables: | ||
# mode: cperl | ||
# cperl-indent-level: 4 | ||
# fill-column: 100 | ||
# End: | ||
# vim: expandtab shiftwidth=4: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters