Changeset 854

Show
Ignore:
Timestamp:
08/07/00 12:50:16 (8 years ago)
Author:
frodo
Message:

mkpatch update for new 2.4 kernels. Not well tested yet, may even

break on 2.2 kernels now - will try it next.

Files:

Legend:

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

    r516 r854  
    1717kernel/include/i2c-isa.h        include/linux/i2c-isa.h 
    1818kernel/include/sensors.h        include/linux/sensors.h 
    19 mkpatch/Makefile                drivers/sensors/Makefile 
    2019mkpatch/Config.in               drivers/sensors/Config.in 
  • lm-sensors/trunk/mkpatch/mkpatch.pl

    r782 r854  
    286286  open OUTPUT,">$package_root/$package_file" 
    287287        or die "Can't open $package_root/$package_file"; 
     288  `grep -q -s 'i2c\.o' "$kernel_root/$kernel_file"`; 
     289  $type = 2 if ! $?; 
    288290  MAIN: while(<INPUT>) { 
    289     $type = 1 if (m@^DRIVERS-\$@); 
     291    $type = 1 if !$type and (m@^DRIVERS-\$@); 
    290292    if (m@DRIVERS-\$\(CONFIG_SENSORS\)@) { 
    291293      $_ = <INPUT>; 
     
    300302      print OUTPUT <<'EOF'; 
    301303DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensors.a 
     304EOF 
     305      $pr1 = 1; 
     306    } 
     307    if ($type == 2 and m@^DRIVERS \+= \$\(DRIVERS-y\)@) { 
     308      print OUTPUT <<'EOF'; 
     309DRIVERS-$(CONFIG_SENSORS) += drivers/sensors/sensors.o 
    302310EOF 
    303311      $pr1 = 1; 
     
    535543} 
    536544 
     545sub gen_drivers_sensors_Makefile 
     546{ 
     547  my ($package_root,$kernel_root) = @_; 
     548  my $kernel_file = "drivers/sensors/Makefile"; 
     549  my $package_file = $temp; 
     550  my $use_new_format; 
     551  `grep -q -s 'i2c\.o' "$kernel_root/drivers/i2c/Makefile"`; 
     552  $use_new_format = ! $?; 
     553 
     554  open OUTPUT,">$package_root/$package_file" 
     555        or die "Can't open $package_root/$package_file"; 
     556  if ($use_new_format) { 
     557    print OUTPUT <<'EOF'; 
     558# 
     559# Makefile for the kernel hardware sensors drivers. 
     560# 
     561 
     562MOD_LIST_NAME := SENSORS_MODULES 
     563O_TARGET := sensors.o 
     564 
     565export-objs     := sensors.o 
     566 
     567obj-$(CONFIG_SENSORS)           += sensors.o 
     568obj-$(CONFIG_SENSORS_ADM1021)   += adm1021.o 
     569obj-$(CONFIG_SENSORS_ADM9024)   += adm9024.o 
     570obj-$(CONFIG_SENSORS_EEPROM)    += eeprom.o 
     571obj-$(CONFIG_SENSORS_GL518SM)   += gl518sm.o 
     572obj-$(CONFIG_SENSORS_LM75)      += lm75.o 
     573obj-$(CONFIG_SENSORS_LM78)      += lm78.o 
     574obj-$(CONFIG_SENSORS_LM80)      += lm80.o 
     575obj-$(CONFIG_SENSORS_LTC1710)   += ltc1710.o 
     576obj-$(CONFIG_SENSORS_SIS5595)   += sis5595.o 
     577obj-$(CONFIG_SENSORS_W83781D)   += w83781d.o 
     578 
     579O_OBJS          := $(filter-out $(export-objs), $(obj-y)) 
     580OX_OBJS         := $(filter     $(export-objs), $(obj-y)) 
     581M_OBJS          := $(sort $(filter-out  $(export-objs), $(obj-m))) 
     582MX_OBJS         := $(sort $(filter      $(export-objs), $(obj-m))) 
     583 
     584include $(TOPDIR)/Rules.make 
     585 
     586EOF 
     587  } else { 
     588    print OUTPUT <<'EOF'; 
     589# 
     590# Makefile for the kernel hardware sensors drivers. 
     591# 
     592 
     593SUB_DIRS     := 
     594MOD_SUB_DIRS := $(SUB_DIRS) 
     595ALL_SUB_DIRS := $(SUB_DIRS) 
     596MOD_LIST_NAME := SENSORS_MODULES 
     597 
     598L_TARGET := sensors.a 
     599MX_OBJS :=   
     600M_OBJS  :=  
     601LX_OBJS := 
     602L_OBJS  :=  
     603 
     604# ----- 
     605# i2c core components 
     606# ----- 
     607 
     608ifeq ($(CONFIG_SENSORS),y) 
     609  LX_OBJS += sensors.o 
     610else 
     611  ifeq ($(CONFIG_SENSORS),m) 
     612    MX_OBJS += sensors.o 
     613  endif 
     614endif 
     615 
     616ifeq ($(CONFIG_SENSORS_ADM1021),y) 
     617  L_OBJS += adm1021.o 
     618else 
     619  ifeq ($(CONFIG_SENSORS_ADM1021),m) 
     620    M_OBJS += adm1021.o 
     621  endif 
     622endif 
     623 
     624ifeq ($(CONFIG_SENSORS_ADM9024),y) 
     625  L_OBJS += adm9240.o 
     626else 
     627  ifeq ($(CONFIG_SENSORS_ADM9024),m) 
     628    M_OBJS += adm9240.o 
     629  endif 
     630endif 
     631 
     632ifeq ($(CONFIG_SENSORS_EEPROM),y) 
     633  L_OBJS += eeprom.o 
     634else 
     635  ifeq ($(CONFIG_SENSORS_EEPROM),m) 
     636    M_OBJS += eeprom.o 
     637  endif 
     638endif 
     639 
     640ifeq ($(CONFIG_SENSORS_GL518SM),y) 
     641  L_OBJS += gl518sm.o 
     642else 
     643  ifeq ($(CONFIG_SENSORS_GL518SM),m) 
     644    M_OBJS += gl518sm.o 
     645  endif 
     646endif 
     647 
     648ifeq ($(CONFIG_SENSORS_LM75),y) 
     649  L_OBJS += lm75.o 
     650else 
     651  ifeq ($(CONFIG_SENSORS_LM75),m) 
     652    M_OBJS += lm75.o 
     653  endif 
     654endif 
     655 
     656ifeq ($(CONFIG_SENSORS_LM78),y) 
     657  L_OBJS += lm78.o 
     658else 
     659  ifeq ($(CONFIG_SENSORS_LM78),m) 
     660    M_OBJS += lm78.o 
     661  endif 
     662endif 
     663 
     664ifeq ($(CONFIG_SENSORS_LM80),y) 
     665  L_OBJS += lm80.o 
     666else 
     667  ifeq ($(CONFIG_SENSORS_LM80),m) 
     668    M_OBJS += lm80.o 
     669  endif 
     670endif 
     671 
     672ifeq ($(CONFIG_SENSORS_LTC1710),y) 
     673  L_OBJS += ltc1710.o 
     674else 
     675  ifeq ($(CONFIG_SENSORS_LTC1710),m) 
     676    M_OBJS += ltc1710.o 
     677  endif 
     678endif 
     679 
     680ifeq ($(CONFIG_SENSORS_SIS5595),y) 
     681  L_OBJS += sis5595.o 
     682else 
     683  ifeq ($(CONFIG_SENSORS_SIS5595),m) 
     684    M_OBJS += sis5595.o 
     685  endif 
     686endif 
     687 
     688ifeq ($(CONFIG_SENSORS_W83781D),y) 
     689  L_OBJS += w83781d.o 
     690else 
     691  ifeq ($(CONFIG_SENSORS_W83781D),m) 
     692    M_OBJS += w83781d.o 
     693  endif 
     694endif 
     695 
     696include $(TOPDIR)/Rules.make 
     697EOF 
     698  }   
     699  close OUTPUT; 
     700  print_diff $package_root,$kernel_root,$kernel_file,$package_file; 
     701} 
     702 
    537703# This generates diffs for drivers/i2c/Makefile. 
    538704# Lines to add correct files to M_OBJS and/or L_OBJS are added just before 
     
    547713  my $package_file = $temp; 
    548714  my $pr1 = 0; 
     715  my $new_format = 0; 
    549716 
    550717  open INPUT,"$kernel_root/$kernel_file" 
     
    553720        or die "Can't open $package_root/$package_file"; 
    554721  while(<INPUT>) { 
     722    $new_format = 1 if m@i2c\.o@; 
    555723    if (m@sensors code starts here@) { 
    556724      $pr1 ++; 
     
    559727        last if m@sensors code ends here@; 
    560728      } 
    561       print OUTPUT << 'EOF'; 
     729      if ($new_format) { 
     730        print OUTPUT << 'EOF'; 
     731obj-$(CONFIG_I2C_ALI15X3)               += i2c-ali15x3.o 
     732obj-$(CONFIG_I2C_ALI15X3)               += i2c-hydra.o 
     733obj-$(CONFIG_I2C_ALI15X3)               += i2c-piix4.o 
     734obj-$(CONFIG_I2C_ALI15X3)               += i2c-via.o 
     735obj-$(CONFIG_I2C_ALI15X3)               += i2c-isa.o 
     736EOF 
     737      } else { 
     738        print OUTPUT << 'EOF'; 
    562739ifeq ($(CONFIG_I2C_ALI15X3),y) 
    563740  L_OBJS += i2c-ali15x3.o 
     
    601778 
    602779EOF 
     780      } 
    603781    } 
    604782    print OUTPUT; 
     
    707885P:      Frodo Looijaard 
    708886M:      frodol@dds.nl 
    709 P:     Philip Edelbrock 
    710 M:     phil@netroedge.com 
     887P:      Philip Edelbrock 
     888M:      phil@netroedge.com 
    711889L:      sensors@stimpy.netroedge.com 
    712890W:      http://www.lm-sensors.nu/ 
     
    791969  gen_Makefile $package_root, $kernel_root; 
    792970  gen_drivers_Makefile $package_root, $kernel_root; 
     971  gen_drivers_sensors_Makefile $package_root, $kernel_root; 
    793972  gen_drivers_char_Config_in $package_root, $kernel_root; 
    794973  gen_drivers_char_mem_c $package_root, $kernel_root;