| 1 | # Module.mk - Makefile for a Linux module for reading sensor data. |
|---|
| 2 | # Copyright (c) 1998 - 2001 Frodo Looijaard <frodol@dds.nl> |
|---|
| 3 | # |
|---|
| 4 | # This program is free software; you can redistribute it and/or modify |
|---|
| 5 | # it under the terms of the GNU General Public License as published by |
|---|
| 6 | # the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 | # (at your option) any later version. |
|---|
| 8 | # |
|---|
| 9 | # This program is distributed in the hope that it will be useful, |
|---|
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | # GNU General Public License for more details. |
|---|
| 13 | # |
|---|
| 14 | # You should have received a copy of the GNU General Public License |
|---|
| 15 | # along with this program; if not, write to the Free Software |
|---|
| 16 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 17 | |
|---|
| 18 | # Note that MODULE_DIR (the directory in which this file resides) is a |
|---|
| 19 | # 'simply expanded variable'. That means that its value is substituted |
|---|
| 20 | # verbatim in the rules, until it is redefined. |
|---|
| 21 | MODULE_DIR := kernel/chips |
|---|
| 22 | KERNELCHIPSDIR := $(MODULE_DIR) |
|---|
| 23 | |
|---|
| 24 | # Regrettably, even 'simply expanded variables' will not put their currently |
|---|
| 25 | # defined value verbatim into the command-list of rules... |
|---|
| 26 | # These targets are NOT included in 'mkpatch' ... |
|---|
| 27 | KERNELCHIPSTARGETS := |
|---|
| 28 | ifeq ($(shell if grep -q '^CONFIG_IPMI_HANDLER=' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 29 | KERNELCHIPSTARGETS += $(MODULE_DIR)/bmcsensors.o |
|---|
| 30 | endif |
|---|
| 31 | KERNELCHIPSTARGETS += $(MODULE_DIR)/ds1307.o |
|---|
| 32 | KERNELCHIPSTARGETS += $(MODULE_DIR)/lm83.o |
|---|
| 33 | KERNELCHIPSTARGETS += $(MODULE_DIR)/lm90.o |
|---|
| 34 | KERNELCHIPSTARGETS += $(MODULE_DIR)/max6650.o |
|---|
| 35 | KERNELCHIPSTARGETS += $(MODULE_DIR)/saa1064.o |
|---|
| 36 | KERNELCHIPSTARGETS += $(MODULE_DIR)/smartbatt.o |
|---|
| 37 | KERNELCHIPSTARGETS += $(MODULE_DIR)/smbus-arp.o |
|---|
| 38 | KERNELCHIPSTARGETS += $(MODULE_DIR)/vt8231.o |
|---|
| 39 | KERNELCHIPSTARGETS += $(MODULE_DIR)/w83627hf.o |
|---|
| 40 | KERNELCHIPSTARGETS += $(MODULE_DIR)/w83l785ts.o |
|---|
| 41 | KERNELCHIPSTARGETS += $(MODULE_DIR)/xeontemp.o |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | # These targets ARE included in 'mkpatch', except for LTC1710, which we |
|---|
| 45 | # leave here because it used to be in 'mkpatch' ... |
|---|
| 46 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_ADM1021=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 47 | KERNELCHIPSTARGETS += $(MODULE_DIR)/adm1021.o |
|---|
| 48 | endif |
|---|
| 49 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_ADM1024=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 50 | KERNELCHIPSTARGETS += $(MODULE_DIR)/adm1024.o |
|---|
| 51 | endif |
|---|
| 52 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_ADM1025=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 53 | KERNELCHIPSTARGETS += $(MODULE_DIR)/adm1025.o |
|---|
| 54 | endif |
|---|
| 55 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_ADM1026=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 56 | KERNELCHIPSTARGETS += $(MODULE_DIR)/adm1026.o |
|---|
| 57 | endif |
|---|
| 58 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_ADM9240=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 59 | KERNELCHIPSTARGETS += $(MODULE_DIR)/adm9240.o |
|---|
| 60 | endif |
|---|
| 61 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_ASB100=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 62 | KERNELCHIPSTARGETS += $(MODULE_DIR)/asb100.o |
|---|
| 63 | endif |
|---|
| 64 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_BT869=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 65 | KERNELCHIPSTARGETS += $(MODULE_DIR)/bt869.o |
|---|
| 66 | endif |
|---|
| 67 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_DDCMON=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 68 | KERNELCHIPSTARGETS += $(MODULE_DIR)/ddcmon.o |
|---|
| 69 | endif |
|---|
| 70 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_DS1621=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 71 | KERNELCHIPSTARGETS += $(MODULE_DIR)/ds1621.o |
|---|
| 72 | endif |
|---|
| 73 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_EEPROM=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 74 | KERNELCHIPSTARGETS += $(MODULE_DIR)/eeprom.o |
|---|
| 75 | endif |
|---|
| 76 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_FSCPOS=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 77 | KERNELCHIPSTARGETS += $(MODULE_DIR)/fscpos.o |
|---|
| 78 | endif |
|---|
| 79 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_FSCSCY=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 80 | KERNELCHIPSTARGETS += $(MODULE_DIR)/fscscy.o |
|---|
| 81 | endif |
|---|
| 82 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_FSCHER=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 83 | KERNELCHIPSTARGETS += $(MODULE_DIR)/fscher.o |
|---|
| 84 | endif |
|---|
| 85 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_GL518SM=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 86 | KERNELCHIPSTARGETS += $(MODULE_DIR)/gl518sm.o |
|---|
| 87 | endif |
|---|
| 88 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_GL520SM=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 89 | KERNELCHIPSTARGETS += $(MODULE_DIR)/gl520sm.o |
|---|
| 90 | endif |
|---|
| 91 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_IT87=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 92 | KERNELCHIPSTARGETS += $(MODULE_DIR)/it87.o |
|---|
| 93 | endif |
|---|
| 94 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_LM75=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 95 | KERNELCHIPSTARGETS += $(MODULE_DIR)/lm75.o |
|---|
| 96 | endif |
|---|
| 97 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_LM78=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 98 | KERNELCHIPSTARGETS += $(MODULE_DIR)/lm78.o |
|---|
| 99 | endif |
|---|
| 100 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_LM80=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 101 | KERNELCHIPSTARGETS += $(MODULE_DIR)/lm80.o |
|---|
| 102 | endif |
|---|
| 103 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_LM85=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 104 | KERNELCHIPSTARGETS += $(MODULE_DIR)/lm85.o |
|---|
| 105 | endif |
|---|
| 106 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_LM87=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 107 | KERNELCHIPSTARGETS += $(MODULE_DIR)/lm87.o |
|---|
| 108 | endif |
|---|
| 109 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_LM92=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 110 | KERNELCHIPSTARGETS += $(MODULE_DIR)/lm92.o |
|---|
| 111 | endif |
|---|
| 112 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_LTC1710=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 113 | KERNELCHIPSTARGETS += $(MODULE_DIR)/ltc1710.o |
|---|
| 114 | endif |
|---|
| 115 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_MATORB=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 116 | KERNELCHIPSTARGETS += $(MODULE_DIR)/matorb.o |
|---|
| 117 | endif |
|---|
| 118 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_MAXILIFE=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 119 | KERNELCHIPSTARGETS += $(MODULE_DIR)/maxilife.o |
|---|
| 120 | endif |
|---|
| 121 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_MTP008=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 122 | KERNELCHIPSTARGETS += $(MODULE_DIR)/mtp008.o |
|---|
| 123 | endif |
|---|
| 124 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_PCF8574=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 125 | KERNELCHIPSTARGETS += $(MODULE_DIR)/pcf8574.o |
|---|
| 126 | endif |
|---|
| 127 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_PCF8591=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 128 | KERNELCHIPSTARGETS += $(MODULE_DIR)/pcf8591.o |
|---|
| 129 | endif |
|---|
| 130 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_SIS5595=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 131 | KERNELCHIPSTARGETS += $(MODULE_DIR)/sis5595.o |
|---|
| 132 | endif |
|---|
| 133 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_SMSC47M1=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 134 | KERNELCHIPSTARGETS += $(MODULE_DIR)/smsc47m1.o |
|---|
| 135 | endif |
|---|
| 136 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_THMC50=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 137 | KERNELCHIPSTARGETS += $(MODULE_DIR)/thmc50.o |
|---|
| 138 | endif |
|---|
| 139 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_W83781D=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 140 | KERNELCHIPSTARGETS += $(MODULE_DIR)/w83781d.o |
|---|
| 141 | endif |
|---|
| 142 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_VIA686A=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 143 | KERNELCHIPSTARGETS += $(MODULE_DIR)/via686a.o |
|---|
| 144 | endif |
|---|
| 145 | ifneq ($(shell if grep -q '^CONFIG_SENSORS_VT1211=y' $(LINUX)/.config; then echo 1; fi),1) |
|---|
| 146 | KERNELCHIPSTARGETS += $(MODULE_DIR)/vt1211.o |
|---|
| 147 | endif |
|---|
| 148 | |
|---|
| 149 | # Include all dependency files |
|---|
| 150 | INCLUDEFILES += $(KERNELCHIPSTARGETS:.o=.d) |
|---|
| 151 | |
|---|
| 152 | all-kernel-chips: $(KERNELCHIPSTARGETS) |
|---|
| 153 | all :: all-kernel-chips |
|---|
| 154 | |
|---|
| 155 | # |
|---|
| 156 | # If $MODPREF/kernel exists, we presume the new (2.4.0) /lib/modules/x.y.z directory |
|---|
| 157 | # layout, so we install in kernel/drivers/i2c/chips/ and remove old versions in misc/ |
|---|
| 158 | # and kernel/drivers/sensors/ . Otherwise we install in misc/ as before. |
|---|
| 159 | # |
|---|
| 160 | install-kernel-chips: all-kernel-chips |
|---|
| 161 | if [ -n "$(KERNELCHIPSTARGETS)" ] ; then \ |
|---|
| 162 | $(MKDIR) $(DESTDIR)$(MODPREF)/kernel/drivers/i2c/chips ; \ |
|---|
| 163 | $(INSTALL) -m 644 $(KERNELCHIPSTARGETS) $(DESTDIR)$(MODPREF)/kernel/drivers/i2c/chips ; \ |
|---|
| 164 | for i in $(KERNELCHIPSTARGETS) ; do \ |
|---|
| 165 | $(RM) $(DESTDIR)$(MODPREF)/misc/`basename $$i` $(DESTDIR)$(MODPREF)/kernel/drivers/sensors/`basename $$i` \ |
|---|
| 166 | $(DESTDIR)$(MODPREF)/kernel/drivers/sensors/`basename $$i`.gz $(DESTDIR)$(MODPREF)/kernel/drivers/chips/`basename $$i`.gz ; \ |
|---|
| 167 | done ; \ |
|---|
| 168 | $(RMDIR) $(DESTDIR)$(MODPREF)/misc $(DESTDIR)$(MODPREF)/kernel/drivers/sensors 2> /dev/null || true ; \ |
|---|
| 169 | fi |
|---|
| 170 | |
|---|
| 171 | install :: install-kernel-chips |
|---|
| 172 | |
|---|
| 173 | clean-kernel-chips: |
|---|
| 174 | $(RM) $(KERNELCHIPSDIR)/*.o $(KERNELCHIPSDIR)/*.d |
|---|
| 175 | clean :: clean-kernel-chips |
|---|