[svn:parrot] r43383 - branches/one_make/tools/dev
coke at svn.parrot.org
coke at svn.parrot.org
Tue Jan 5 16:51:22 UTC 2010
Author: coke
Date: Tue Jan 5 16:51:20 2010
New Revision: 43383
URL: https://trac.parrot.org/parrot/changeset/43383
Log:
Add --dump option and some docs.
Modified:
branches/one_make/tools/dev/checkdepend.pl
Modified: branches/one_make/tools/dev/checkdepend.pl
==============================================================================
--- branches/one_make/tools/dev/checkdepend.pl Tue Jan 5 15:23:07 2010 (r43382)
+++ branches/one_make/tools/dev/checkdepend.pl Tue Jan 5 16:51:20 2010 (r43383)
@@ -21,17 +21,30 @@
A braindead script to check that every F<.c> file has makefile deps
on its includes.
+ checkdepend.pl [--dump]
+
+If called with C<--dump>, no tests are run, and the pre-processed makefile
+is dumped (in lieu of having C<cc>'s C<-E> for C<make>.
+
=head1 REQUIREMENTS
A built parrot (Configure and make) to generate all files so we can analyze
them. Ack is used to find the files. We are not currently requiring ack
for development, so this is an optional test.
+=heads BUGS
+
+The pre-processing of the makefile doesn't follow make's behavior: variables
+should have no value until they are defined; in our pre-processing, their
+values are propagated throughout the makefile regardless of order; This could
+cause false positives in the test output.
+
=cut
die 'no Makefile found; This tool requires a full build for analysis.'
unless -e 'Makefile';
+
my $files = `ack -fa {src,compilers,include} | grep '\\.[ch]\$'`;
our %deps;
@@ -76,8 +89,6 @@
}
}
-plan('no_plan');
-
open my $mf, '<', "Makefile";
my $rules;
{
@@ -114,6 +125,13 @@
$rules =~ s/\Q$(PARROT_H_HEADERS)/$phh/g;
+if (@ARGV && $ARGV[0] eq '--dump') {
+ print $rules;
+ exit 0;
+}
+
+plan('no_plan');
+
foreach my $header (sort grep {/\.h$/} (keys %deps)) {
# static headers shouldn't depend on anything else.
if ($rules =~ /^$header\s*:\s*(.*)\s*$/m) {
More information about the parrot-commits
mailing list