Changeset 11

Show
Ignore:
Timestamp:
11/22/98 22:36:52 (15 years ago)
Author:
frodo
Message:

Makefile enhancements, printk enhancements

* Modules now print their version number and date on insertion
* Some printk statements missed a \n
* 'make clean' now works, even if some .d (dependency) files contain garbage.

Note that *only* 'make clean' helps in that case; 'make clean all', for
example, will fail! There is really no nice way to solve that.

Location:
lm-sensors/trunk
Files:
11 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/Makefile

    r8 r11  
    4040WARN := 0 
    4141#WARN := 1 
     42 
     43# Uncomment the second line if you want to get (loads of) debug information. 
     44# Not recommended, unless you are actually debugging the code 
     45DEBUG := 0 
     46#DEBUG := 1 
    4247 
    4348# This is the directory into which the modules will be installed, if you 
     
    107112 
    108113# Include all makefiles for sub-modules 
     114INCLUDEFILES :=  
    109115include $(patsubst %,%/Module.mk,$(MODULES)) 
     116ifneq ($(MAKECMDGOALS),clean) 
     117include $(INCLUDEFILES) 
     118endif 
    110119 
    111120# Making the dependency files - done automatically! 
    112 dep: 
     121dep :  
    113122 
    114123all :: 
  • lm-sensors/trunk/i2c/Module.mk

    r8 r11  
    2828 
    2929# Include all dependency files 
    30 include $(I2CTARGETS:.o=.d) 
     30INCLUDEFILES += $(I2CTARGETS:.o=.d) 
    3131 
    3232all :: $(I2CTARGETS) 
  • lm-sensors/trunk/i2c/detect/Module.mk

    r8 r11  
    2727 
    2828# Include all dependency files 
    29 include $(I2CDETECTSOURCES:.c=.d) 
     29INCLUDEFILES += $(I2CDETECTSOURCES:.c=.d) 
    3030 
    3131all :: $(I2CDETECTTARGETS) 
  • lm-sensors/trunk/i2c/drivers/Module.mk

    r8 r11  
    2626 
    2727# Include all dependency files 
    28 include $(I2CDRIVERTARGETS:.o=.d) 
     28INCLUDEFILES += $(I2CDRIVERTARGETS:.o=.d) 
    2929 
    3030all :: $(I2CDRIVERTARGETS) 
  • lm-sensors/trunk/i2c/eeprom/Module.mk

    r8 r11  
    2727 
    2828# Include all dependency files 
    29 include $(I2CEEPROMSOURCES:.c=.d) 
     29INCLUDEFILES += $(I2CEEPROMSOURCES:.c=.d) 
    3030 
    3131all :: $(I2CEEPROMTARGETS) 
  • lm-sensors/trunk/kernel/Module.mk

    r9 r11  
    2626 
    2727# Include all dependency files 
    28 include $(SRCTARGETS:.o=.d) 
     28INCLUDEFILES += $(SRCTARGETS:.o=.d) 
    2929 
    3030all :: $(SRCTARGETS) 
  • lm-sensors/trunk/kernel/busses/i2c-piix4.c

    r9 r11  
    2121#include <linux/kernel.h> 
    2222#include "smbus.h" 
     23#include "version.h" 
    2324 
    2425static int piix4_init(void); 
     
    4041int piix4_setup(void) 
    4142{ 
     43  return -ENODEV; 
    4244  /* TO BE WRITTEN! */ 
    4345} 
     
    5456{ 
    5557  int res; 
     58  printk("piix4.o version %s (%s)\n",LM_VERSION,LM_DATE); 
    5659#ifdef DEBUG 
    5760  if (piix4_initialized) { 
    58     printk("piix4.o: Oops, piix4_init called a second time!"); 
     61    printk("piix4.o: Oops, piix4_init called a second time!\n"); 
    5962    return -EBUSY; 
    6063  } 
     
    6265  piix4_initialized = 0; 
    6366  if ((res = piix4_setup())) { 
    64     printk("piix4.o: PIIX4 not detected, module not inserted"); 
     67    printk("piix4.o: PIIX4 not detected, module not inserted\n"); 
    6568    piix4_cleanup(); 
    6669    return res; 
     
    7275  piix4_adapter.smbus_access = &piix4_access; 
    7376  if ((res = smbus_add_adapter(&piix4_adapter))) { 
    74     printk("piix4.o: smbus_add_adapter failed, module not inserted"); 
     77    printk("piix4.o: smbus_add_adapter failed, module not inserted\n"); 
    7578    piix4_cleanup(); 
    7679    return res; 
    7780  } 
    7881  piix4_initialized++; 
    79   printk("piix4.o: PIIX4 bus detected and initialized"); 
     82  printk("piix4.o: PIIX4 bus detected and initialized\n"); 
    8083  return 0; 
    8184} 
  • lm-sensors/trunk/kernel/smbus.c

    r9 r11  
    2727#endif 
    2828 
     29#include "version.h" 
    2930#include "smbus.h" 
    3031 
     
    202203{ 
    203204  int res; 
     205  printk("smbus.o version %s (%s)\n",LM_VERSION,LM_DATE); 
    204206  if ((res = smbus_add_algorithm(&smbus_algorithm))) 
    205207    printk("Module smbus.o not inserted!\n"); 
    206208  else 
    207     printk("smbus.o initialized"); 
     209    printk("smbus.o initialized\n"); 
    208210  return res; 
    209211} 
  • lm-sensors/trunk/src/Module.mk

    r9 r11  
    2626 
    2727# Include all dependency files 
    28 include $(SRCTARGETS:.o=.d) 
     28INCLUDEFILES += $(SRCTARGETS:.o=.d) 
    2929 
    3030all :: $(SRCTARGETS) 
  • lm-sensors/trunk/src/piix4.c

    r9 r11  
    2121#include <linux/kernel.h> 
    2222#include "smbus.h" 
     23#include "version.h" 
    2324 
    2425static int piix4_init(void); 
     
    4041int piix4_setup(void) 
    4142{ 
     43  return -ENODEV; 
    4244  /* TO BE WRITTEN! */ 
    4345} 
     
    5456{ 
    5557  int res; 
     58  printk("piix4.o version %s (%s)\n",LM_VERSION,LM_DATE); 
    5659#ifdef DEBUG 
    5760  if (piix4_initialized) { 
    58     printk("piix4.o: Oops, piix4_init called a second time!"); 
     61    printk("piix4.o: Oops, piix4_init called a second time!\n"); 
    5962    return -EBUSY; 
    6063  } 
     
    6265  piix4_initialized = 0; 
    6366  if ((res = piix4_setup())) { 
    64     printk("piix4.o: PIIX4 not detected, module not inserted"); 
     67    printk("piix4.o: PIIX4 not detected, module not inserted\n"); 
    6568    piix4_cleanup(); 
    6669    return res; 
     
    7275  piix4_adapter.smbus_access = &piix4_access; 
    7376  if ((res = smbus_add_adapter(&piix4_adapter))) { 
    74     printk("piix4.o: smbus_add_adapter failed, module not inserted"); 
     77    printk("piix4.o: smbus_add_adapter failed, module not inserted\n"); 
    7578    piix4_cleanup(); 
    7679    return res; 
    7780  } 
    7881  piix4_initialized++; 
    79   printk("piix4.o: PIIX4 bus detected and initialized"); 
     82  printk("piix4.o: PIIX4 bus detected and initialized\n"); 
    8083  return 0; 
    8184} 
  • lm-sensors/trunk/src/smbus.c

    r9 r11  
    2727#endif 
    2828 
     29#include "version.h" 
    2930#include "smbus.h" 
    3031 
     
    202203{ 
    203204  int res; 
     205  printk("smbus.o version %s (%s)\n",LM_VERSION,LM_DATE); 
    204206  if ((res = smbus_add_algorithm(&smbus_algorithm))) 
    205207    printk("Module smbus.o not inserted!\n"); 
    206208  else 
    207     printk("smbus.o initialized"); 
     209    printk("smbus.o initialized\n"); 
    208210  return res; 
    209211}