Changeset 3383

Show
Ignore:
Timestamp:
09/23/99 01:12:39 (9 years ago)
Author:
frodo
Message:

Makefile changes for better behaviour with already patched kernels.

The Makefile now examine $(LINUX)/.config to see what modules need to be
compiled. It compiles only those modules which were either not configured
in at all, or were built as modules (ie. drivers which are built-in in the
kernel are not built, as they can not be overruled).

The above is still potentially dangerous, if we break the interface of
our modules. Still, it is much better than it was.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • i2c/trunk/INSTALL

    r3380 r3383  
    111111LINUX (both) default: /usr/src/linux 
    112112  The location of your kernel tree. 
    113 COMPILE_KERNEL (both) 
    114   This determines whether only the user-space utilities are needed (0)  
    115   or also the kernel modules (1). This is usually determined by checking 
    116   whether the kernel was already patched to include the kernel modules,  
    117   but that is not really foolprool. 
    118   At the moment of writing, there are no user-space utilities yet, so 
    119   setting this to 0 will make for a very fast compilation :-) 
     113COMPILE_KERNEL (both) default: 1 
     114  Determine whether you want to consider the kernel modules for compilation 
     115  at all. By default, compilation option 1 will only compile and install 
     116  those modules which are not built into the kernel; compilation option 2 
     117  will compile and install all of them.   
     118  If some modules are built into your kernel, and this package is much  
     119  newer, you may find you can not insert the newly compiled modules.  
     120  Sorry. 
     121  You may want to set this to 0 if you have just patched and compiled 
     122  your kernel using the same version of this package, and just want to 
     123  compile the user-space tools. 
    120124SMP (compilation option 1 only) 
    121125  This must be set to 1 for a SMP kernel. The magic invocation should 
  • i2c/trunk/Makefile

    r3375 r3383  
    3838 
    3939# Determine whether we need to compile the kernel modules, or only the 
    40 # user-space utilities. 
    41 COMPILE_KERNEL := $(shell if test -d $(LINUX)/drivers/i2c ; \ 
    42                           then echo 0; else echo 1; fi) 
     40# user-space utilities. By default, the kernel modules are compiled. 
    4341#COMPILE_KERNEL := 0 
    44 #COMPILE_KERNEL := 1 
     42COMPILE_KERNEL := 1 
     43 
    4544 
    4645# Uncomment the third line on SMP systems if the magic invocation fails. It 
  • i2c/trunk/kernel/Module.mk

    r3327 r3383  
    2323# Regrettably, even 'simply expanded variables' will not put their currently 
    2424# defined value verbatim into the command-list of rules... 
    25 KERNELTARGETS := $(MODULE_DIR)/i2c-core.o \ 
    26                  $(MODULE_DIR)/i2c-dev.o \ 
    27                  $(MODULE_DIR)/i2c-algo-bit.o \ 
    28                  $(MODULE_DIR)/i2c-algo-pcf.o \ 
    29                  $(MODULE_DIR)/i2c-elv.o \ 
    30                  $(MODULE_DIR)/i2c-philips-par.o \ 
    31                  $(MODULE_DIR)/i2c-velleman.o \ 
    32                  $(MODULE_DIR)/i2c-elektor.o  
     25# We will only include those modules which are not already built into this 
     26# kernel. 
     27KERNELTARGETS := 
     28KERNELINCLUDES := 
     29ifneq ($(shell if grep -q '^CONFIG_I2C=y' $(LINUX)/.config; then echo 1; fi),1) 
     30KERNELTARGETS += $(MODULE_DIR)/i2c-core.o 
     31KERNELINCLUDES += $(MODULE_DIR)/i2c.h 
     32endif 
     33ifneq ($(shell if grep -q '^CONFIG_I2C_CHARDEV=y' $(LINUX)/.config; then echo 1; fi),1) 
     34KERNELTARGETS += $(MODULE_DIR)/i2c-dev.o 
     35KERNELINCLUDES += $(MODULE_DIR)/i2c-dev.h 
     36endif 
     37ifneq ($(shell if grep -q '^CONFIG_I2C_ALGOBIT=y' $(LINUX)/.config; then echo 1; fi),1) 
     38KERNELTARGETS += $(MODULE_DIR)/i2c-algo-bit.o 
     39KERNELINCLUDES += $(MODULE_DIR)/i2c-algo-bit.h 
     40endif 
     41ifneq ($(shell if grep -q '^CONFIG_I2C_PHILIPSPAR=y' $(LINUX)/.config; then echo 1; fi),1) 
     42KERNELTARGETS += $(MODULE_DIR)/i2c-philips-par.o 
     43endif 
     44ifneq ($(shell if grep -q '^CONFIG_I2C_ELV=y' $(LINUX)/.config; then echo 1; fi),1) 
     45KERNELTARGETS += $(MODULE_DIR)/i2c-elv.o 
     46endif 
     47ifneq ($(shell if grep -q '^CONFIG_I2C_VELLEMAN=y' $(LINUX)/.config; then echo 1; fi),1) 
     48KERNELTARGETS += $(MODULE_DIR)/i2c-velleman.o 
     49endif 
     50ifneq ($(shell if grep -q '^CONFIG_I2C_ALGOPCF=y' $(LINUX)/.config; then echo 1; fi),1) 
     51KERNELTARGETS += $(MODULE_DIR)/i2c-algo-pcf.o 
     52KERNELINCLUDES += $(MODULE_DIR)/i2c-algo-pcf.h 
     53endif 
     54ifneq ($(shell if grep -q '^CONFIG_I2C_ELEKTOR=y' $(LINUX)/.config; then echo 1; fi),1) 
     55KERNELTARGETS += $(MODULE_DIR)/i2c-elektor.o 
     56KERNELINCLUDES += $(MODULE_DIR)/i2c-elektor.h $(MODULE_DIR)/i2c-pcf8584.h 
     57endif 
    3358 
    34 KERNELINCLUDES := $(MODULE_DIR)/i2c.h $(MODULE_DIR)/i2c-dev.h \ 
    35                   $(MODULE_DIR)/i2c-algo-bit.h $(MODULE_DIR)/i2c-algo-pcf.h \ 
    36                   $(MODULE_DIR)/i2c-elektor.h $(MODULE_DIR)/i2c-pcf8584.h 
    37             
    3859# Include all dependency files 
    3960INCLUDEFILES += $(KERNELTARGETS:.o=.d)