Skip to content

Commit

Permalink
more banging on dependencies
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/branches/depends@40391 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
petdance committed Aug 3, 2009
1 parent 808cb17 commit 6a3fa79
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/gen/makefiles.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ sub _init {
$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' => {
Expand Down
5 changes: 5 additions & 0 deletions config/gen/makefiles/root.in
Original file line number Diff line number Diff line change
Expand Up @@ -2287,6 +2287,11 @@ DEPENDENCY_FILES := $(subst $(O),.c,$(HEADERIZER_O_FILES))
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:
Expand Down
28 changes: 28 additions & 0 deletions tools/dev/makedeps.pl
Original file line number Diff line number Diff line change
@@ -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 $!;


}

0 comments on commit 6a3fa79

Please sign in to comment.