Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more banging on dependencies

git-svn-id: https://svn.parrot.org/parrot/branches/depends@40391 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit 6a3fa79777801a09113d5a9b0924a692496a3ce8 1 parent 808cb17
petdance authored
View
1  config/gen/makefiles.pm
@@ -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' => {
View
5 config/gen/makefiles/root.in
@@ -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:
View
28 tools/dev/makedeps.pl
@@ -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 $!;
+
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.