Re: [perl #40817] [TODO] track generated files during the configure/make process

[email protected] (Reini Urban) Wed, 31 Dec 2008 13:41:00 +0100
Newsgroups perl.perl6.internals
Message-ID <[email protected]>
Reini Urban schrieb:
> 2008/12/30 Reini Urban <[email protected]>:
>> 2008/12/30 James Keenan via RT:
>>> On Tue May 06 17:56:23 2008, [email protected] wrote:
>>>> No.  I only figured out how to keep track of files generated during
>>>> configuration, not during build.  We need some of what, IIRC, particle
>>>> termed "makefile trickery" to keep track of files generated by make.
>>> I'm going to relinquish this ticket and give it to Nobody because I
>>> frankly don't have any good ideas on the 'makefile trickery' required to
>>> identify all the files generated during the build process.

Anybody has an idea why compilers/imcc/imclexer.c is in 
MANIFEST.generated, and compilers/imcc/imcparser.{c,h} not?
I believe this is a bug, so I added those two also. But what for?

MANIFEST.generated serves two purposes I guess:

1) Track make generated files to be able to clean them, which are not
    cleaned by wildcards, or by seperate subdir Makefiles. So only
    config/gen/makefiles/root.in generated files.

2) Add all files to be installed, except the languages which have their
    own make install. Except perl6, which is also installed by
    tools/dev/install_files.pl

I rather want to get rid of point 1, this should be cleaned up in the 
Makefile. And adding potentially-to-be-installed installed files 
requires some tools/dev/install_files.pl overrides.

Attached is my current state of affair, but there are still some 
left-over files. So do not apply, I want to clean up the whole mess 
first, so we don't have to deal with a MANIFEST.generated.in for the yet 
untracked files.

The headerizer is also not yet finished.
-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/
40817-MANIFEST-generated.patch (text/x-patch, 60.7 KB)
Index: tools/build/c2str.pl
===================================================================
--- tools/build/c2str.pl	(revision 34627)
+++ tools/build/c2str.pl	(working copy)
@@ -18,6 +18,7 @@
 use Math::BigInt ();
 use Getopt::Long ();
 use IO::File;
+use Parrot::BuildUtil;
 
 my $outfile          = 'all_cstring.str';
 my $string_private_h = 'src/string_private_cstring.h';
