Changeset 88
- Timestamp:
- 12/18/98 17:31:56 (10 years ago)
- Files:
-
- lm-sensors/trunk/Makefile (modified) (8 diffs)
- lm-sensors/trunk/i2c/detect/Module.mk (modified) (2 diffs)
- lm-sensors/trunk/kernel/include/sensors.h (modified) (1 diff)
- lm-sensors/trunk/src/sensors.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/Makefile
r52 r88 16 16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 17 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. 18 23 19 24 # Uncomment the third line on SMP systems if the magic invocation fails. … … 46 51 #DEBUG := 1 47 52 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. 54 PREFIX := /usr/local 55 56 # This is the directory into which the modules will be installed. 50 57 MODDIR := /lib/modules/extra/misc 51 58 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. 61 LIBDIR := $(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. 68 BINDIR := $(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. 76 INCLUDEDIR := $(PREFIX)/include 77 SYSINCLUDEDIR := $(INCLUDEDIR)/linux 78 LIBINCLUDEDIR := $(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 58 83 59 84 # Below this, nothing should need to be changed. … … 71 96 72 97 # The subdirectories we need to build things in 73 MODULES := src98 SRCDIRS := src 74 99 ifeq ($(I2C),1) 75 MODULES += i2c i2c/detect i2c/drivers i2c/eeprom100 SRCDIRS += i2c i2c/detect i2c/drivers i2c/eeprom 76 101 endif 77 102 … … 82 107 83 108 # 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. 113 CFLAGS := -I. -Ii2c -O2 -D LM_SENSORS 88 114 89 115 ifeq ($(DEBUG),1) 90 116 CFLAGS += -DDEBUG 91 EXCFLAGS += -DDEBUG92 endif93 94 ifeq ($(SMP),1)95 CFLAGS += -D__SMP__96 117 endif 97 118 … … 99 120 CFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \ 100 121 -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 122 endif 123 124 MODCFLAGS := $(CFLAGS) -D__KERNEL__ -DMODULE -fomit-frame-pointer 125 PROGCFLAGS := $(CFLAGS) 126 ARCFLAGS := $(CFLAGS) 127 LIBCFLAGS := $(CFLAGS) -fpic 128 129 ifeq ($(SMP),1) 130 MODCFLAGS += -D__SMP__ 103 131 endif 104 132 105 133 ifeq ($(MODVER),1) 106 CFLAGS += -DMODVERSIONS -include /usr/include/linux/modversions.h134 MODCFLAGS += -DMODVERSIONS -include /usr/include/linux/modversions.h 107 135 endif 108 136 109 137 ifeq ($(I2C),1) 110 CFLAGS += -DI2C138 MODCFLAGS += -DI2C 111 139 endif 112 140 … … 118 146 # Include all makefiles for sub-modules 119 147 INCLUDEFILES := 120 include $(patsubst %,%/Module.mk,$( MODULES))148 include $(patsubst %,%/Module.mk,$(SRCDIRS)) 121 149 ifneq ($(MAKECMDGOALS),clean) 122 150 include $(INCLUDEFILES) … … 132 160 clean:: 133 161 $(RM) lm_sensors-* 134 135 # Create a dependency file. Tricky. We sed rule puts dir/file.d and dir/file.c136 # in front of the dependency file rule.137 %.d: %.c138 $(CC) -M -MG $(CFLAGS) $< | \139 sed -e 's@^\(.*\)\.o:@$*.d $*.o Makefile '`dirname $*.d`/Module.mk':@' > $@140 141 162 142 163 # This is tricky, but it works like a charm. It needs lots of utilities … … 161 182 echo '#define LM_VERSION "'`read VER; echo $$VER`\" >> version.h 162 183 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 163 202 # .ro files are used for programs (as opposed to modules) 164 203 %.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':@' > $@ 166 228 167 229 %: %.ro 168 230 $(CC) $(EXLDFLAGS) -o $@ $^ 169 231 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 27 27 28 28 # Include all dependency files 29 INCLUDEFILES += $(I2CDETECTSOURCES:.c=. d)29 INCLUDEFILES += $(I2CDETECTSOURCES:.c=.rd) 30 30 31 31 all-i2c-detect: $(I2CDETECTTARGETS) … … 35 35 36 36 clean-i2c-detect: 37 $(RM) $(I2CDETECTSOURCES:.c=. d) $(I2CDETECTSOURCES:.c=.o) \37 $(RM) $(I2CDETECTSOURCES:.c=.rd) $(I2CDETECTSOURCES:.c=.ro) \ 38 38 $(I2CDETECTTARGETS) 39 39 clean :: clean-i2c-detect 40 40 41 # The targets42 $(MODULE_DIR)/detect: $(MODULE_DIR)/detect.o43 44 45 # Oops, we need to use EXCFLAGS instead of CFLAGS... And we have to deal with46 # 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 176 176 #define GL518_SYSCTL_FAN2 1102 177 177 #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 180 179 #define GL518_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ 181 180 #define GL518_SYSCTL_ALARMS 2001 /* bitvector */ lm-sensors/trunk/src/sensors.h
r87 r88 176 176 #define GL518_SYSCTL_FAN2 1102 177 177 #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 180 179 #define GL518_SYSCTL_FAN_DIV 2000 /* 1, 2, 4 or 8 */ 181 180 #define GL518_SYSCTL_ALARMS 2001 /* bitvector */
