Changeset 88

Show
Ignore:
Timestamp:
12/18/98 17:31:56 (14 years ago)
Author:
frodo
Message:

Makefile updates

Several, mostly internal, things changed. Most notably, the install
directories are extended (we'll need this to install the new library).
Also, explicit rules for creating .c and .o files are added.

Location:
lm-sensors/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/Makefile

    r52 r88  
    1616#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
    1717 
     18# Everything you may want to change is in the top of this file. Usually, you 
     19# can just use the defaults, fortunately. 
     20 
     21# You need a full complement of GNU utilities to run this Makefile succesfully; 
     22# most notably, you need bash, GNU make, flex and bison. 
    1823 
    1924# Uncomment the third line on SMP systems if the magic invocation fails. 
     
    4651#DEBUG := 1 
    4752 
    48 # This is the directory into which the modules will be installed, if you 
    49 # call 'make install' 
     53# This is the prefix that will be used for almost all directories below. 
     54PREFIX := /usr/local 
     55 
     56# This is the directory into which the modules will be installed. 
    5057MODDIR := /lib/modules/extra/misc 
    5158 
    52 # This is the directory into which the include files will be installed, 
    53 # if you call 'make install'. If you install it in the directory below, 
    54 # #include <linux/smbus.h>, for example, should work, regardless of the 
    55 # current linux kernel. 
    56 INCLUDEDIR := /usr/local/include/linux 
    57  
     59# You should not need to change this. It is the directory into which the 
     60# library files (both static and shared) will be installed. 
     61LIBDIR := $(PREFIX)/lib 
     62 
     63# You should not need to change this. It is the directory into which the 
     64# executable program files will be installed. 
     65# Note that not all programs in this package are really installed; 
     66# some are just examples. You can always install them by hand, of 
     67# course. 
     68BINDIR := $(PREFIX)/bin 
     69 
     70# You should not need to change this. It is the basic directory into which 
     71# include files will be installed. The actual directory will be  
     72# $(INCLUDEDIR)/linux for system include files, and $(INCLUDEDIR)/sensors 
     73# for library include files. If PREFIX equals the default /usr/local/bin, 
     74# you will be able to use '#include <linux/sensors.h>' regardless of the 
     75# current kernel selected. 
     76INCLUDEDIR := $(PREFIX)/include 
     77SYSINCLUDEDIR := $(INCLUDEDIR)/linux 
     78LIBINCLUDEDIR := $(INCLUDEDIR)/sensors 
     79 
     80# If your /bin/sh is not bash, change the below definition so that make can 
     81# find bash. 
     82# SHELL=/usr/bin/bash 
    5883 
    5984# Below this, nothing should need to be changed. 
     
    7196 
    7297# The subdirectories we need to build things in  
    73 MODULES := src 
     98SRCDIRS := src 
    7499ifeq ($(I2C),1) 
    75 MODULES += i2c i2c/detect i2c/drivers i2c/eeprom 
     100SRCDIRS += i2c i2c/detect i2c/drivers i2c/eeprom 
    76101endif 
    77102 
     
    82107 
    83108# Determine the default compiler flags 
    84 # CFLAGS is to create in-kernel object files (modules); EXCFLAGS is to create 
    85 # non-kernel object files (which are linked into executables). 
    86 CFLAGS := -D__KERNEL__ -DMODULE -I. -Ii2c -O2 -fomit-frame-pointer -DLM_SENSORS 
    87 EXCFLAGS := -I. -Ii2c -O2 -D LM_SENSORS 
     109# MODCFLAGS is to create in-kernel object files (modules); PROGFLAGS is to 
     110# create non-kernel object files (which are linked into executables). 
     111# ARCFLAGS are used to create archive object files (static libraries), and 
     112# LIBCFLAGS are for shared library objects. 
     113CFLAGS := -I. -Ii2c -O2 -D LM_SENSORS 
    88114 
    89115ifeq ($(DEBUG),1) 
    90116CFLAGS += -DDEBUG 
    91 EXCFLAGS += -DDEBUG 
    92 endif 
    93  
    94 ifeq ($(SMP),1) 
    95 CFLAGS += -D__SMP__ 
    96117endif 
    97118 
     
    99120CFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \ 
    100121          -Wcast-align -Wwrite-strings -Wnested-externs -Winline 
    101 EXCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \ 
    102             -Wcast-align -Wwrite-strings -Wnested-externs -Winline 
     122endif 
     123 
     124MODCFLAGS := $(CFLAGS) -D__KERNEL__ -DMODULE -fomit-frame-pointer 
     125PROGCFLAGS := $(CFLAGS) 
     126ARCFLAGS := $(CFLAGS) 
     127LIBCFLAGS := $(CFLAGS) -fpic 
     128 
     129ifeq ($(SMP),1) 
     130MODCFLAGS += -D__SMP__ 
    103131endif 
    104132 
    105133ifeq ($(MODVER),1) 
    106 CFLAGS += -DMODVERSIONS -include /usr/include/linux/modversions.h 
     134MODCFLAGS += -DMODVERSIONS -include /usr/include/linux/modversions.h 
    107135endif 
    108136 
    109137ifeq ($(I2C),1) 
    110 CFLAGS += -DI2C 
     138MODCFLAGS += -DI2C 
    111139endif 
    112140 
     
    118146# Include all makefiles for sub-modules 
    119147INCLUDEFILES :=  
    120 include $(patsubst %,%/Module.mk,$(MODULES)) 
     148include $(patsubst %,%/Module.mk,$(SRCDIRS)) 
    121149ifneq ($(MAKECMDGOALS),clean) 
    122150include $(INCLUDEFILES) 
     
    132160clean:: 
    133161        $(RM) lm_sensors-* 
    134  
    135 # Create a dependency file. Tricky. We sed rule puts dir/file.d and dir/file.c 
    136 # in front of the dependency file rule. 
    137 %.d: %.c 
    138         $(CC) -M -MG $(CFLAGS) $< | \ 
    139         sed -e 's@^\(.*\)\.o:@$*.d $*.o Makefile '`dirname $*.d`/Module.mk':@' > $@ 
    140  
    141162 
    142163# This is tricky, but it works like a charm. It needs lots of utilities 
     
    161182        echo '#define LM_VERSION "'`read VER; echo $$VER`\" >> version.h 
    162183 
     184 
     185# Here, we define all implicit rules we want to use. 
     186 
     187.SUFFIXES: 
     188 
     189# We need to create dependency files. Tricky. We sed rule puts dir/file.d and 
     190# dir/file.c # in front of the dependency file rule. 
     191 
     192# .o files are used for modules 
     193%.o: %.c 
     194        $(CC) $(MODCFLAGS) -c $< -o $@ 
     195 
     196%.d: %.c 
     197        $(CC) -M -MG $(MODCFLAGS) $< | \ 
     198        sed -e 's@^\(.*\)\.o:@$*.d $*.o Makefile '`dirname $*.d`/Module.mk':@' > $@ 
     199 
     200 
     201 
    163202# .ro files are used for programs (as opposed to modules) 
    164203%.ro: %.c 
    165         $(CC) $(EXCFLAGS) -c $< -o $@ 
     204        $(CC) $(PROGCFLAGS) -c $< -o $@ 
     205 
     206%.rd: %.c 
     207        $(CC) -M -MG $(PROGCFLAGS) $< | \ 
     208        sed -e 's@^\(.*\)\.o:@$*.rd $*.ro Makefile '`dirname $*.rd`/Module.mk':@' > $@ 
     209 
     210 
     211 
     212# .ao files are used for static archives 
     213%.ao: %.c 
     214        $(CC) $(ARCFLAGS) -c $< -o $@ 
     215 
     216%.ad: %.c 
     217        $(CC) -M -MG $(ARCFLAGS) $< | \ 
     218        sed -e 's@^\(.*\)\.o:@$*.ad $*.ao Makefile '`dirname $*.ad`/Module.mk':@' > $@ 
     219 
     220 
     221# .lo files are used for shared libraries 
     222%.lo: %.c 
     223        $(CC) $(LIBCFLAGS) -c $< -o $@ 
     224 
     225%.ld: %.c 
     226        $(CC) -M -MG $(LIBCFLAGS) $< | \ 
     227        sed -e 's@^\(.*\)\.o:@$*.ld $*.lo Makefile '`dirname $*.ld`/Module.mk':@' > $@ 
    166228 
    167229%: %.ro 
    168230        $(CC) $(EXLDFLAGS) -o $@ $^ 
    169231 
    170 %.rd: %.c 
    171         $(CC) -M -MG $(CFLAGS) $< | \ 
    172         sed -e 's@^\(.*\)\.o:@$*.rd $*.ro Makefile '`dirname $*.rd`/Module.mk':@' > $@ 
    173  
     232 
     233# Flex and Bison 
     234%c: %y 
     235        $(BISON) -d $< -o $@ 
     236 
     237%.c: %.l 
     238        $(FLEX) -t $< > $@ 
  • lm-sensors/trunk/i2c/detect/Module.mk

    r19 r88  
    2727 
    2828# Include all dependency files 
    29 INCLUDEFILES += $(I2CDETECTSOURCES:.c=.d) 
     29INCLUDEFILES += $(I2CDETECTSOURCES:.c=.rd) 
    3030 
    3131all-i2c-detect: $(I2CDETECTTARGETS) 
     
    3535 
    3636clean-i2c-detect: 
    37         $(RM) $(I2CDETECTSOURCES:.c=.d) $(I2CDETECTSOURCES:.c=.o) \ 
     37        $(RM) $(I2CDETECTSOURCES:.c=.rd) $(I2CDETECTSOURCES:.c=.ro) \ 
    3838              $(I2CDETECTTARGETS) 
    3939clean :: clean-i2c-detect 
    4040 
    41 # The targets 
    42 $(MODULE_DIR)/detect: $(MODULE_DIR)/detect.o 
    43  
    44  
    45 # Oops, we need to use EXCFLAGS instead of CFLAGS... And we have to deal with 
    46 # an executable. Ugly code approaching... :-) 
    47  
    48 $(I2CDETECTSOURCES:.c=.o): 
    49         $(CC) $(EXCFLAGS) -c $(@:.o=.c) -o $@ 
    50  
    51 $(I2CDETECTSOURCES:.c=.d): 
    52         $(CC) -M -MG $(EXCFLAGS) $(@:.d=.c) | \ 
    53         sed -e \ 
    54         's@^\(.*\)\.o:@$@ $(@:.d=.o) Makefile '`dirname $@`/Module.mk':@' > $@ 
    55  
  • lm-sensors/trunk/kernel/include/sensors.h

    r87 r88  
    176176#define GL518_SYSCTL_FAN2 1102 
    177177#define GL518_SYSCTL_TEMP 1200     /* Degrees Celcius * 10 */ 
    178 #define GL518_SYSCTL_TEMP2 1201     /* Degrees Celcius * 10 */ 
    179 #define GL518_SYSCTL_TEMP3 1202     /* Degrees Celcius * 10 */ 
     178#define GL518_SYSCTL_VID 1300     
    180179#define GL518_SYSCTL_FAN_DIV 2000  /* 1, 2, 4 or 8 */ 
    181180#define GL518_SYSCTL_ALARMS 2001   /* bitvector */ 
  • lm-sensors/trunk/src/sensors.h

    r87 r88  
    176176#define GL518_SYSCTL_FAN2 1102 
    177177#define GL518_SYSCTL_TEMP 1200     /* Degrees Celcius * 10 */ 
    178 #define GL518_SYSCTL_TEMP2 1201     /* Degrees Celcius * 10 */ 
    179 #define GL518_SYSCTL_TEMP3 1202     /* Degrees Celcius * 10 */ 
     178#define GL518_SYSCTL_VID 1300     
    180179#define GL518_SYSCTL_FAN_DIV 2000  /* 1, 2, 4 or 8 */ 
    181180#define GL518_SYSCTL_ALARMS 2001   /* bitvector */