@@ -180,6 +181,8 @@
 sub create_c_include {
     open my $OUT, '>', $string_private_h
         or die "Can't write '$string_private_h': $!";
+    add_to_generated($string_private_h,'[main]','include');
+
     print $OUT <<"HEADER";
 /* ex: set ro:
  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
Index: tools/build/headerizer.pl
===================================================================
--- tools/build/headerizer.pl	(revision 34627)
+++ tools/build/headerizer.pl	(working copy)
@@ -65,6 +65,9 @@
 use Getopt::Long;
 use lib qw( lib );
 use Parrot::Config;
+use Parrot::BuildUtil;
+use File::Spec;
+use File::Basename;
 
 my %warnings;
 my %opt;
@@ -177,6 +180,7 @@
     open( my $fhout, '>', $cfile_name ) or die "Can't create $cfile_name: $!";
     print {$fhout} $text;
     close $fhout;
+    add_to_generated($cfile_name,'[main]','headerizer');
 
     return @func_declarations;
 }
@@ -506,6 +510,7 @@
             }
 
             write_file( $hfile, $header );
+	    add_to_generated($hfile, '[main]', 'include-headerizer');
         }
 
         # Update all the .c files in place
@@ -517,6 +522,7 @@
             $source = replace_headerized_declarations( $source, 'static', $cfile, @funcs );
 
             write_file( $cfile, $source );
+	    add_to_generated($cfile, '[main]', 'c-headerizer');
         }
         print "Headerization complete.\n";
     }
Index: tools/build/vtable_extend.pl
===================================================================
--- tools/build/vtable_extend.pl	(revision 34627)
+++ tools/build/vtable_extend.pl	(working copy)
@@ -6,6 +6,7 @@
 
 use lib 'lib';
 use Parrot::Vtable;
+use Parrot::BuildUtil;
 
 my $vtable = parse_vtable('src/vtable.tbl');
 
@@ -21,6 +22,7 @@
 EOH
 
 open my $OUT, '>', 'include/parrot/extend_vtable.h' or die $!;
+add_to_generated('include/parrot/extend_vtable.h','[main]','include');
 
 print $OUT $header, <<'EOF';
 
Index: tools/build/vtable_h.pl
===================================================================
--- tools/build/vtable_h.pl	(revision 34627)
+++ tools/build/vtable_h.pl	(working copy)
@@ -30,11 +30,13 @@
 
 use lib 'lib';
 use Parrot::Vtable;
+use Parrot::BuildUtil;
 
 my $vtable = parse_vtable();
+my $filename = 'include/parrot/vtable.h';
+open my $OUT, '>', $filename or die $!;
+add_to_generated($filename,'[main]','include');
 
-open my $OUT, '>', 'include/parrot/vtable.h' or die $!;
-
 print $OUT <<'EOF';
 /* ex: set ro:
 ** !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
Index: lib/Parrot/Ops2c/Utils.pm
===================================================================
--- lib/Parrot/Ops2c/Utils.pm	(revision 34627)
+++ lib/Parrot/Ops2c/Utils.pm	(working copy)
@@ -8,6 +8,7 @@
 use Parrot::OpsFile;
 use File::Spec;
 use IO::File;
+use Parrot::BuildUtil;
 
 =head1 NAME
 
@@ -249,6 +250,7 @@
 
     open my $HEADER, '>', $self->{header}
         or die "ops2c.pl: Cannot open header file '$self->{header}' for writing: $!!\n";
+    add_to_generated($self->{header},'[main]','include') if $self->{flag}->{core};
 
     $self->_print_guard_prefix($HEADER);
 
@@ -298,6 +300,7 @@
 
     my $source = IO::File->new('>' . $self->{source})
         or die "ops2c.pl: Cannot open source file '$self->{source}' for writing: $!!\n";
+
     $self->print_c_source_top($source);
 
     $self->_reset_line_number($source);
@@ -307,6 +310,7 @@
     $source->close() or die "Unable to close handle to $self->{source}: $!";
 
     my $c_source_final = $self->_rename_source();
+    add_to_generated($c_source_final,'[main]') if $self->{flag}->{core};
     return $c_source_final;
 }
 
Index: lib/Parrot/Ops2pm.pm
===================================================================
--- lib/Parrot/Ops2pm.pm	(revision 34627)
+++ lib/Parrot/Ops2pm.pm	(working copy)
@@ -10,6 +10,7 @@
 use lib qw ( lib );
 use base qw( Parrot::Ops2pm::Base );
 use Parrot::OpsFile;
+use Parrot::BuildUtil;
 
 =head1 NAME
 
@@ -379,6 +380,7 @@
     my $fullpath = File::Spec->catfile( ($fulldir), $self->{inc_f} );
     open my $OUT, '>', $fullpath
         or die "$self->{script}: Could not open module file '$fullpath' for writing: $!!\n";
+    add_to_generated($fullpath,'[main]','include');
 
     print $OUT <<END_C;
 /* ex: set ro:
Index: lib/Parrot/BuildUtil.pm
===================================================================
--- lib/Parrot/BuildUtil.pm	(revision 34627)
+++ lib/Parrot/BuildUtil.pm	(working copy)
@@ -7,16 +7,24 @@
 
 =head1 DESCRIPTION
 
-This package holds three subroutines:  C<parrot_version()>, C<slurp_file>,
-and C<generated_file_header>. Subroutines are not exported--each must be
-requested by using a fully qualified name.
+This package holds five subroutines:  C<parrot_version()>, C<slurp_file>,
+C<generated_file_header> and C<add_to_generated>, C<add_list_to_generated>.
+Only C<add_to_generated()> is exported, the other subroutines are not exported,
+they must be requested by using a fully qualified name.
 
 =cut
 
 package Parrot::BuildUtil;
 use strict;
 use warnings;
+use vars qw( @ISA @EXPORT );
+use Exporter;
+@ISA = qw( Exporter );
+@EXPORT = qw( add_to_generated );
 
+use File::Basename qw/basename/;
+use File::Spec;
+
 =head1 SUBROUTINES
 
 =over 4
@@ -101,7 +109,6 @@
     die "unknown style '$style'"
         if $style !~ m/\A(perl|c)\z/;
 
-    require File::Spec;
     my $script = File::Spec->abs2rel($0);
     $script =~ s/\\/\//g;
 
@@ -126,13 +133,73 @@
     return $header;
 }
 
+=item C<add_to_generated($filename, $section, $dir)>
+
+Adds the filename to MANIFEST.generated into the given section.
+dir is optional.
+
+Note that Parrot::Config might not be generated yet (TBD), so
+we must assure thet the current directory is the the build_dir.
+This is the job of F<tools/build/addgenerated.pl>, but
+within some perl5 modules you must take care.
+
+=cut
+
+sub add_to_generated {
+    my ($filename, $section, $dir) = @_;
+
+    # Support quirky Makefile invocation as
+    #   $(PERL) -Ilib -MParrot::BuildUtil -e add_to_generated "$@",'[main]','lib'
+    ($filename, $section, $dir) = @ARGV unless $filename;
+    if ($filename =~ /,/ and !$section) { # split it here, when the shell is fooled
+	($filename, $section, $dir) = split /,/, $filename;
+    }
+
+    my $path = File::Spec->abs2rel($filename);
+    $path =~ s/\\/\//g;
+    $section = "[library]" unless $section;
+    $dir = "" unless $dir;
+
+    open( my $M, '>>', "MANIFEST.generated" ) or die "open 'MANIFEST.generated': $!";
+    printf $M "%-50s%s%s\n", $path, $section, $dir;
+
+    # Additional .manifest logic on windows and [main]bin
+    if ($section eq '[main]' and $dir eq 'bin' and $^O =~ /cygwin|MSWin32/) {
+	my $base = basename($filename,'.exe');
+	if (-e "$base.manifest") {
+	    my $mpath = File::Spec->abs2rel($base) . ".manifest";
+	    $mpath =~ s/\\/\//g;
+	    printf $M "%-50s%s%s\n", $mpath, $section, $dir;
+	}
+    }
+    close $M;
+    ''
+}
+
+=item C<add_list_to_generated( [$section,] @files)>
+
+Adds the list of filenames to MANIFEST.generated into $section,
+Default: '[library]'.
+
+=cut
+
+sub add_list_to_generated {
+    @_ = @ARGV unless @_;
+    my $section = '';
+    $section = shift @_ if $_[0] =~ /^\[/;
+    add_to_generated($_, $section) for @_;
+}
+
+
 1;
 
 =back
 
 =head1 AUTHOR
 
-Gregor N. Purdy.  Revised by James E Keenan.
+Gregor N. Purdy
+James E Keenan
+Reini Urban
 
 =cut
 
Index: MANIFEST.generated.in
===================================================================
--- MANIFEST.generated.in	(revision 0)
+++ MANIFEST.generated.in	(revision 0)
@@ -0,0 +1,107 @@
+# $Id$
+# See tools/dev/install_files.pl for documentation on the
+# format of this file.
+# The first part is still hand-picked, the rest autogenerated.
+# Please re-sort this file after *EVERY* modification
+compilers/imcc/imclexer.c                         [main]
+compilers/tge/tgc.pir                             [main]
+config/auto/cpu/i386/memcpy_mmx.c                 [main]
+config/auto/cpu/i386/memcpy_sse.c                 [main]
+config/gen/call_list/opengl.in                    [main]
+config/gen/platform/ansi/dl.c                     [main]
+config/gen/platform/ansi/time.c                   [main]
+config/gen/platform/darwin/memalign.c             [main]
+config/gen/platform/generic/stat.c                [main]
+config/gen/platform/win32/stat.c                  [main]
+docs/ops/bit.pod                                  [main]doc
+docs/ops/cmp.pod                                  [main]doc
+docs/ops/core.pod                                 [main]doc
+docs/ops/debug.pod                                [main]doc
+docs/ops/dotgnu.pod                               [main]doc
+docs/ops/experimental.pod                         [main]doc
+docs/ops/io.pod                                   [main]doc
+docs/ops/math.pod                                 [main]doc
+docs/ops/object.pod                               [main]doc
+docs/ops/obscure.pod                              [main]doc
+docs/ops/pic.pod                                  [main]doc
+docs/ops/pmc.pod                                  [main]doc
+docs/ops/python.pod                               [main]doc
+docs/ops/set.pod                                  [main]doc
+docs/ops/stack.pod                                [main]doc
+docs/ops/string.pod                               [main]doc
+docs/ops/sys.pod                                  [main]doc
+docs/ops/var.pod                                  [main]doc
+include/parrot/config.h                           [main]include
+include/parrot/core_pmcs.h                        [main]include
+include/parrot/exec_dep.h                         [main]include
+include/parrot/feature.h                          [main]include
+include/parrot/has_header.h                       [main]include
+include/parrot/platform.h                         [main]include
+include/parrot/platform_interface.h               [main]include
+parrot.pc                                         [main]pkgconfig
+runtime/parrot/dynext/libglutcb.bundle            [library]
+runtime/parrot/dynext/libglutcb.dll               [library]
+runtime/parrot/dynext/libglutcb.dylib             [library]
+runtime/parrot/dynext/libglutcb.so                [library]
+runtime/parrot/dynext/libnci_test.bundle          [library]
+runtime/parrot/dynext/libnci_test.dll             [library]
+runtime/parrot/dynext/libnci_test.dylib           [library]
+runtime/parrot/dynext/libnci_test.so              [library]
+runtime/parrot/include/call_bits.pasm             [main]
+runtime/parrot/include/config.fpmc                [main]
+runtime/parrot/include/errors.pasm                [main]
+runtime/parrot/include/except_severity.pasm       [main]
+runtime/parrot/include/except_types.pasm          [main]
+runtime/parrot/include/iglobals.pasm              [main]
+runtime/parrot/include/interpcores.pasm           [main]
+runtime/parrot/include/interpinfo.pasm            [main]
+runtime/parrot/include/iterator.pasm              [main]
+runtime/parrot/include/opengl_defines.pasm        [main]
+runtime/parrot/include/parrotlib.pbc              [main]
+runtime/parrot/include/signal.pasm                [main]
+runtime/parrot/include/timer.pasm                 [main]
+runtime/parrot/include/vtable_methods.pasm        [main]
+languages/abc/abc.pbc                             [main]
+languages/APL/APL.pbc                             [main]
+languages/befunge/befunge.pbc                     [main]
+languages/bf/bf.pbc                               [main]
+languages/bf/bfc.pbc                              [main]
+languages/bf/bfco.pbc                             [main]
+languages/dotnet/net2pbc.pbc                      [main]
+languages/cardinal/cardinal.pbc                   [main]
+languages/ecmascript/js.pbc                       [main]
+languages/forth/forth.pbc                         [main]
+languages/HQ9PLus/HQ9PLus.pbc                     [main]
+languages/lisp/lisp.pbc                           [main]
+languages/lolcode/lolcode.pbc                     [main]
+languages/lua/alarm.pbc                           [main]
+languages/lua/base64.pbc                          [main]
+languages/lua/bc.pbc                              [main]
+languages/lua/bitlib.pbc                          [main]
+languages/lua/complex.pbc                         [main]
+languages/lua/lfs.pbc                             [main]
+languages/lua/lua.pbc                             [main]
+languages/lua/markdown.pbc                        [main]
+languages/lua/mathx.pbc                           [main]
+languages/lua/md5.pbc                             [main]
+languages/lua/random.pbc                          [main]
+languages/lua/sha1.pbc                            [main]
+languages/lua/uuid.pbc                            [main]
+languages/m4/m4.pbc                               [main]
+languages/markdown/markdown.pbc                   [main]
+languages/ook/ook.pbc                             [main]
+languages/perl6/perl6.pbc                         [main]
+languages/pheme/pheme.pbc                         [main]
+languages/PIR/pirc.pbc                            [main]
+languages/pipp/pipp.pbc                           [main]
+languages/pipp/src/common/pipplib.pbc             [main]
+languages/pipp/src/common/php_ctype.pbc           [main]
+languages/pipp/src/common/php_pcre.pbc            [main]
+languages/punie/punie.pbc                         [main]
+languages/pynie/pynie.pbc                         [main]
+languages/squaak/squaak.pbc                       [main]
+src/call_list.txt                                 [devel]doc
+src/glut_callbacks.c                              [main]
+src/jit_emit.h                                    [main]include
+tools/build/dynpmc.pl                             [devel]
+# pre-built stuff ends here
Index: Configure.pl
===================================================================
--- Configure.pl	(revision 34627)
+++ Configure.pl	(working copy)
@@ -69,6 +69,8 @@
 # Log files created by Configure.pl in MANIFEST.configure.generated
 $conf->{active_configuration} = 1;
 unlink 'MANIFEST.configure.generated';
+use File::Copy;
+copy('MANIFEST.generated.in', 'MANIFEST.generated');
 
 # Run the actual steps from Parrot::Configure
 $conf->runsteps or exit(1);
Index: MANIFEST.generated
===================================================================
--- MANIFEST.generated	(revision 34627)
+++ MANIFEST.generated	(working copy)
@@ -1,343 +0,0 @@
-# $Id$
-# See tools/dev/install_files.pl for documentation on the
-# format of this file.
-# Please re-sort this file after *EVERY* modification
-blib/lib/libparrot.0.8.1.dylib                    [main]lib
-blib/lib/libparrot.a                              [main]lib
-blib/lib/libparrot.dylib                          [main]lib
-blib/lib/libparrot.so                             [main]lib
-blib/lib/libparrot.so.0.8.1                       [main]lib
-compilers/imcc/imclexer.c                         [main]
-compilers/json/JSON.pbc                           [main]
-compilers/json/JSON/grammar.pbc                   [main]
-compilers/json/JSON/pge2pir.pbc                   [main]
-compilers/nqp/nqp.pbc                             [main]
-compilers/tge/TGE/Compiler.pbc                    [main]
-compilers/tge/TGE/Grammar.pbc                     [main]
-compilers/tge/TGE/Parser.pbc                      [main]
-compilers/tge/TGE/Rule.pbc                        [main]
-compilers/tge/TGE/Tree.pbc                        [main]
-compilers/tge/tgc.pir                             [main]
-config/auto/cpu/i386/memcpy_mmx.c                 [main]
-config/auto/cpu/i386/memcpy_sse.c                 [main]
-config/gen/call_list/opengl.in                    [main]
-config/gen/platform/ansi/dl.c                     [main]
-config/gen/platform/ansi/time.c                   [main]
-config/gen/platform/darwin/memalign.c             [main]
-config/gen/platform/generic/stat.c                [main]
-config/gen/platform/win32/stat.c                  [main]
-docs/ops/bit.pod                                  [main]doc
-docs/ops/cmp.pod                                  [main]doc
-docs/ops/core.pod                                 [main]doc
-docs/ops/debug.pod                                [main]doc
-docs/ops/dotgnu.pod                               [main]doc
-docs/ops/experimental.pod                         [main]doc
-docs/ops/io.pod                                   [main]doc
-docs/ops/math.pod                                 [main]doc
-docs/ops/object.pod                               [main]doc
-docs/ops/obscure.pod                              [main]doc
-docs/ops/pic.pod                                  [main]doc
-docs/ops/pmc.pod                                  [main]doc
-docs/ops/python.pod                               [main]doc
-docs/ops/set.pod                                  [main]doc
-docs/ops/stack.pod                                [main]doc
-docs/ops/string.pod                               [main]doc
-docs/ops/sys.pod                                  [main]doc
-docs/ops/var.pod                                  [main]doc
-include/parrot/config.h                           [main]include
-include/parrot/core_pmcs.h                        [main]include
-include/parrot/exec_dep.h                         [main]include
-include/parrot/extend_vtable.h                    [main]include
-include/parrot/feature.h                          [main]include
-include/parrot/has_header.h                       [main]include
-include/parrot/oplib/core_ops.h                   [main]include
-include/parrot/oplib/core_ops_cg.h                [main]include
-include/parrot/oplib/core_ops_cgp.h               [main]include
-include/parrot/oplib/core_ops_switch.h            [main]include
-include/parrot/oplib/ops.h                        [main]include
-include/parrot/platform.h                         [main]include
-include/parrot/platform_interface.h               [main]include
-include/parrot/vtable.h                           [main]include
-installable_disassemble                           [main]bin
-installable_disassemble.exe                       [main]bin
-installable_parrot                                [main]bin
-installable_parrot.exe                            [main]bin
-installable_parrot_config                         [main]bin
-installable_parrot_config.exe                     [main]bin
-installable_parrot_debugger                       [main]bin
-installable_parrot_debugger.exe                   [main]bin
-installable_pbc_info                              [main]bin
-installable_pbc_info.exe                          [main]bin
-installable_pbc_merge                             [main]bin
-installable_pbc_merge.exe                         [main]bin
-installable_pdump                                 [main]bin
-installable_pdump.exe                             [main]bin
-installable_perl6                                 [main]bin
-installable_perl6.exe                             [main]bin
-libparrot.dll                                     [main]bin
-cygparrot0_8_2.dll                                [main]bin
-libparrot.dll.a                                   [main]lib
-parrot.pc                                         [main]pkgconfig
-parrot_config                                     [main]bin
-parrot_config.exe                                 [main]bin
-parrot_debugger                                   [main]bin
-parrot_debugger.exe                               [main]bin
-pbc_disassemble                                   [main]bin
-pbc_disassemble.exe                               [main]bin
-pbc_info                                          [main]bin
-pbc_info.exe                                      [main]bin
-pbc_merge                                         [main]bin
-pbc_merge.exe                                     [main]bin
-pbc_to_exe                                        [main]bin
-pbc_to_exe.exe                                    [main]bin
-pdump                                             [main]bin
-pdump.exe                                         [main]bin
-perl6                                             [main]bin
-perl6.exe                                         [main]bin
-runtime/parrot/dynext/apl_group.bundle            [library]
-runtime/parrot/dynext/apl_group.dll               [library]
-runtime/parrot/dynext/apl_group.dylib             [library]
-runtime/parrot/dynext/apl_group.so                [library]
-runtime/parrot/dynext/dan_ops.bundle              [library]
-runtime/parrot/dynext/dan_ops.dll                 [library]
-runtime/parrot/dynext/dan_ops.dylib               [library]
-runtime/parrot/dynext/dan_ops.so                  [library]
-runtime/parrot/dynext/digest_group.bundle         [library]
-runtime/parrot/dynext/digest_group.dll            [library]
-runtime/parrot/dynext/digest_group.dylib          [library]
-runtime/parrot/dynext/digest_group.so             [library]
-runtime/parrot/dynext/dotnet.bundle               [library]
-runtime/parrot/dynext/dotnet.dll                  [library]
-runtime/parrot/dynext/dotnet.dylib                [library]
-runtime/parrot/dynext/dotnet.so                   [library]
-runtime/parrot/dynext/dotnet_ops.bundle           [library]
-runtime/parrot/dynext/dotnet_ops.dll              [library]
-runtime/parrot/dynext/dotnet_ops.dylib            [library]
-runtime/parrot/dynext/dotnet_ops.so               [library]
-runtime/parrot/dynext/dotnet_ops_cg.bundle        [library]
-runtime/parrot/dynext/dotnet_ops_cg.dll           [library]
-runtime/parrot/dynext/dotnet_ops_cg.dylib         [library]
-runtime/parrot/dynext/dotnet_ops_cg.so            [library]
-runtime/parrot/dynext/dotnet_ops_cgp.bundle       [library]
-runtime/parrot/dynext/dotnet_ops_cgp.dll          [library]
-runtime/parrot/dynext/dotnet_ops_cgp.dylib        [library]
-runtime/parrot/dynext/dotnet_ops_cgp.so           [library]
-runtime/parrot/dynext/dotnet_ops_switch.bundle    [library]
-runtime/parrot/dynext/dotnet_ops_switch.dll       [library]
-runtime/parrot/dynext/dotnet_ops_switch.dylib     [library]
-runtime/parrot/dynext/dotnet_ops_switch.so        [library]
-runtime/parrot/dynext/dotnet_runtime.bundle       [library]
-runtime/parrot/dynext/dotnet_runtime.dll          [library]
-runtime/parrot/dynext/dotnet_runtime.dylib        [library]
-runtime/parrot/dynext/dotnet_runtime.so           [library]
-runtime/parrot/dynext/dynlexpad.bundle            [library]
-runtime/parrot/dynext/dynlexpad.dll               [library]
-runtime/parrot/dynext/dynlexpad.dylib             [library]
-runtime/parrot/dynext/dynlexpad.so                [library]
-runtime/parrot/dynext/eclectus_group.bundle       [library]
-runtime/parrot/dynext/eclectus_group.dll          [library]
-runtime/parrot/dynext/eclectus_group.dylib        [library]
-runtime/parrot/dynext/eclectus_group.so           [library]
-runtime/parrot/dynext/gdbmhash.bundle             [library]
-runtime/parrot/dynext/gdbmhash.dll                [library]
-runtime/parrot/dynext/gdbmhash.dylib              [library]
-runtime/parrot/dynext/gdbmhash.so                 [library]
-runtime/parrot/dynext/libglutcb.bundle            [library]
-runtime/parrot/dynext/libglutcb.dll               [library]
-runtime/parrot/dynext/libglutcb.dylib             [library]
-runtime/parrot/dynext/libglutcb.so                [library]
-runtime/parrot/dynext/libnci_test.bundle          [library]
-runtime/parrot/dynext/libnci_test.dll             [library]
-runtime/parrot/dynext/libnci_test.dylib           [library]
-runtime/parrot/dynext/libnci_test.so              [library]
-runtime/parrot/dynext/lua_group.bundle            [library]
-runtime/parrot/dynext/lua_group.dll               [library]
-runtime/parrot/dynext/lua_group.dylib             [library]
-runtime/parrot/dynext/lua_group.so                [library]
-runtime/parrot/dynext/m4_evaluate.bundle          [library]
-runtime/parrot/dynext/m4_evaluate.dll             [library]
-runtime/parrot/dynext/m4_evaluate.dylib           [library]
-runtime/parrot/dynext/m4_evaluate.so              [library]
-runtime/parrot/dynext/match_group.bundle          [library]
-runtime/parrot/dynext/match_group.dll             [library]
-runtime/parrot/dynext/match_group.dylib           [library]
-runtime/parrot/dynext/match_group.so              [library]
-runtime/parrot/dynext/perl6_group.bundle          [library]
-runtime/parrot/dynext/perl6_group.dll             [library]
-runtime/parrot/dynext/perl6_group.dylib           [library]
-runtime/parrot/dynext/perl6_group.so              [library]
-runtime/parrot/dynext/perl6_ops.bundle            [library]
-runtime/parrot/dynext/perl6_ops.dll               [library]
-runtime/parrot/dynext/perl6_ops.dylib             [library]
-runtime/parrot/dynext/perl6_ops.so                [library]
-runtime/parrot/dynext/perl6_ops_cg.bundle         [library]
-runtime/parrot/dynext/perl6_ops_cg.dll            [library]
-runtime/parrot/dynext/perl6_ops_cg.dylib          [library]
-runtime/parrot/dynext/perl6_ops_cg.so             [library]
-runtime/parrot/dynext/perl6_ops_cgp.bundle        [library]
-runtime/parrot/dynext/perl6_ops_cgp.dll           [library]
-runtime/parrot/dynext/perl6_ops_cgp.dylib         [library]
-runtime/parrot/dynext/perl6_ops_cgp.so            [library]
-runtime/parrot/dynext/perl6_ops_switch.bundle     [library]
-runtime/parrot/dynext/perl6_ops_switch.dll        [library]
-runtime/parrot/dynext/perl6_ops_switch.dylib      [library]
-runtime/parrot/dynext/perl6_ops_switch.so         [library]
-runtime/parrot/dynext/php_group.bundle            [library]
-runtime/parrot/dynext/php_group.dll               [library]
-runtime/parrot/dynext/php_group.dylib             [library]
-runtime/parrot/dynext/php_group.so                [library]
-runtime/parrot/dynext/rational.bundle             [library]
-runtime/parrot/dynext/rational.dll                [library]
-runtime/parrot/dynext/rational.dylib              [library]
-runtime/parrot/dynext/rational.so                 [library]
-runtime/parrot/dynext/ruby_group.bundle           [library]
-runtime/parrot/dynext/ruby_group.dll              [library]
-runtime/parrot/dynext/ruby_group.dylib            [library]
-runtime/parrot/dynext/ruby_group.so               [library]
-runtime/parrot/dynext/subproxy.bundle             [library]
-runtime/parrot/dynext/subproxy.dll                [library]
-runtime/parrot/dynext/subproxy.dylib              [library]
-runtime/parrot/dynext/subproxy.so                 [library]
-runtime/parrot/dynext/wmls_group.bundle           [library]
-runtime/parrot/dynext/wmls_group.dll              [library]
-runtime/parrot/dynext/wmls_group.dylib            [library]
-runtime/parrot/dynext/wmls_group.so               [library]
-runtime/parrot/dynext/wmls_ops.bundle             [library]
-runtime/parrot/dynext/wmls_ops.dll                [library]
-runtime/parrot/dynext/wmls_ops.dylib              [library]
-runtime/parrot/dynext/wmls_ops.so                 [library]
-runtime/parrot/dynext/wmls_ops_cg.bundle          [library]
-runtime/parrot/dynext/wmls_ops_cg.dll             [library]
-runtime/parrot/dynext/wmls_ops_cg.dylib           [library]
-runtime/parrot/dynext/wmls_ops_cg.so              [library]
-runtime/parrot/dynext/wmls_ops_cgp.bundle         [library]
-runtime/parrot/dynext/wmls_ops_cgp.dll            [library]
-runtime/parrot/dynext/wmls_ops_cgp.dylib          [library]
-runtime/parrot/dynext/wmls_ops_cgp.so             [library]
-runtime/parrot/dynext/wmls_ops_switch.bundle      [library]
-runtime/parrot/dynext/wmls_ops_switch.dll         [library]
-runtime/parrot/dynext/wmls_ops_switch.dylib       [library]
-runtime/parrot/dynext/wmls_ops_switch.so          [library]
-runtime/parrot/include/call_bits.pasm             [main]
-runtime/parrot/include/cclass.pasm                [main]
-runtime/parrot/include/config.fpmc                [main]
-runtime/parrot/include/datatypes.pasm             [main]
-runtime/parrot/include/errors.pasm                [main]
-runtime/parrot/include/except_severity.pasm       [main]
-runtime/parrot/include/except_types.pasm          [main]
-runtime/parrot/include/iglobals.pasm              [main]
-runtime/parrot/include/interpcores.pasm           [main]
-runtime/parrot/include/interpdebug.pasm           [main]
-runtime/parrot/include/interpflags.pasm           [main]
-runtime/parrot/include/interpinfo.pasm            [main]
-runtime/parrot/include/interptrace.pasm           [main]
-runtime/parrot/include/iotypes.pasm               [main]
-runtime/parrot/include/iterator.pasm              [main]
-runtime/parrot/include/longopt.pasm               [main]
-runtime/parrot/include/mmd.pasm                   [main]
-runtime/parrot/include/opengl_defines.pasm        [main]
-runtime/parrot/include/parrotlib.pbc              [main]
-runtime/parrot/include/pmctypes.pasm              [main]
-runtime/parrot/include/signal.pasm                [main]
-runtime/parrot/include/stat.pasm                  [main]
-runtime/parrot/include/stdio.pasm                 [main]
-runtime/parrot/include/stringinfo.pasm            [main]
-runtime/parrot/include/sysinfo.pasm               [main]
-runtime/parrot/include/timer.pasm                 [main]
-runtime/parrot/include/tm.pasm                    [main]
-runtime/parrot/include/vtable_methods.pasm        [main]
-runtime/parrot/include/warnings.pasm              [main]
-runtime/parrot/library/CGI/QueryHash.pbc          [main]
-runtime/parrot/library/Data/Dumper.pbc            [main]
-runtime/parrot/library/Data/Dumper/Base.pbc       [main]
-runtime/parrot/library/Data/Dumper/Default.pbc    [main]
-runtime/parrot/library/Data/Escape.pbc            [main]
-runtime/parrot/library/Data/Sort.pbc              [main]
-runtime/parrot/library/Getopt/Obj.pbc             [main]
-runtime/parrot/library/Math/Random/mt19937ar.pbc  [main]
-runtime/parrot/library/MIME/Base64.pbc            [main]
-runtime/parrot/library/NCI/call_toolkit_init.pbc  [main]
-runtime/parrot/library/OpenGL.pbc                 [main]
-runtime/parrot/library/OpenGL_funcs.pir           [main]
-runtime/parrot/library/P6object.pbc               [main]
-runtime/parrot/library/Protoobject.pbc            [main]
-runtime/parrot/library/Parrot/Capture_PIR.pbc     [main]
-runtime/parrot/library/Parrot/Coroutine.pbc       [main]
-runtime/parrot/library/Parrot/Exception.pbc       [main]
-runtime/parrot/library/Parrot/HLLCompiler.pbc     [main]
-runtime/parrot/library/PCT.pbc                    [main]
-runtime/parrot/library/PCT/Grammar.pbc            [main]
-runtime/parrot/library/PCT/HLLCompiler.pbc        [main]
-runtime/parrot/library/PCT/PAST.pbc               [main]
-runtime/parrot/library/PGE.pbc                    [main]
-runtime/parrot/library/PGE/Dumper.pbc             [main]
-runtime/parrot/library/PGE/Glob.pbc               [main]
-runtime/parrot/library/PGE/Hs.pbc                 [main]
-runtime/parrot/library/PGE/P6Grammar.pbc          [main]
-runtime/parrot/library/PGE/Text.pbc               [main]
-runtime/parrot/library/PGE/Util.pbc               [main]
-runtime/parrot/library/Stream/Base.pbc            [main]
-runtime/parrot/library/Stream/Combiner.pbc        [main]
-runtime/parrot/library/Stream/Coroutine.pbc       [main]
-runtime/parrot/library/Stream/Filter.pbc          [main]
-runtime/parrot/library/Stream/Lines.pbc           [main]
-runtime/parrot/library/Stream/ParrotIO.pbc        [main]
-runtime/parrot/library/Stream/Replay.pbc          [main]
-runtime/parrot/library/Stream/Sub.pbc             [main]
-runtime/parrot/library/Stream/Writer.pbc          [main]
-runtime/parrot/library/TGE.pbc                    [main]
-runtime/parrot/library/config.pbc                 [main]
-runtime/parrot/library/dumper.pbc                 [main]
-runtime/parrot/library/ncurses.pbc                [main]
-runtime/parrot/library/parrotlib.pbc              [main]
-runtime/parrot/library/pcre.pbc                   [main]
-languages/abc/abc.pbc                             [main]
-languages/APL/APL.pbc                             [main]
-languages/befunge/befunge.pbc                     [main]
-languages/bf/bf.pbc                               [main]
-languages/bf/bfc.pbc                              [main]
-languages/bf/bfco.pbc                             [main]
-languages/dotnet/net2pbc.pbc                      [main]
-languages/cardinal/cardinal.pbc                   [main]
-languages/ecmascript/js.pbc                       [main]
-languages/forth/forth.pbc                         [main]
-languages/HQ9PLus/HQ9PLus.pbc                     [main]
-languages/lisp/lisp.pbc                           [main]
-languages/lolcode/lolcode.pbc                     [main]
-languages/lua/alarm.pbc                           [main]
-languages/lua/base64.pbc                          [main]
-languages/lua/bc.pbc                              [main]
-languages/lua/bitlib.pbc                          [main]
-languages/lua/complex.pbc                         [main]
-languages/lua/lfs.pbc                             [main]
-languages/lua/lua.pbc                             [main]
-languages/lua/markdown.pbc                        [main]
-languages/lua/mathx.pbc                           [main]
-languages/lua/md5.pbc                             [main]
-languages/lua/random.pbc                          [main]
-languages/lua/sha1.pbc                            [main]
-languages/lua/uuid.pbc                            [main]
-languages/m4/m4.pbc                               [main]
-languages/markdown/markdown.pbc                   [main]
-languages/ook/ook.pbc                             [main]
-languages/perl6/perl6.pbc                         [main]
-languages/pheme/pheme.pbc                         [main]
-languages/PIR/pirc.pbc                            [main]
-languages/pipp/pipp.pbc                           [main]
-languages/pipp/src/common/pipplib.pbc             [main]
-languages/pipp/src/common/php_ctype.pbc           [main]
-languages/pipp/src/common/php_pcre.pbc            [main]
-languages/punie/punie.pbc                         [main]
-languages/pynie/pynie.pbc                         [main]
-languages/squaak/squaak.pbc                       [main]
-src/call_list.txt                                 [devel]doc
-src/glut_callbacks.c                              [main]
-src/jit_emit.h                                    [main]include
-src/nci.c                                         [main]
-src/null_config.c                                 [main]
-src/ops/core_ops_cgp.c                            [main]
-src/ops/core_ops_switch.c                         [main]
-src/parrot_config.c                               [main]
-src/string_private_cstring.h                      [main]include
-tools/build/dynpmc.pl                             [devel]
-tools/install/smoke.pl                            [main]
Index: config/gen/parrot_include.pm
===================================================================
--- config/gen/parrot_include.pm	(revision 34627)
+++ config/gen/parrot_include.pm	(working copy)
@@ -19,8 +19,8 @@
 use base qw(Parrot::Configure::Step);
 
 use Parrot::Configure::Utils ':gen';
+use Parrot::BuildUtil;
 
-
 sub _init {
     my $self = shift;
     my %data;
@@ -217,6 +217,7 @@
                 $target =~ m[/] or $target = "$self->{destdir}/$target";
                 move_if_diff( $target_tmp, $target );
                 push @generated, $target;
+		add_to_generated($target, "[main]");
             }
         }
     }
Index: config/gen/makefiles/tge.in
===================================================================
--- config/gen/makefiles/tge.in	(revision 34627)
+++ config/gen/makefiles/tge.in	(working copy)
@@ -3,26 +3,38 @@
 .SUFFIXES : .pir .pbc
 
 # Setup some commands
-PERL     = @perl@
-RM_F     = @rm_f@
-PARROT   = ../../parrot@exe@
+PERL          = @perl@
+RM_F          = @rm_f@
+CP            = @cp@
+MKPATH        = @mkpath@
+PARROT        = ../../parrot@exe@
 RECONFIGURE   = $(PERL) @build_dir@/tools/dev/reconfigure.pl
+ADDGENERATED  = $(PERL) ../../tools/build/addgenerated.pl
 #IF(parrot_is_shared and !(cygwin|win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH)
 
 # Where to put things
-PARROT_LIBRARY    = ../../runtime/parrot/library
-PERL6GRAMMAR      = $(PARROT_LIBRARY)/PGE/Perl6Grammar.pbc
+BIN_DIR       = @bin_dir@
+LIB_DIR       = @lib_dir@
+DOC_DIR       = @doc_dir@
+MANDIR	      = @mandir@
+PARROT_LIB    = ../../runtime/parrot/library
+PERL6GRAMMAR  = $(PARROT_LIB)/PGE/Perl6Grammar.pbc
+LIBS = TGE/Rule.pbc TGE/Parser.pbc TGE/Grammar.pbc TGE/Compiler.pbc TGE/Tree.pbc
 
 # the default target
-build: $(PARROT_LIBRARY)/TGE.pbc
+build: $(PARROT_LIB)/TGE.pbc
 
-all: $(PARROT_LIBRARY)/TGE.pbc Makefile
+all: build Makefile
 
-$(PARROT_LIBRARY)/TGE.pbc: TGE.pir TGE/Rule.pbc TGE/Parser.pbc TGE/Grammar.pbc TGE/Compiler.pbc TGE/Tree.pbc
-	$(PARROT) -o $(PARROT_LIBRARY)/TGE.pbc --output-pbc TGE.pir
+$(PARROT_LIB)/TGE.pbc: TGE.pir $(LIBS)
+	$(PARROT) -o $(PARROT_LIB)/TGE.pbc --output-pbc TGE.pir
+	$(ADDGENERATED) "runtime/parrot/library/TGE.pbc"
 
 .pir.pbc :
 	$(PARROT) -o $@ --output-pbc $<
+	-$(MKPATH) $(PARROT_LIB)/TGE
+	$(CP) $@ $(PARROT_LIB)/TGE/$@
+	$(ADDGENERATED) "runtime/parrot/library/TGE/$@"
 
 TGE/Parser.pir: TGE/Parser.pg
 	$(PARROT) $(PERL6GRAMMAR) --output=TGE/Parser.pir TGE/Parser.pg
@@ -38,6 +50,8 @@
 	@echo ""
 	@echo "  all:               TGE.pbc"
 	@echo "                     This is the default."
+	@echo "  install:           copy pbc's to runtime/parrot/library"
+	@echo ""
 	@echo "Testing:"
 	@echo "  test:              Run the test suite."
 	@echo "  testclean:         Clean up test results."
@@ -54,6 +68,17 @@
 test: all
 	prove -r ../../t/compilers/tge
 
+install: build
+	-$(MKPATH) $(DESTDIR)$(LIB_DIR)/parrot/library
+	-$(MKPATH) $(DESTDIR)$(LIB_DIR)/parrot/library/TGE
+	$(CP) TGE.pbc $(DESTDIR)$(LIB_DIR)/parrot/library
+	$(CP) $(LIBS) $(DESTDIR)$(LIB_DIR)/parrot/library/TGE
+	$(CP) tgc.pir $(DESTDIR)$(LIB_DIR)/parrot/library/tgc.pir
+
+install-tgc:
+	$(CP) tgc.pir $(PARROT_LIB)/TGE/tgc.pir
+	$(ADDGENERATED) runtime/parrot/library/TGE/tgc.pir
+
 testclean:
 	$(RM_F) "../../t/compilers/tge/*.pir"
 
@@ -64,7 +89,7 @@
 	TGE/Tree.pbc \
 	TGE/Grammar.pbc \
 	TGE/Compiler.pbc \
-	$(PARROT_LIBRARY)/TGE.pbc
+	$(PARROT_LIB)/TGE.pbc
 
 realclean: clean
 	$(RM_F) Makefile
Index: config/gen/makefiles/root.in
===================================================================
--- config/gen/makefiles/root.in	(revision 34627)
+++ config/gen/makefiles/root.in	(working copy)
@@ -106,6 +106,7 @@
 RECONFIGURE      = $(PERL) tools/dev/reconfigure.pl
 INNO_SETUP       = iscc
 JIT_BUILD_TOOL   = $(BUILD_TOOLS_DIR)/jit2c.pl
+ADDGENERATED     = $(PERL) $(BUILD_TOOLS_DIR)/addgenerated.pl
 #IF(darwin):export MACOSX_DEPLOYMENT_TARGET := @osx_version@
 
 ###############################################################################
@@ -196,6 +197,7 @@
     myconfig  \
     $(GEN_PASM_INCLUDES) \
     $(SRC_DIR)/call_list.txt \
+    MANIFEST.generated \
     MANIFEST.configure.generated \
     .configure_trace.sto \
     .parrot_current_rev
@@ -543,6 +545,7 @@
 
 .pir.pbc :
 	$(PARROT) -o $@ $<
+	@$(ADDGENERATED) "$@"
 
 .pbc$(O) :
 	$(PARROT) -o $@ $<
@@ -565,7 +568,7 @@
     docs \
     $(LIBNCI_TEST_SO) \
 #IF(has_glut):    $(LIBGLUTCB_SO) \
-    $(GEN_LIBRARY) \
+    gen_library \
     dynpmc \
     dynoplibs \
     compilers \
@@ -576,7 +579,7 @@
 
 all : build parrot_utils installable $(PERL6) languages
 
-$(GEN_LIBRARY) : $(PARROT)
+gen_library : $(GEN_LIBRARY) $(PARROT)
 
 # constant string support
 .c.str :
@@ -782,17 +785,20 @@
 
 runtime/parrot/include/parrotlib.pbc: runtime/parrot/library/parrotlib.pir $(PARROT)
 	$(PARROT) -o $@ runtime/parrot/library/parrotlib.pir
+	$(ADDGENERATED) "$@"
 
 runtime/parrot/include/config.fpmc : myconfig config_lib.pasm $(MINIPARROT)
-	@echo Invoking Parrot to generate runtime/parrot/include/config.fpmc --cross your fingers
+	@echo "Invoking Parrot to generate runtime/parrot/include/config.fpmc --cross your fingers"
 	$(MINIPARROT) config_lib.pasm > $@
+	$(ADDGENERATED) "$@"
 
 $(PARROT) : $(SRC_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) CFLAGS \
     lib/Parrot/OpLib/core.pm $(SRC_DIR)/parrot_config$(O) \
     $(MINIPARROT)
 	$(LINK) @ld_out@$@ \
-	$(SRC_DIR)/main$(O) $(SRC_DIR)/parrot_config$(O) \
-	@rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC)
+    $(SRC_DIR)/main$(O) $(SRC_DIR)/parrot_config$(O) \
+    @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 pbc_to_exe.pir : $(PARROT) tools/dev/pbc_to_exe_gen.pl
@@ -802,14 +808,17 @@
 $(PBC_TO_EXE) : pbc_to_exe.pir $(PARROT)
 	$(PARROT) -o pbc_to_exe.pbc pbc_to_exe.pir
 	$(PARROT) pbc_to_exe.pir pbc_to_exe.pbc
+	$(ADDGENERATED) "$@" "[main]" bin
 
 $(PARROT_CONFIG) : tools/util/parrot-config.pir $(PARROT) $(PBC_TO_EXE)
 	$(PARROT) -o parrot_config.pbc tools/util/parrot-config.pir
 	$(PARROT) pbc_to_exe.pir parrot_config.pbc
+	$(ADDGENERATED) "$@" "[main]" bin
 
 $(INSTALLABLECONFIG) : $(SRC_DIR)/install_config$(O) $(PARROT_CONFIG) $(PBC_TO_EXE)
 	$(PARROT) -o parrot_config.pbc tools/util/parrot-config.pir
 	$(PBC_TO_EXE) parrot_config.pbc --install
+	$(ADDGENERATED) "$@" "[main]" bin
 
 # HLL Executable targets
 #IF(win32 or cygwin):perl6 : $(PERL6)
@@ -817,6 +826,7 @@
 $(PERL6) : compilers $(PBC_TO_EXE)
 	$(MAKE) languages/perl6 perl6$(EXE)
 	$(CP) languages/perl6/perl6$(EXE) $(PERL6)
+	$(ADDGENERATED) "$@" "[main]" bin
 	$(CHMOD) 0755 $(PERL6)
 	$(PERL6) -e"say 'Hello, world.'"
 
@@ -826,16 +836,20 @@
     lib/Parrot/OpLib/core.pm $(SRC_DIR)/null_config$(O)
 	$(LINK) @ld_out@$@ $(SRC_DIR)/main$(O) $(SRC_DIR)/null_config$(O) \
 	@rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "# $@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
+
 $(INSTALLABLEPARROT) : $(SRC_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
     lib/Parrot/OpLib/core.pm $(SRC_DIR)/install_config$(O) \
     $(PARROT)
 	$(LINK) @ld_out@$@ \
     $(SRC_DIR)/main$(O) $(SRC_DIR)/install_config$(O) \
     $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
+
 $(INC_DIR)/parrot.h : $(INC_DIR)/pbcversion.h $(INC_DIR)/vtable.h
 
 $(INC_DIR)/extend.h : $(INC_DIR)/extend_vtable.h
@@ -847,19 +861,23 @@
     $(BUILD_TOOLS_DIR)/parrot_config_c.pl
 	$(PERL) $(BUILD_TOOLS_DIR)/parrot_config_c.pl > \
     $(SRC_DIR)/parrot_config.c
+	$(ADDGENERATED) "$@" "[main]"
 
 $(SRC_DIR)/install_config.c :  install_config.fpmc \
     $(BUILD_TOOLS_DIR)/parrot_config_c.pl
 	$(PERL) $(BUILD_TOOLS_DIR)/parrot_config_c.pl --install > \
     $(SRC_DIR)/install_config.c
+	$(ADDGENERATED) "$@" "[main]"
 
 $(SRC_DIR)/null_config.c : myconfig $(BUILD_TOOLS_DIR)/parrot_config_c.pl
 	$(PERL) $(BUILD_TOOLS_DIR)/parrot_config_c.pl --mini > \
     $(SRC_DIR)/null_config.c
+	$(ADDGENERATED) "$@" "[main]"
 
 install_config.fpmc : myconfig config_lib.pasm $(PARROT)
 	@echo "Invoking Parrot to generate install_config.fpmc"
 	$(PARROT) config_lib.pasm --install > $@
+	$(ADDGENERATED) "$@" "[main]"
 
 $(SRC_DIR)/parrot_config$(O) : $(SRC_DIR)/parrot_config.c
 
@@ -900,6 +918,7 @@
 	$(AR_CR) @ar_out@$@ @ar_extra@ $(O_FILES)
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;2
 	$(RANLIB) $@
+	$(ADDGENERATED) "$@" "[main]" lib
 
 $(LIBPARROT_SHARED) : $(O_FILES)
 	$(MKPATH) @blib_dir@
@@ -908,6 +927,9 @@
 		$(O_FILES) $(C_LIBS) $(ICU_SHARED)
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;2
 #IF(libparrot_shared_alias):	( cd @blib_dir@ ; ln -sf @libparrot_shared@ @libparrot_shared_alias@ )
+#IF(libparrot_shared_alias):	$(ADDGENERATED) "@blib_dir@/@libparrot_shared_alias@" "[main]" lib
+	$(ADDGENERATED) "$@" "[main]" lib
+#IF(cygwin or msys or mingw):	$(ADDGENERATED) "libparrot.dll.a" "[main]" lib
 
 
 #
@@ -921,6 +943,7 @@
     $(SRC_DIR)/parrot_debugger$(O) \
     $(SRC_DIR)/parrot_config$(O) \
     @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 $(INSTALLABLEPDB) : $(SRC_DIR)/parrot_debugger$(O) $(LIBPARROT)
@@ -928,6 +951,7 @@
     $(SRC_DIR)/parrot_debugger$(O) \
     $(SRC_DIR)/parrot_config$(O) \
     $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 #
@@ -940,12 +964,14 @@
 	$(LINK) @ld_out@$@ \
     $(SRC_DIR)/pbc_disassemble$(O) \
     @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 $(INSTALLABLEDIS) : $(SRC_DIR)/pbc_disassemble$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
     $(SRC_DIR)/pbc_disassemble$(O) \
     $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 #
@@ -956,6 +982,7 @@
 	$(LINK) @ld_out@$@ \
     $(SRC_DIR)/pdump$(O) \
     $(SRC_DIR)/packdump$(O) @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 $(SRC_DIR)/pdump$(O) : $(GEN_HEADERS)
@@ -964,14 +991,15 @@
 	$(LINK) @ld_out@$@ \
     $(SRC_DIR)/pdump$(O) \
     $(SRC_DIR)/packdump$(O) $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
-
 # pbc_info
 $(PINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
     $(SRC_DIR)/pbc_info$(O) \
     @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 $(SRC_DIR)/pbc_info$(O) : $(GEN_HEADERS)
@@ -980,6 +1008,7 @@
 	$(LINK) @ld_out@$@ \
     $(SRC_DIR)/pbc_info$(O) \
     $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 #
@@ -991,6 +1020,7 @@
     $(SRC_DIR)/pbc_merge$(O) \
     $(SRC_DIR)/parrot_config$(O) \
     @rpath_blib@ $(ALL_PARROT_LIBS) $(LINK_DYNAMIC) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 $(INSTALLABLEPBCMERGE) : $(SRC_DIR)/pbc_merge$(O) $(LIBPARROT) $(INSTALLABLECONFIG)
@@ -998,6 +1028,7 @@
     $(SRC_DIR)/pbc_merge$(O) \
     $(SRC_DIR)/install_config$(O) \
     $(ALL_PARROT_LIBS) $(LINKFLAGS)
+	$(ADDGENERATED) "$@" "[main]" bin
 #IF(win32):	if exist [email protected] mt.exe -nologo -manifest [email protected] -outputresource:$@;1
 
 
@@ -1012,6 +1043,7 @@
 $(INC_DIR)/oplib/ops.h lib/Parrot/OpLib/core.pm : $(OPS_FILES) $(BUILD_TOOLS_DIR)/ops2pm.pl \
     lib/Parrot/OpsFile.pm lib/Parrot/Op.pm $(OPS_DIR)/ops.num $(OPS_DIR)/ops.skip
 	$(PERL) $(BUILD_TOOLS_DIR)/ops2pm.pl $(OPS_FILES)
+	$(ADDGENERATED) "$@" "[main]" include
 
 Makefile : config/gen/makefiles/root.in
 	$(PERL) tools/dev/reconfigure.pl --step=gen::makefiles --target=Makefile
@@ -1210,6 +1242,7 @@
 
 $(SRC_DIR)/nci.c : $(SRC_DIR)/call_list.txt $(BUILD_TOOLS_DIR)/nativecall.pl
 	$(PERL) $(BUILD_TOOLS_DIR)/nativecall.pl $(SRC_DIR)/call_list.txt
+	$(ADDGENERATED) "$@" "[main]"
 
 $(SRC_DIR)/warnings$(O) : $(GENERAL_H_FILES)
 
@@ -1265,14 +1298,18 @@
 
 $(SRC_DIR)/jit_emit.h : $(SRC_DIR)/jit/@jitcpuarch@/jit_emit.h
 	$(CP) $(SRC_DIR)/jit/@jitcpuarch@/jit_emit.h $(SRC_DIR)/jit_emit.h
+	$(ADDGENERATED) "$@" "[main]" "include"
 $(SRC_DIR)/exec_dep.h : $(SRC_DIR)/jit/@jitcpuarch@/exec_dep.h
 	$(CP) $(SRC_DIR)/jit/@jitcpuarch@/exec_dep.h $(SRC_DIR)/exec_dep.h
+	$(ADDGENERATED) "$@" "[main]" "include"
 $(SRC_DIR)/jit_cpu.c : lib/Parrot/OpLib/core.pm $(SRC_DIR)/jit_emit.h \
     $(SRC_DIR)/jit/@jitcpuarch@/core.jit $(JIT_BUILD_TOOL)
 	$(PERL) $(JIT_BUILD_TOOL) @jitcpuarch@ $(SRC_DIR)/jit_cpu.c
+	$(ADDGENERATED) "$@" "[main]"
 $(SRC_DIR)/exec_cpu.c : lib/Parrot/OpLib/core.pm $(SRC_DIR)/jit_emit.h \
     $(SRC_DIR)/jit/@jitcpuarch@/core.jit @TEMP_exec_h@ $(SRC_DIR)/exec_dep.h $(JIT_BUILD_TOOL)
 	$(PERL) $(JIT_BUILD_TOOL) @jitcpuarch@ $(SRC_DIR)/exec_cpu.c
+	$(ADDGENERATED) "$@" "[main]"
 @TEMP_exec_dep@
 
 # imcc file dependencies
@@ -1287,10 +1324,13 @@
 	$(PERL) $(BUILD_TOOLS_DIR)/fixup_gen_file.pl -noheaderizer $(IMCC_DIR)/imcparser.c $(IMCC_DIR)/imcc.y
 	$(PERL) $(BUILD_TOOLS_DIR)/fixup_gen_file.pl -noheaderizer $(IMCC_DIR)/imcparser.h $(IMCC_DIR)/imcc.y
 	$(TOUCH) $(IMCC_DIR)/imcc.y.flag $(IMCC_DIR)/imcparser.c $(IMCC_DIR)/imcparser.h
+	$(PERL) tools/build/addgenerated.pl $(IMCC_DIR)/imcparser.c "[main]"
+	$(PERL) tools/build/addgenerated.pl $(IMCC_DIR)/imcparser.h "[main]"
 
 $(IMCC_DIR)/imcc.l.flag $(IMCC_DIR)/imclexer.c : $(IMCC_DIR)/imcc.l
 	$(LEX) -o$(IMCC_DIR)/imclexer.c $(IMCC_DIR)/imcc.l
 	$(TOUCH) $(IMCC_DIR)/imcc.l.flag $(IMCC_DIR)/imclexer.c
+	$(PERL) tools/build/addgenerated.pl $(IMCC_DIR)/imclexer.c "[main]"
 
 $(IMCC_O_FILES) : $(IMCC_H_FILES) $(ALL_H_FILES)
 
@@ -1368,7 +1408,7 @@
 
 compilers : compilers.dummy
 
-compilers.dummy : $(PARROT) $(GEN_LIBRARY)
+compilers.dummy : $(PARROT)
 	$(MAKE) compilers/pct
 	$(MAKE) compilers/pge
 	$(MAKE) compilers/tge
@@ -2170,15 +2210,7 @@
 #
 ###############################################################################
 
-install:
-	@echo "WARNING:"
-	@echo "  Installing Parrot may interfere with developing Parrot"
-	@echo "  on the same machine.  This is a temporary flaw in the"
-	@echo "  Parrot build system."
-	@echo "  To use the make install target, type: make reallyinstall"
-	$(PERL) -e "exit(1)"
-
-reallyinstall: installable
+install: installable
 	$(PERL) tools/dev/install_files.pl \
     --buildprefix=$(BUILDPREFIX) \
     --prefix=$(PREFIX) \
@@ -2190,6 +2222,10 @@
     --docdir=$(DOC_DIR) \
     MANIFEST MANIFEST.generated
 
+# legacy, to be deprecated
+reallyinstall: install
+	@echo "make reallyinstall is deprecated. Use make install now"
+
 ###############################################################################
 #
 # release targets
@@ -2230,11 +2266,13 @@
 $(LIBNCI_TEST_SO): $(SRC_DIR)/nci_test$(O)
 	$(LD) $(LD_LOAD_FLAGS) @ncilib_link_extra@ $(LDFLAGS) \
     @ld_out@$@ $(SRC_DIR)/nci_test$(O) $(C_LIBS)
+	$(ADDGENERATED) "$@"
 
 # for use by runtime/parrot/library/OpenGL.pir
 $(LIBGLUTCB_SO): $(LIBPARROT) $(SRC_DIR)/glut_callbacks$(O)
 	$(LD) $(LD_LOAD_FLAGS) $(LDFLAGS) \
     @ld_out@$@ $(SRC_DIR)/glut_callbacks$(O) $(ALL_PARROT_LIBS)
+	$(ADDGENERATED) "$@"
 
 # emacs etags
 # this needs exuberant-ctags
Index: config/gen/makefiles/dynpmc_pl.in
===================================================================
--- config/gen/makefiles/dynpmc_pl.in	(revision 34627)
+++ config/gen/makefiles/dynpmc_pl.in	(working copy)
@@ -21,6 +21,9 @@
 use lib "$FindBin::Bin/../..";
 use lib "$FindBin::Bin/../../lib";
 use Storable;
+use Cwd;
+use Parrot::BuildUtil;
+use File::Spec;
 
 # q[] isn't guaranteed to work, but it's safer than "" as some platforms
 # (eg FreeBSD) have ""s embedded in their substution values. q[] is used
@@ -45,7 +48,7 @@
     $PATHQUOTE = '"';
 
     unless ($CC =~ /gcc/i) {
-        $LIBPARROT = '@build_dir@/libparrot@a@';
+        $LIBPARROT = '@build_dir@/libparrot.lib';
     }
 }
 
@@ -181,6 +184,7 @@
 
     die "nothing found to copy" unless @list_to_process;
 
+    my $pwd = cwd();
     foreach (@list_to_process) {
         copy("$_$LOAD_EXT", $dest) or die "Copy $_$LOAD_EXT failed ($?)\n";
 
@@ -189,6 +193,9 @@
         if ($^O eq 'hpux' or $^O eq 'cygwin') {
             chmod 0755, "$dest@slash@$_$LOAD_EXT";
         }
+	chdir "@build_dir@";
+	add_to_generated("$dest@slash@$_$LOAD_EXT", "[library]");
+	chdir $pwd;
 
     }
 }
Index: config/gen/makefiles/editor.in
===================================================================
--- config/gen/makefiles/editor.in	(revision 34627)
+++ config/gen/makefiles/editor.in	(working copy)
@@ -66,3 +66,9 @@
 
 realclean: clean
 	$(RM_F) Makefile
+
+#
+# Local variables:
+# mode: makefile
+# ex: ft=make
+# End:
Index: config/gen/makefiles/dynpmc.in
===================================================================
--- config/gen/makefiles/dynpmc.in	(revision 34627)
+++ config/gen/makefiles/dynpmc.in	(working copy)
@@ -3,6 +3,8 @@
 PERL        = @perl@
 RM_F        = @rm_f@
 LOAD_EXT    = @load_ext@
+RECONFIGURE = $(PERL) @build_dir@/tools/dev/reconfigure.pl
+ADDGENERATED= $(PERL) ../../tools/build/addgenerated.pl
 RUNTIME_DIR = @build_dir@/runtime/parrot/dynext
 O           = @o@
 
@@ -39,12 +41,19 @@
 #IF(has_crypto):  sha256.pmc \
 #IF(has_crypto):  sha512.pmc
 
-all :
+all : Makefile ../../tools/build/dynpmc.pl
 	@$(BUILD) generate $(PMCS)
 	@$(BUILD) compile $(PMCS)
 	@$(BUILD) linklibs $(PMCS)
 	@$(BUILD) copy --destination=$(RUNTIME_DIR) $(PMCS)
 
+# regenerate the Makefile
+Makefile: ../../config/gen/makefiles/dynpmc.in
+	cd @build_dir@ && $(RECONFIGURE) --step=gen::makefiles --target=src/dynoplibs/Makefile
+
+../../tools/build/dynpmc.pl: ../../config/gen/makefiles/dynpmc_pl.in
+	cd @build_dir@ && $(RECONFIGURE) --step=gen::makefiles --target=tools/build/dynpmc.pl
+
 test : all
 	cd ../.. ; perl -Ilib t/harness t/dynpmc/*.t
 
@@ -60,8 +69,9 @@
 dynext-clean :
 	$(RM_F) "*.lib" "*.pdb" "*.ilk" "*.exp" "*.def" "*.manifest"
 
-clean : testclean dynext-clean
+clean : testclean
 	$(RM_F) "*.c" "pmc_*.h" "*_group.h" "*$(LOAD_EXT)" "*.dump" "lib-*" "*$(O)"
+#IF(win32):	$(RM_F) "*.lib" "*.pdb" "*.ilk" "*.exp" "*.def" "*.manifest"
 
 archclean :
 	$(RM_F) "*$(LOAD_EXT)" "*$(O)" Makefile
@@ -72,3 +82,9 @@
 distclean: realclean
 
 svnclean: realclean
+
+#
+# Local variables:
+# mode: makefile
+# ex: ft=make
+# End:
Index: config/gen/makefiles/dynoplibs_pl.in
===================================================================
--- config/gen/makefiles/dynoplibs_pl.in	(revision 34627)
+++ config/gen/makefiles/dynoplibs_pl.in	(working copy)
@@ -17,6 +17,12 @@
 use warnings;
 
 use File::Copy qw(copy);
+use FindBin;
+use lib "$FindBin::Bin/../..";
+use lib "$FindBin::Bin/../../lib";
+use Cwd;
+use Parrot::BuildUtil;
+use File::Spec;
 
 # qq[] isn't guaranteed to work, but it's safer than "" as some platforms
 # (eg FreeBSD) have ""s embedded in their substution values. q[] is used in
@@ -41,20 +47,20 @@
     $PATHQUOTE = q["];
 
     unless ($CC =~ /gcc/i) {
-        $LIBPARROT = '@build_dir@/libparrot@a@';
+        $LIBPARROT = '@build_dir@/libparrot.lib';
     }
 }
 
 # OPS2C Config
-our $OPS2C = "$PERL -I $PATHQUOTE" .
+our $OPS2C = "$PERL -I $PATHQUOTE" . 
              q[@build_dir@@slash@lib] .
              "$PATHQUOTE $PATHQUOTE" .
              q[@build_dir@@slash@tools@slash@build@[email protected]] .
              $PATHQUOTE;
 our %cores = (
     C       => q[],
-#IF(cg_flag):   CGP     => '_cgp',
-#IF(cg_flag):   CGoto   => '_cg',
+#IF(cg_flag):    CGP     => '_cgp',
+#IF(cg_flag):    CGoto   => '_cg',
     CSwitch => '_switch'
 );
 
@@ -132,6 +138,7 @@
     my $dest = $1;
 
     my $core_suffix;
+    my $pwd = cwd();
     foreach $core_suffix (values %cores) {
         foreach (@oplibs) {
             my $src = $_ . "_ops$core_suffix$LOAD_EXT";
@@ -143,6 +150,9 @@
             if ($^O eq 'hpux' or $^O eq 'cygwin') {
                 chmod 0755, "$dest@slash@$src";
             }
+	    chdir "@build_dir@";
+	    add_to_generated("$dest@slash@$src", "[library]");
+	    chdir $pwd;
         }
     }
 }
Index: config/gen/makefiles/nqp.in
===================================================================
--- config/gen/makefiles/nqp.in	(revision 34627)
+++ config/gen/makefiles/nqp.in	(working copy)
@@ -3,12 +3,15 @@
 # Setup some commands
 PERL     = @perl@
 RM_F     = @rm_f@
+CP       = @cp@
+MKPATH   = @mkpath@
 PARROT   = ../../parrot@exe@
 RECONFIGURE   = $(PERL) @build_dir@/tools/dev/reconfigure.pl
+ADDGENERATED  = $(PERL) ../../tools/build/addgenerated.pl
 #IF(parrot_is_shared and !(cygwin|win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH)
 
-PARROT_LIBRARY = @build_dir@/runtime/parrot/library
-PGE_LIBRARY    = @build_dir@/runtime/parrot/library/PGE
+PARROT_LIB    = @build_dir@/runtime/parrot/library
+PGE_LIBRARY   = @build_dir@/runtime/parrot/library/PGE
 
 build: nqp.pbc
 
@@ -27,6 +30,8 @@
 	$(PARROT) $(PARROT_ARGS) $(PGE_LIBRARY)/Perl6Grammar.pir \
 	    --output=src/Grammar_gen.pir src/Grammar.pg
 	$(PARROT) -o nqp.pbc nqp.pir
+	$(CP) nqp.pbc $(PARROT_LIB)/nqp.pbc
+	$(ADDGENERATED) "runtime/parrot/library/nqp.pbc"
 
 boot: $(BOOTSRC)
 	$(PARROT) nqp.pbc \
@@ -42,6 +47,8 @@
 	@echo ""
 	@echo "  all:               nqp.pbc"
 	@echo "                     This is the default."
+	@echo "  install:           nqp.pbc only"
+	@echo ""
 	@echo "Testing:"
 	@echo "  test:              Run the test suite."
 	@echo "  testclean:         Clean up test results."
@@ -58,6 +65,10 @@
 test: all
 	$(PERL) t/harness t
 
+install: build
+	-$(MKPATH) $(DESTDIR)$(LIB_DIR)/parrot/library
+	$(CP) nqp.pbc $(DESTDIR)$(LIB_DIR)/parrot/library
+
 # this target has nothing to do
 testclean:
 
Index: config/gen/makefiles/ext.in
===================================================================
--- config/gen/makefiles/ext.in	(revision 34627)
+++ config/gen/makefiles/ext.in	(working copy)
@@ -12,8 +12,14 @@
     Parrot-Embed
 
 # the default target
-all: $(EXT)
+build: $(EXT)
 
+all: build Makefile 
+
+# regenerate the Makefile
+Makefile: @build_dir@/config/gen/makefiles/json.in
+	cd @build_dir@ && $(RECONFIGURE) --step=gen::makefiles --target=compilers/json/Makefile
+
 # hard-code these for now
 test: Parrot-Embed
 	- cd Parrot-Embed && $(MAKE) test
@@ -66,3 +72,8 @@
 #IF(win32):	- cd Parrot-Embed && nmake clean
 #UNLESS(win32):	- cd Parrot-Embed && $(MAKE) clean
 
+#
+# Local variables:
+# mode: makefile
+# ex: ft=make
+# End:
Index: config/gen/makefiles/dynoplibs.in
===================================================================
--- config/gen/makefiles/dynoplibs.in	(revision 34627)
+++ config/gen/makefiles/dynoplibs.in	(working copy)
@@ -3,6 +3,7 @@
 PERL = @perl@
 RM_F = @rm_f@
 LOAD_EXT = @load_ext@
+RECONFIGURE   = $(PERL) @build_dir@/tools/dev/reconfigure.pl
 RUNTIME_DIR = @build_dir@/runtime/parrot/dynext
 O = @o@
 
@@ -14,12 +15,19 @@
 
 BUILD = $(PERL) @build_dir@/tools/build/dynoplibs.pl
 
-all :
+all : Makefile ../../tools/build/dynoplibs.pl
 	@$(BUILD) generate $(OPLIBS)
 	@$(BUILD) compile $(OPLIBS)
 	@$(BUILD) linklibs $(OPLIBS)
 	@$(BUILD) copy --destination=$(RUNTIME_DIR) $(OPLIBS)
 
+# regenerate the Makefile
+Makefile: ../../config/gen/makefiles/dynoplibs.in
+	cd @build_dir@ && $(RECONFIGURE) --step=gen::makefiles --target=src/dynoplibs/Makefile
+
+../../tools/build/dynoplibs.pl: ../../config/gen/makefiles/dynoplibs_pl.in
+	cd @build_dir@ && $(RECONFIGURE) --step=gen::makefiles --target=tools/build/dynoplibs.pl
+
 test : all
 	 cd ../.. ; perl -Ilib t/harness t/dynoplibs/*.t
 
@@ -34,8 +42,9 @@
 dynext-clean :
 	$(RM_F) "*.lib" "*.pdb" "*.ilk" "*.exp" "*.def" "*.manifest"
 
-clean : testclean dynext-clean
+clean : testclean
 	$(RM_F) "*.h" "*.c" "*$(LOAD_EXT)" "*$(O)"
+#IF(win32):	$(RM_F) "*.lib" "*.pdb" "*.ilk" "*.exp" "*.def" "*.manifest"
 
 archclean :
 	$(RM_F) "*$(LOAD_EXT)" "*$(O)" Makefile
@@ -46,3 +55,9 @@
 distclean: realclean
 
 svnclean: realclean
+
+#
+# Local variables:
+# mode: makefile
+# ex: ft=make
+# End:
Index: config/gen/makefiles/json.in
===================================================================
--- config/gen/makefiles/json.in	(revision 34627)
+++ config/gen/makefiles/json.in	(working copy)
@@ -4,11 +4,14 @@
 RM_F     = @rm_f@
 PARROT   = ../../parrot@exe@
 RECONFIGURE   = $(PERL) @build_dir@/tools/dev/reconfigure.pl
+ADDGENERATED  = $(PERL) ../../tools/build/addgenerated.pl
 #IF(parrot_is_shared and !(cygwin|win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH)
 
 TOOL_DIR = ../..
 PGE_DIR  = ../../compilers/pge
 TGE_DIR  = ../../compilers/tge
+PARROT_LIB = @build_dir@/runtime/parrot/library
+LIBS = JSON/grammar.pbc JSON/pge2pir.pbc
 
 # the default target
 build: JSON.pbc
@@ -26,6 +29,8 @@
 	@echo ""
 	@echo "  all:               JSON.pbc"
 	@echo "                     This is the default."
+	@echo "  install:           copy pbc's to runtime/parrot/library"
+	@echo ""
 	@echo "Testing:"
 	@echo "  test:              Run the test suite."
 	@echo "  testclean:         Clean up test results and temporary files."
@@ -45,19 +50,29 @@
 
 JSON.pbc : JSON/grammar.pbc JSON/pge2pir.pbc JSON.pir
 	$(PARROT) --output=JSON.pbc JSON.pir
+	$(ADDGENERATED) "compilers/json/$@"
 
 JSON/grammar.pbc : JSON/grammar.pir
 	$(PARROT) --output=JSON/grammar.pbc JSON/grammar.pir
+	$(ADDGENERATED) "compilers/json/$@"
 
 JSON/grammar.pir : JSON/grammar.pg
 	$(PARROT) $(TOOL_DIR)/runtime/parrot/library/PGE/Perl6Grammar.pbc --output=JSON/grammar.pir JSON/grammar.pg
 
 JSON/pge2pir.pbc : JSON/pge2pir.pir
 	$(PARROT) --output=JSON/pge2pir.pbc JSON/pge2pir.pir
+	$(ADDGENERATED) "compilers/json/$@"
 
 JSON/pge2pir.pir : JSON/pge2pir.tg
 	$(PARROT) $(TGE_DIR)/tgc.pir --output=JSON/pge2pir.pir JSON/pge2pir.tg
 
+# into runtime
+install : build
+	-$(MKPATH) $(DESTDIR)$(LIB_DIR)/parrot/library
+	-$(MKPATH) $(DESTDIR)$(LIB_DIR)/parrot/library/JSON
+	$(CP) JSON.pbc $(DESTDIR)$(LIB_DIR)/parrot/library
+	$(CP) $(LIBS) $(DESTDIR)$(LIB_DIR)/parrot/library/JSON
+
 clean : testclean
 	@rm_f@ "JSON/*.pbc" "JSON/*.pir" JSON.pbc