diff options
Diffstat (limited to 'v4l/scripts/make_makefile.pl')
-rwxr-xr-x | v4l/scripts/make_makefile.pl | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index 709546fca..82821b43b 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -124,38 +124,27 @@ sub open_makefile($) { close $in; } -my $obsolete; +my %obsolete; sub getobsolete() { - open OBSOLETE, "<obsolete.txt"; - while (<OBSOLETE>) { - if (m/^\s*\#/) { - next; - } - s/\s*\#.*$//; - s/\n$//; - - my $idir=$_; - - if (!$idir) { - next; + open OBSOLETE, '<obsolete.txt' or die "Can't open obsolete.txt: $!"; + while (<OBSOLETE>) { + next if (/^\s*#/ || /^\s*$/); + chomp; + if (m|^(.*)/([^/]*)$|) { + $obsolete{$1}{"$2.ko"} = 1; + } else { + print "Unable to parse obsolete.txt:$.\n$_\n"; } - my $file=$_; - - $idir=~ s|(^.*)/[^/]+|\1|; - $file=~ s|^.*/||; - $file.=".ko"; - - $obsolete{$idir}{$file} = 1; - } + } - close OBSOLETE; + close OBSOLETE; } sub removeobsolete() { while ( my ($dir, $files) = each(%obsolete) ) { - print OUT "\t\@echo -e \"\\nRemoving obsolete files at \$(KDIR26)/$dir:\"\n"; + print OUT "\t\@echo -e \"\\nRemoving obsolete files from \$(KDIR26)/$dir:\"\n"; print OUT "\t\@files='", join(' ', keys %$files), "'; "; print OUT "for i in \$\$files;do if [ -e \$(DESTDIR)\$(KDIR26)/$dir/\$\$i ]; then "; @@ -219,6 +208,7 @@ while ( my ($dir, $files) = each(%instdir) ) { # Print dependencies of Makefile.media print OUT "Makefile.media: ../linux/drivers/media/Makefile \\\n"; +print OUT "\tobsolete.txt \\\n"; print OUT join(" \\\n", map("\t../linux/drivers/media/$_/Makefile", keys %instdir)); print OUT "\n"; close OUT; |