summaryrefslogtreecommitdiff
path: root/check-headers-in-Makefile.pl
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2000-09-15 17:39:49 +0000
committerDarin Adler <darin@src.gnome.org>2000-09-15 17:39:49 +0000
commit4c197a238feacb7a0d8ee1ec2f94b2c5903d5906 (patch)
tree4ee71e515b12d73473b6c935a8aab14ef0035645 /check-headers-in-Makefile.pl
parent42e1899a883cbd492ee839db68bc7fcdb9ce3135 (diff)
downloadnautilus-4c197a238feacb7a0d8ee1ec2f94b2c5903d5906.tar.gz
Another try at fixing the Tinderbox.
* po/POTFILES.in: Removed files that are not in Makefile.am, since they won't be in the tarball/RPM. * check-POTFILES.pl: Added a new script to check for files that are mentioned in POTFILES.in, but not in the Makefile.am files. * check-headers-in-Makefile.pl: Fixed to use SUBDIRS instead of looking for all Makefile.am files. * components/adapter/.cvsignore: Listed generated files.
Diffstat (limited to 'check-headers-in-Makefile.pl')
-rwxr-xr-xcheck-headers-in-Makefile.pl61
1 files changed, 50 insertions, 11 deletions
diff --git a/check-headers-in-Makefile.pl b/check-headers-in-Makefile.pl
index 447e48768..3c41f5c20 100755
--- a/check-headers-in-Makefile.pl
+++ b/check-headers-in-Makefile.pl
@@ -23,28 +23,67 @@
# Author: Darin Adler <darin@eazel.com>,
#
-# check-config-h.pl: Search for .c files where someone forgot to
-# put an include for <config.h> in.
+# check-headers-in-Makefile.pl: Checks the contents of the source
+# directories against the contents of the Makefile.am files.
use diagnostics;
use strict;
-# default to all the files starting from the current directory
-if (!@ARGV)
- {
- @ARGV = `find . -name 'Makefile\.am' -print`;
- }
+my @directories = (".");
-foreach my $file (@ARGV)
+my %exceptions =
+ (
+ '$(AUTHENTICATE_HELPER_SUBDIRS)' => 'authenticate',
+ '$(MOZILLA_COMPONENT_SUBDIRS)' => 'mozilla',
+ '$(NULL)' => '',
+ '$(RPMVIEW_COMPONENT_SUBDIRS)' => 'rpmview',
+ '$(SERVICE_SUBDIRS)' => 'services',
+ 'intl' => '',
+ 'po' => '',
+ );
+
+while (@directories)
{
- chomp $file;
- my $directory = $file;
- $directory =~ s|/Makefile\.am||;
+ my $directory = pop @directories;
+ my $prefix = "";
+ $prefix = "$directory/" if $directory ne ".";
+
+ my $in_subdirs = 0;
+ my $file = $prefix . "Makefile.am";
open FILE, $file or die "can't open $file";
my %headers;
while (<FILE>)
{
+ if (s/^SUBDIRS\s*=//)
+ {
+ $in_subdirs = 1;
+ }
+ if ($in_subdirs)
+ {
+ while (s/^\s*([^\s\\]+)//)
+ {
+ if (defined $exceptions{$1})
+ {
+ if ($exceptions{$1})
+ {
+ push @directories, $prefix . $exceptions{$1};
+ }
+ }
+ else
+ {
+ push @directories, $prefix . $1;
+ }
+ }
+ if (/^\s*$/)
+ {
+ $in_subdirs = 0;
+ }
+ elsif (!/^\s*\\$/)
+ {
+ die "can't parse SUBDIRS in $directory\n";
+ }
+ }
while (s/([-_a-zA-Z0-9]+\.[ch])\W//)
{
$headers{$1} = $1;