root/lm-sensors/trunk/kernel/busses/Module.mk @ 1425

Revision 1425, 4.4 KB (checked in by mds, 12 years ago)

fix 'make install' which I broke

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#  Module.mk - Makefile for a Linux module for reading sensor data.
2#  Copyright (c) 1998, 1999  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.
21MODULE_DIR := kernel/busses
22KERNELBUSSESDIR := $(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' ...
27KERNELBUSSESTARGETS :=
28
29
30# These targets ARE included in 'mkpatch' ...
31ifneq ($(shell if grep -q '^CONFIG_I2C_ALI1535=y' $(LINUX)/.config; then echo 1; fi),1)
32KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-ali1535.o
33endif
34ifneq ($(shell if grep -q '^CONFIG_I2C_ALI15X3=y' $(LINUX)/.config; then echo 1; fi),1)
35KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-ali15x3.o
36endif
37ifneq ($(shell if grep -q '^CONFIG_I2C_AMD756=y' $(LINUX)/.config; then echo 1; fi),1)
38KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-amd756.o
39endif
40ifneq ($(shell if grep -q '^CONFIG_I2C_HYDRA=y' $(LINUX)/.config; then echo 1; fi),1)
41KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-hydra.o
42endif
43ifneq ($(shell if grep -q '^CONFIG_I2C_I801=y' $(LINUX)/.config; then echo 1; fi),1)
44KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-i801.o
45endif
46ifneq ($(shell if grep -q '^CONFIG_I2C_I810=y' $(LINUX)/.config; then echo 1; fi),1)
47KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-i810.o
48endif
49ifneq ($(shell if grep -q '^CONFIG_I2C_ISA=y' $(LINUX)/.config; then echo 1; fi),1)
50KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-isa.o
51endif
52ifneq ($(shell if grep -q '^CONFIG_I2C_SIS5595=y' $(LINUX)/.config; then echo 1; fi),1)
53KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-sis5595.o
54endif
55ifneq ($(shell if grep -q '^CONFIG_I2C_PIIX4=y' $(LINUX)/.config; then echo 1; fi),1)
56KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-piix4.o
57endif
58ifneq ($(shell if grep -q '^CONFIG_I2C_SAVAGE4=y' $(LINUX)/.config; then echo 1; fi),1)
59KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-savage4.o
60endif
61# don't compile unless alpha because of kernel include-file dependencies
62ifeq ($(MACHINE),alpha)
63ifneq ($(shell if grep -q '^CONFIG_I2C_TSUNAMI=y' $(LINUX)/.config; then echo 1; fi),1)
64KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-tsunami.o
65endif
66endif
67ifneq ($(shell if grep -q '^CONFIG_I2C_VIA=y' $(LINUX)/.config; then echo 1; fi),1)
68KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-via.o
69endif
70ifneq ($(shell if grep -q '^CONFIG_I2C_VIAPRO=y' $(LINUX)/.config; then echo 1; fi),1)
71KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-viapro.o
72endif
73ifneq ($(shell if grep -q '^CONFIG_I2C_VOODOO3=y' $(LINUX)/.config; then echo 1; fi),1)
74KERNELBUSSESTARGETS += $(MODULE_DIR)/i2c-voodoo3.o
75endif
76
77# Include all dependency files
78INCLUDEFILES += $(KERNELBUSSESTARGETS:.o=.d)
79
80all-kernel-busses: $(KERNELBUSSESTARGETS)
81all :: all-kernel-busses
82
83#
84# If $MODPREF/kernel exists, we presume the new (2.4.0) /lib/modules/x.y.z directory
85# layout, so we install in kernel/drivers/i2c/ and remove old versions in misc/
86# Otherwise we install in misc/ as before.
87#
88install-kernel-busses: all-kernel-busses
89        if [ -n "$(KERNELBUSSESTARGETS)" ] ; then \
90          if [ -d "$(DESTDIR)$(MODPREF)/kernel" ] ; then \
91            $(MKDIR) $(DESTDIR)$(MODPREF)/kernel/drivers/i2c ; \
92            $(INSTALL) -o root -g root -m 644 $(KERNELBUSSESTARGETS) $(DESTDIR)$(MODPREF)/kernel/drivers/i2c ; \
93            for i in $(KERNELBUSSESTARGETS) ; do \
94              $(RM) $(DESTDIR)$(MODPREF)/misc/`basename $$i` ; \
95            done \
96          else \
97            $(MKDIR) $(DESTDIR)$(MODPREF)/misc ; \
98            $(INSTALL) -o root -g root -m 644 $(KERNELBUSSESTARGETS) $(DESTDIR)$(MODPREF)/misc ; \
99          fi \
100        fi
101
102install :: install-kernel-busses
103
104clean-kernel-busses:
105        $(RM) $(KERNELBUSSESDIR)/*.o $(KERNELBUSSESDIR)/*.d
106clean :: clean-kernel-busses
Note: See TracBrowser for help on using the browser.