diff options
-rwxr-xr-x | v4l/scripts/make_makefile.pl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index 48552c425..1063617a1 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -26,10 +26,12 @@ sub check_line($$$) $arg =~ s/^([^ ]+ )//; my $cur=$1; $arg2 = $arg2.$cur; + $cur =~ s/\s+$//; $cur =~ s/\\$//; $cur =~ s/\s+$//; $cur =~ s/\.o$/.ko/; + if ( ($cur ne "") && (! ($instdir { $idir } =~ m/($cur) /))) { $instdir { $idir } = $instdir { $idir }.$cur." "; } @@ -115,9 +117,11 @@ printf OUT "install::\n"; printf OUT "\t@strip --strip-debug \$(inst-m)\n\n"; while ( my ($key, $value) = each(%instdir) ) { - printf OUT "\t\@echo -e \"\\nInstalling \$(KDIR26)/$key files\\n\"\n"; + printf OUT "\t\@echo -e \"\\nInstalling \$(KDIR26)/$key files\"\n"; printf OUT "\t-install -d \$(KDIR26)/$key\n"; - printf OUT "\t-install -m 644 -c $value \$(KDIR26)/$key\n\n"; + + printf OUT "\t\@files='$value'; "; + printf OUT "for i in \$\$files; do install -m 644 -c \$\$i \$(KDIR26)/$key; done\n\n"; } # Creating Remove rule @@ -127,8 +131,8 @@ printf OUT "\t-rm -r \$(DEST)\n\n"; while ( my ($key, $value) = each(%instdir) ) { printf OUT "\t\@echo -e \"\\nRemoving old \$(KDIR26)/$key files\\n\"\n"; - printf OUT "\tcd \$(KDIR26)/$key\n"; - printf OUT "\t-rm $value\n\n"; + printf OUT "\t\@files='$value'; "; + printf OUT "for i in \$\$files; do rm \$(KDIR26)/$key/\$\$i; done\n\n"; } close OUT; |