[svn:parrot] r40391 - in branches/depends: config/gen config/gen/makefiles tools/dev
petdance at svn.parrot.org
petdance at svn.parrot.org
Mon Aug 3 05:06:40 UTC 2009
Author: petdance
Date: Mon Aug 3 05:06:37 2009
New Revision: 40391
URL: https://trac.parrot.org/parrot/changeset/40391
Log:
more banging on dependencies
Added:
branches/depends/tools/dev/makedeps.pl
Modified:
branches/depends/config/gen/makefiles.pm
branches/depends/config/gen/makefiles/root.in
Modified: branches/depends/config/gen/makefiles.pm
==============================================================================
--- branches/depends/config/gen/makefiles.pm Sun Aug 2 18:19:33 2009 (r40390)
+++ branches/depends/config/gen/makefiles.pm Mon Aug 3 05:06:37 2009 (r40391)
@@ -28,6 +28,7 @@
$data{result} = q{};
$data{makefiles} = {
'Makefile' => { SOURCE => 'config/gen/makefiles/root.in' },
+ 'depend.mk' => { SOURCE => 'config/gen/makefiles/depend.in' },
'ext/Makefile' => { SOURCE => 'config/gen/makefiles/ext.in', },
'ext/Parrot-Embed/Makefile.PL' => {
Modified: branches/depends/config/gen/makefiles/root.in
==============================================================================
--- branches/depends/config/gen/makefiles/root.in Sun Aug 2 18:19:33 2009 (r40390)
+++ branches/depends/config/gen/makefiles/root.in Mon Aug 3 05:06:37 2009 (r40391)
@@ -2287,6 +2287,11 @@
depend:
makedepend -fconfig/gen/makefiles/depend.in -o'$$(O)' -- $(CFLAGS) -- $(DEPENDENCY_FILES)
+makedeps:
+ tools/dev/makedeps.pl $(HEADERIZER_O_FILES) > depend.mk
+
+include depend.mk
+
# Local variables:
# mode: makefile
# End:
Added: branches/depends/tools/dev/makedeps.pl
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/depends/tools/dev/makedeps.pl Mon Aug 3 05:06:37 2009 (r40391)
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+# This dependency builder is about as brute-force as it gets, but it's
+# better than nothing.
+
+my @objects = @ARGV;
+
+for my $object ( @objects ) {
+ my $source = $object;
+
+ $source =~ s{[.]o$}{.c} or die "Got an object that doesn't end in .o";
+
+ open( my $fh, '<', $source ) or die "Can't read $source: $!";
+
+ while ( my $line = <$fh> ) {
+ if ( $line =~ /^\s*#include\s+"([^"]+)"/ ) {
+ my $include_file = $1;
+ print "$source: $include_file\n";
+ }
+ }
+
+ close $fh or die $!;
+
+
+}
More information about the parrot-commits
mailing list