Skip to content

Commit

Permalink
add code to generate Parrot version macros as a separate PIR include
Browse files Browse the repository at this point in the history
  • Loading branch information
cotto committed May 11, 2011
1 parent 6032439 commit 51e393d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/gen/makefiles/root.in
Expand Up @@ -875,6 +875,7 @@ $(PROVE) : parrot-prove.pbc $(PARROT) $(PBC_TO_EXE)
$(PBC_TO_EXE) parrot-prove.pbc

$(PARROT_CONFIG) : $(DEV_TOOLS_DIR)/parrot-config.pir $(PARROT) $(PBC_TO_EXE)
$(PERL) tools/build/gen_version.pl >runtime/parrot/include/parrot_version.pir
$(PARROT) -o parrot_config.pbc $(DEV_TOOLS_DIR)/parrot-config.pir
$(PARROT) pbc_to_exe.pbc parrot_config.pbc

Expand Down
40 changes: 40 additions & 0 deletions tools/build/gen_version.pl
@@ -0,0 +1,40 @@
#! perl
# Copyright (C) 2011, Parrot Foundation.

use warnings;
use strict;
use lib 'lib';
use Parrot::SHA1;
use Parrot::Git::Describe;

=head1 NAME
tools/build/gen_version.pl - generate runtime/parrot/include/parrot_version.pir
=head1 SYNOPSIS
% perl tools/build/gen_version.pl >runtime/parrot/include/parrot_version.pir
=head1 DESCRIPTION
Generate C<runtime/parrot/include/parrot_version.pir>, which contains
information about which commit was used to build parrot.
=cut

my $sha1 = $Parrot::SHA1::current;
my $describe = $Parrot::Git::Describe::current;

print <<"PIR";
# generated by tools/build/gen_version.pl
.macro_const PARROT_SHA1 "$sha1"
.macro_const PARROT_GIT_DESCRIBE "$describe"
PIR


# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4:

2 comments on commit 51e393d

@fperrad
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this new generated file runtime/parrot/include/parrot_version.pir is not handled by .gitignore.
(there are many generated files in this directory, with the PASM extension, so rename it to parrot_version.pasm is an option)

this new generated file is not in MANIFEST.generated, so it will not installed.

@cotto
Copy link
Contributor Author

@cotto cotto commented on 51e393d May 15, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing! Both issues are addressed in df3de71.

Please sign in to comment.