From 5bb3bc74d2c39735c4177a7987458cfae6df4343 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Thu, 16 Mar 2000 14:29:40 +0000 Subject: [PATCH] CHanges to mkpatch for the new kernel Makefile setup git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@782 7894878c-1315-0410-8ee3-d5d059ff63e0 --- mkpatch/mkpatch.pl | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mkpatch/mkpatch.pl b/mkpatch/mkpatch.pl index 6ceb4009..fcd71ed7 100755 --- a/mkpatch/mkpatch.pl +++ b/mkpatch/mkpatch.pl @@ -278,30 +278,45 @@ sub gen_Makefile my ($package_root,$kernel_root) = @_; my $kernel_file = "Makefile"; my $package_file = $temp; + my $type = 0; + my $pr1 = 0; open INPUT,"$kernel_root/$kernel_file" or die "Can't open `$kernel_root/$kernel_file'"; open OUTPUT,">$package_root/$package_file" or die "Can't open $package_root/$package_file"; MAIN: while() { - if (m@CONFIG_SENSORS@) { + $type = 1 if (m@^DRIVERS-\$@); + if (m@DRIVERS-\$\(CONFIG_SENSORS\)@) { + $_ = ; + redo MAIN; + } elsif (m@CONFIG_SENSORS@) { $_ = while not m@endif@; $_ = ; $_ = if m@^$@; redo MAIN; } - if (m@include arch/\$\(ARCH\)/Makefile@) { + if ($type == 1 and m@^DRIVERS \+= \$\(DRIVERS-y\)@) { + print OUTPUT <<'EOF'; +DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensors.a +EOF + $pr1 = 1; + } + if ($type == 0 and m@include arch/\$\(ARCH\)/Makefile@) { print OUTPUT <<'EOF'; ifeq ($(CONFIG_SENSORS),y) DRIVERS := $(DRIVERS) drivers/sensors/sensors.a endif EOF + $pr1 = 1; } print OUTPUT; } close INPUT; close OUTPUT; + die "Automatic patch generation for `Makefile' failed.\n". + "Contact the authors please!" if $pr1 == 0; print_diff $package_root,$kernel_root,$kernel_file,$package_file; }