Skip to content

Commit

Permalink
Don't compile what's alredy up-to-date (why doesn't it always work?)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeusz Sośnierz committed Sep 11, 2010
1 parent e4f6d7d commit 7a5debc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions README
Expand Up @@ -3,3 +3,4 @@ Docs and more fun on the way.

TODO:
M::Build -- compile only if .pir is older than .pm
update: semi-works (wth?)
6 changes: 4 additions & 2 deletions lib/Module/Build.pm
Expand Up @@ -69,8 +69,10 @@ sub build(Str $dir = '.', Str $binary = 'perl6', :$v) is export {
}

for @order».&module-name-to-path -> $module {
my $command = "$binary --target=PIR --output={
$module.subst(/\.pm6?/, ".pir")} $module";
my $pir = $module.subst(/\.pm6?/, ".pir");
next if ($pir.IO ~~ :f &&
$pir.IO.stat.modifytime > $module.IO.stat.modifytime);
my $command = "$binary --target=PIR --output=$pir $module";
say $command if $v.defined;
run $command and die "Failed building $module"
}
Expand Down

0 comments on commit 7a5debc

Please sign in to comment.