From b664cece1c397677d509fa9a41874464f5a44214 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 8 Apr 2006 11:47:00 -0300 Subject: Some cleanups at make install From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_makefile.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'v4l') 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; -- cgit v1.2.3