From f5a63349b2b9e0daf5c7a993792af521e3dda46f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 8 Apr 2006 16:05:48 -0300 Subject: Some cleanups at make install/make remove From: Mauro Carvalho Chehab Now, it won't generate errors for non-compiled objects. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_makefile.pl | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index 1063617a1..17ef048e7 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -114,25 +114,32 @@ open_makefile ("../linux/drivers/media/Makefile"); # Creating Install rule printf OUT "install::\n"; -printf OUT "\t@strip --strip-debug \$(inst-m)\n\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"; - printf OUT "\t-install -d \$(KDIR26)/$key\n"; + printf OUT "\t\@echo -e \"\\nInstalling \$(KDIR26)/$key files:\"\n"; + printf OUT "\t\@install -d \$(KDIR26)/$key\n"; printf OUT "\t\@files='$value'; "; - printf OUT "for i in \$\$files; do install -m 644 -c \$\$i \$(KDIR26)/$key; done\n\n"; + printf OUT "for i in \$\$files;do if [ -e \$\$i ]; then echo -n \"\$\$i \";"; + printf OUT " install -m 644 -c \$\$i \$(KDIR26)/$key; fi; done; echo;\n\n"; } # Creating Remove rule -printf OUT "remove::\n"; +printf OUT "remove rminstall::\n"; printf OUT "\t\@echo -e \"\\nRemoving old \$(DEST) files\\n\"\n"; -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 "\t\@echo -e \"\\nRemoving old \$(KDIR26)/$key files:\"\n"; printf OUT "\t\@files='$value'; "; - printf OUT "for i in \$\$files; do rm \$(KDIR26)/$key/\$\$i; done\n\n"; + + printf OUT "for i in \$\$files;do if [ -e \$(KDIR26)/$key/\$\$i ]; then "; + printf OUT "echo -n \"\$\$i \";"; + printf OUT " rm \$(KDIR26)/$key/\$\$i; fi; done; "; + + printf OUT "for i in \$\$files;do if [ -e \$(KDIR26)/$key/\$\$i.gz ]; then "; + printf OUT "echo -n \"\$\$i.gz \";"; + printf OUT " rm \$(KDIR26)/$key/\$\$i.gz; fi; done; echo;\n\n"; } close OUT; -- cgit v1.2.3