From 7b614fddb1b412f6ec17b91907a4473ed08e97de Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Fri, 9 Mar 2007 14:02:18 -0800 Subject: build: Add support for DESTDIR when installing/removing modules From: Ludwig Nussel If defined, use $(DESTDIR) as a prefix for installing and removing modules. depmod will also use $(DESTDIR) as a prefix when it is run as part of module installation. Signed-off-by: Ludwig Nussel Signed-off-by: Trent Piepho --- v4l/scripts/make_makefile.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'v4l') diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index e1e08b578..8711cc5a8 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -134,12 +134,12 @@ print OUT "\t\@strip --strip-debug \$(inst-m)\n\n"; while (my ($dir, $files) = each %instdir) { print OUT "\t\@echo -e \"\\nInstalling \$(KDIR26)/$dir files:\"\n"; - print OUT "\t\@install -d \$(KDIR26)/$dir\n"; + print OUT "\t\@install -d \$(DESTDIR)\$(KDIR26)/$dir\n"; print OUT "\t\@for i in ", join(' ', keys %$files), ";do "; print OUT "if [ -e \"\$\$i\" ]; then echo -n \"\$\$i \";"; - print OUT " install -m 644 -c \$\$i \$(KDIR26)/$dir; fi; done; echo;\n\n"; + print OUT " install -m 644 -c \$\$i \$(DESTDIR)\$(KDIR26)/$dir; fi; done; echo;\n\n"; } -print OUT "\t/sbin/depmod -a \${KERNELRELEASE}\n\n"; +print OUT "\t/sbin/depmod -a \$(KERNELRELEASE) \$(if \$(DESTDIR),-b \$(DESTDIR))\n\n"; # Creating Remove rule print OUT "media-rminstall::\n"; @@ -149,13 +149,13 @@ while ( my ($dir, $files) = each(%instdir) ) { print OUT "\t\@echo -e \"\\nRemoving old \$(KDIR26)/$dir files:\"\n"; print OUT "\t\@files='", join(' ', keys %$files), "'; "; - print OUT "for i in \$\$files;do if [ -e \$(KDIR26)/$dir/\$\$i ]; then "; + print OUT "for i in \$\$files;do if [ -e \$(DESTDIR)\$(KDIR26)/$dir/\$\$i ]; then "; print OUT "echo -n \"\$\$i \";"; - print OUT " rm \$(KDIR26)/$dir/\$\$i; fi; done; "; + print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i; fi; done; "; - print OUT "for i in \$\$files;do if [ -e \$(KDIR26)/$dir/\$\$i.gz ]; then "; + print OUT "for i in \$\$files;do if [ -e \$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz ]; then "; print OUT "echo -n \"\$\$i.gz \";"; - print OUT " rm \$(KDIR26)/$dir/\$\$i.gz; fi; done; echo;\n\n"; + print OUT " rm \$(DESTDIR)\$(KDIR26)/$dir/\$\$i.gz; fi; done; echo;\n\n"; } # Print dependencies of Makefile.media -- cgit v1.2.3