mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-01 13:20:30 +00:00
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. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@11 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
d0f87b72e9
commit
ed7e4c3001
11 files changed
+36
-17
No files matched your search
@@ -40,6 +40,11 @@ I2C := 1
|
||||
WARN := 0
|
||||
#WARN := 1
|
||||
|
||||
# Uncomment the second line if you want to get (loads of) debug information.
|
||||
# Not recommended, unless you are actually debugging the code
|
||||
DEBUG := 0
|
||||
#DEBUG := 1
|
||||
|
||||
# This is the directory into which the modules will be installed, if you
|
||||
# call 'make install'
|
||||
MODDIR := /lib/modules/extra/misc
|
||||
@@ -106,10 +111,14 @@ endif
|
||||
all::
|
||||
|
||||
# Include all makefiles for sub-modules
|
||||
INCLUDEFILES :=
|
||||
include $(patsubst %,%/Module.mk,$(MODULES))
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
include $(INCLUDEFILES)
|
||||
endif
|
||||
|
||||
# Making the dependency files - done automatically!
|
||||
dep:
|
||||
dep :
|
||||
|
||||
all ::
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ I2CTARGETS := $(MODULE_DIR)/i2c-core.o $(MODULE_DIR)/algo-bit.o \
|
||||
$(MODULE_DIR)/bit-velle.o $(MODULE_DIR)/bit-mb.o
|
||||
|
||||
# Include all dependency files
|
||||
include $(I2CTARGETS:.o=.d)
|
||||
INCLUDEFILES += $(I2CTARGETS:.o=.d)
|
||||
|
||||
all :: $(I2CTARGETS)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ I2CDETECTTARGETS := $(MODULE_DIR)/detect
|
||||
I2CDETECTSOURCES := $(MODULE_DIR)/detect.c
|
||||
|
||||
# Include all dependency files
|
||||
include $(I2CDETECTSOURCES:.c=.d)
|
||||
INCLUDEFILES += $(I2CDETECTSOURCES:.c=.d)
|
||||
|
||||
all :: $(I2CDETECTTARGETS)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ MODULE_DIR := i2c/drivers
|
||||
I2CDRIVERTARGETS := $(MODULE_DIR)/eeprom.o
|
||||
|
||||
# Include all dependency files
|
||||
include $(I2CDRIVERTARGETS:.o=.d)
|
||||
INCLUDEFILES += $(I2CDRIVERTARGETS:.o=.d)
|
||||
|
||||
all :: $(I2CDRIVERTARGETS)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ I2CEEPROMTARGETS := $(MODULE_DIR)/eeprom
|
||||
I2CEEPROMSOURCES := $(MODULE_DIR)/eeprom.c
|
||||
|
||||
# Include all dependency files
|
||||
include $(I2CEEPROMSOURCES:.c=.d)
|
||||
INCLUDEFILES += $(I2CEEPROMSOURCES:.c=.d)
|
||||
|
||||
all :: $(I2CEEPROMTARGETS)
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ MODULE_DIR := src
|
||||
SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o
|
||||
|
||||
# Include all dependency files
|
||||
include $(SRCTARGETS:.o=.d)
|
||||
INCLUDEFILES += $(SRCTARGETS:.o=.d)
|
||||
|
||||
all :: $(SRCTARGETS)
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include "smbus.h"
|
||||
#include "version.h"
|
||||
|
||||
static int piix4_init(void);
|
||||
static int piix4_cleanup(void);
|
||||
@@ -39,6 +40,7 @@ static int piix4_initialized;
|
||||
Return -ENODEV if not found. */
|
||||
int piix4_setup(void)
|
||||
{
|
||||
return -ENODEV;
|
||||
/* TO BE WRITTEN! */
|
||||
}
|
||||
|
||||
@@ -53,15 +55,16 @@ s32 piix4_access(u8 addr, char read_write,
|
||||
int piix4_init(void)
|
||||
{
|
||||
int res;
|
||||
printk("piix4.o version %s (%s)\n",LM_VERSION,LM_DATE);
|
||||
#ifdef DEBUG
|
||||
if (piix4_initialized) {
|
||||
printk("piix4.o: Oops, piix4_init called a second time!");
|
||||
printk("piix4.o: Oops, piix4_init called a second time!\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
#endif
|
||||
piix4_initialized = 0;
|
||||
if ((res = piix4_setup())) {
|
||||
printk("piix4.o: PIIX4 not detected, module not inserted");
|
||||
printk("piix4.o: PIIX4 not detected, module not inserted\n");
|
||||
piix4_cleanup();
|
||||
return res;
|
||||
}
|
||||
@@ -71,12 +74,12 @@ int piix4_init(void)
|
||||
piix4_adapter.algo = &smbus_algorithm;
|
||||
piix4_adapter.smbus_access = &piix4_access;
|
||||
if ((res = smbus_add_adapter(&piix4_adapter))) {
|
||||
printk("piix4.o: smbus_add_adapter failed, module not inserted");
|
||||
printk("piix4.o: smbus_add_adapter failed, module not inserted\n");
|
||||
piix4_cleanup();
|
||||
return res;
|
||||
}
|
||||
piix4_initialized++;
|
||||
printk("piix4.o: PIIX4 bus detected and initialized");
|
||||
printk("piix4.o: PIIX4 bus detected and initialized\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -26,6 +26,7 @@
|
||||
#include <asm/semaphore.h>
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "smbus.h"
|
||||
|
||||
static s32 smbus_access_i2c (struct smbus_adapter * adapter, u8 addr,
|
||||
@@ -201,10 +202,11 @@ int smbus_detach_client(struct smbus_client *client)
|
||||
int smbus_init(void)
|
||||
{
|
||||
int res;
|
||||
printk("smbus.o version %s (%s)\n",LM_VERSION,LM_DATE);
|
||||
if ((res = smbus_add_algorithm(&smbus_algorithm)))
|
||||
printk("Module smbus.o not inserted!\n");
|
||||
else
|
||||
printk("smbus.o initialized");
|
||||
printk("smbus.o initialized\n");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ MODULE_DIR := src
|
||||
SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o
|
||||
|
||||
# Include all dependency files
|
||||
include $(SRCTARGETS:.o=.d)
|
||||
INCLUDEFILES += $(SRCTARGETS:.o=.d)
|
||||
|
||||
all :: $(SRCTARGETS)
|
||||
|
||||
|
||||
+7
-4
@@ -20,6 +20,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include "smbus.h"
|
||||
#include "version.h"
|
||||
|
||||
static int piix4_init(void);
|
||||
static int piix4_cleanup(void);
|
||||
@@ -39,6 +40,7 @@ static int piix4_initialized;
|
||||
Return -ENODEV if not found. */
|
||||
int piix4_setup(void)
|
||||
{
|
||||
return -ENODEV;
|
||||
/* TO BE WRITTEN! */
|
||||
}
|
||||
|
||||
@@ -53,15 +55,16 @@ s32 piix4_access(u8 addr, char read_write,
|
||||
int piix4_init(void)
|
||||
{
|
||||
int res;
|
||||
printk("piix4.o version %s (%s)\n",LM_VERSION,LM_DATE);
|
||||
#ifdef DEBUG
|
||||
if (piix4_initialized) {
|
||||
printk("piix4.o: Oops, piix4_init called a second time!");
|
||||
printk("piix4.o: Oops, piix4_init called a second time!\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
#endif
|
||||
piix4_initialized = 0;
|
||||
if ((res = piix4_setup())) {
|
||||
printk("piix4.o: PIIX4 not detected, module not inserted");
|
||||
printk("piix4.o: PIIX4 not detected, module not inserted\n");
|
||||
piix4_cleanup();
|
||||
return res;
|
||||
}
|
||||
@@ -71,12 +74,12 @@ int piix4_init(void)
|
||||
piix4_adapter.algo = &smbus_algorithm;
|
||||
piix4_adapter.smbus_access = &piix4_access;
|
||||
if ((res = smbus_add_adapter(&piix4_adapter))) {
|
||||
printk("piix4.o: smbus_add_adapter failed, module not inserted");
|
||||
printk("piix4.o: smbus_add_adapter failed, module not inserted\n");
|
||||
piix4_cleanup();
|
||||
return res;
|
||||
}
|
||||
piix4_initialized++;
|
||||
printk("piix4.o: PIIX4 bus detected and initialized");
|
||||
printk("piix4.o: PIIX4 bus detected and initialized\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -26,6 +26,7 @@
|
||||
#include <asm/semaphore.h>
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "smbus.h"
|
||||
|
||||
static s32 smbus_access_i2c (struct smbus_adapter * adapter, u8 addr,
|
||||
@@ -201,10 +202,11 @@ int smbus_detach_client(struct smbus_client *client)
|
||||
int smbus_init(void)
|
||||
{
|
||||
int res;
|
||||
printk("smbus.o version %s (%s)\n",LM_VERSION,LM_DATE);
|
||||
if ((res = smbus_add_algorithm(&smbus_algorithm)))
|
||||
printk("Module smbus.o not inserted!\n");
|
||||
else
|
||||
printk("smbus.o initialized");
|
||||
printk("smbus.o initialized\n");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user