diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-04-08 11:01:58 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-04-08 11:01:58 -0300 |
commit | 05b97b078973c39870f58b53238dca456d2b43d7 (patch) | |
tree | 79c35b9d690667bef5471ca022bc6d6ede4fbff6 /v4l/scripts | |
parent | 672521a35cb79a8a1ae4de74f446ed1ae73a31b2 (diff) | |
download | mediapointer-dvb-s2-05b97b078973c39870f58b53238dca456d2b43d7.tar.gz mediapointer-dvb-s2-05b97b078973c39870f58b53238dca456d2b43d7.tar.bz2 |
Fix make install
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Previous patch broke make install. This patch fix it.
Also, serveral cleanups were made at core Makefile.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/make_makefile.pl | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index 135b8bdb1..48552c425 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -1,6 +1,8 @@ #!/usr/bin/perl use FileHandle; +my $instdir = (); + sub check_line($$$) { my $dir=shift; @@ -8,6 +10,10 @@ sub check_line($$$) my $arg=shift; my $arg2=""; + my $idir = $dir; + + $idir =~ s|^../linux/drivers/media/||; + $arg=$arg." "; while ($arg ne "") { @@ -18,7 +24,15 @@ sub check_line($$$) $arg =~ s/^[^ ]+ //; } else { $arg =~ s/^([^ ]+ )//; - $arg2 = $arg2.$1; + 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." "; + } } } $arg2 =~ s/\s+$//; @@ -95,10 +109,32 @@ sub open_makefile($) { open OUT,">Makefile.media"; open_makefile ("../linux/drivers/media/Makefile"); + +# Creating Install rule +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-install -d \$(KDIR26)/$key\n"; + printf OUT "\t-install -m 644 -c $value \$(KDIR26)/$key\n\n"; +} + +# Creating Remove rule +printf OUT "remove::\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 "\tcd \$(KDIR26)/$key\n"; + printf OUT "\t-rm $value\n\n"; +} + close OUT; while ( my ($key, $value) = each(%config) ) { - delete $depend{$key}; + delete $depend{$key}; } open OUT,">Kconfig.kern"; @@ -106,4 +142,3 @@ while ( my ($key, $value) = each(%depend) ) { print OUT "# $key with $value refs\nconfig $key\n\ttristate\n\tdefault m\n\n"; } close OUT; - |