From 2bbd90fc401973fae83e49f8e7a23053e455d0af Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Mon, 9 Oct 2000 19:07:56 +0000 Subject: [PATCH] mkpatch loop solved for test9 kernels git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@896 7894878c-1315-0410-8ee3-d5d059ff63e0 --- mkpatch/mkpatch.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mkpatch/mkpatch.pl b/mkpatch/mkpatch.pl index 40a6815a..1c8f735c 100755 --- a/mkpatch/mkpatch.pl +++ b/mkpatch/mkpatch.pl @@ -343,13 +343,17 @@ sub gen_drivers_Makefile my $sensors_present; my $pr1 = 0; my $pr2 = 0; + my $new_style = 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@^ALL_SUB_DIRS\s*:=@) { + if (m@^mod-subdirs\s*:=@) { + $new_style = 1; + } + if ((! $new_style and m@^ALL_SUB_DIRS\s*:=@) or m@^nid0subdirs\s*:=@) { $pr1 = 1; $sensors_present = 0; while (m@\\$@) { @@ -363,14 +367,23 @@ sub gen_drivers_Makefile $_ = ; redo MAIN; } - if (m@CONFIG_SENSORS@) { + if (m@^ifeq.*CONFIG_SENSORS@) { $_ = while not m@^endif@; $_ = ; $_ = if m@^$@; redo MAIN; } + if (m@^subdir.*CONFIG_I2C@) { + $_ = ; + redo MAIN; + } if (m@^include \$\(TOPDIR\)/Rules.make$@) { $pr2 = 1; + if ($new_style) { + print OUTPUT <<'EOF'; +subdir-$(CONFIG_SENSORS) += sensors +EOF + } else { print OUTPUT <<'EOF'; ifeq ($(CONFIG_SENSORS),y) SUB_DIRS += sensors @@ -382,6 +395,7 @@ else endif EOF + } } print OUTPUT; }