Changeset 782

Show
Ignore:
Timestamp:
03/16/00 15:29:40 (9 years ago)
Author:
frodo
Message:

CHanges to mkpatch for the new kernel Makefile setup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/mkpatch/mkpatch.pl

    r738 r782  
    279279  my $kernel_file = "Makefile"; 
    280280  my $package_file = $temp; 
     281  my $type = 0; 
     282  my $pr1 = 0; 
    281283 
    282284  open INPUT,"$kernel_root/$kernel_file" 
     
    285287        or die "Can't open $package_root/$package_file"; 
    286288  MAIN: while(<INPUT>) { 
    287     if (m@CONFIG_SENSORS@) { 
     289    $type = 1 if (m@^DRIVERS-\$@); 
     290    if (m@DRIVERS-\$\(CONFIG_SENSORS\)@) { 
     291      $_ = <INPUT>; 
     292      redo MAIN; 
     293    } elsif (m@CONFIG_SENSORS@) { 
    288294      $_ = <INPUT> while not m@endif@; 
    289295      $_ = <INPUT>; 
     
    291297      redo MAIN; 
    292298    } 
    293     if (m@include arch/\$\(ARCH\)/Makefile@) { 
     299    if ($type == 1 and m@^DRIVERS \+= \$\(DRIVERS-y\)@) { 
     300      print OUTPUT <<'EOF'; 
     301DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensors.a 
     302EOF 
     303      $pr1 = 1; 
     304    } 
     305    if ($type == 0 and m@include arch/\$\(ARCH\)/Makefile@) { 
    294306      print OUTPUT <<'EOF'; 
    295307ifeq ($(CONFIG_SENSORS),y) 
     
    298310 
    299311EOF 
     312      $pr1 = 1; 
    300313    } 
    301314    print OUTPUT; 
     
    303316  close INPUT; 
    304317  close OUTPUT; 
     318  die "Automatic patch generation for `Makefile' failed.\n". 
     319      "Contact the authors please!" if $pr1 == 0; 
    305320  print_diff $package_root,$kernel_root,$kernel_file,$package_file; 
    306321}