diff options
Diffstat (limited to 'v4l/scripts/make_makefile.pl')
-rwxr-xr-x | v4l/scripts/make_makefile.pl | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index 8371f6a4a..e0a099e9b 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl use FileHandle; +my $kernel=shift; my $instdir = (); sub check_line($$$) @@ -109,12 +110,13 @@ sub open_makefile($) { close $in; } -open OUT,">Makefile.media"; +open OUT,">Makefile.media.new"; 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 "media-install::\n"; +printf OUT "\t\@echo \"Stripping debug info from files:\"\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"; @@ -127,7 +129,7 @@ while ( my ($key, $value) = each(%instdir) ) { printf OUT "\t/sbin/depmod -a \${KERNELRELEASE}\n\n"; # Creating Remove rule -printf OUT "remove rminstall::\n"; +printf OUT "media-rminstall::\n"; printf OUT "\t\@echo -e \"\\nRemoving old \$(DEST) files\\n\"\n"; while ( my ($key, $value) = each(%instdir) ) { @@ -155,10 +157,30 @@ while ( my ($key, $value) = each(%depend) ) { } close OUT; -if (open OUT,".myconfig") { +if (open IN,"Makefile.media") { close IN; + my $changed=0; + if (open IN,"diff Makefile.media Makefile.media.new|") { + while (<IN>) { + if ($_ ne "") { + $changed=1; + } + } + close IN; + if ($changed) { + printf("One or more linux Makefiles had changed. Makefile.media rewrited.\n"); + system ("mv Makefile.media.new Makefile.media"); + } else { + system ("rm Makefile.media.new"); + } + } } else { - system "make allmodconfig"; + printf("Creating Makefile.media.\n"); + system "mv Makefile.media.new Makefile.media"; } - +if (open IN,".myconfig") { + close IN; +} else { + system "./scripts/make_kconfig.pl $kernel 1"; +} |