root/i2c/trunk/kernel/Module.mk @ 3426

Revision 3426, 3.3 KB (checked in by frodo, 13 years ago)

make install now works even if nothing has to be done, because

everything was compiled into your kernel.

  • 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
22KERNELDIR := $(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# We will only include those modules which are not already built into this
27# kernel.
28KERNELTARGETS :=
29KERNELINCLUDES :=
30ifneq ($(shell if grep -q '^CONFIG_I2C=y' $(LINUX)/.config; then echo 1; fi),1)
31KERNELTARGETS += $(MODULE_DIR)/i2c-core.o
32KERNELINCLUDES += $(MODULE_DIR)/i2c.h $(MODULE_DIR)/i2c-id.h
33endif
34ifneq ($(shell if grep -q '^CONFIG_I2C_CHARDEV=y' $(LINUX)/.config; then echo 1; fi),1)
35KERNELTARGETS += $(MODULE_DIR)/i2c-dev.o
36KERNELINCLUDES += $(MODULE_DIR)/i2c-dev.h
37endif
38ifneq ($(shell if grep -q '^CONFIG_I2C_ALGOBIT=y' $(LINUX)/.config; then echo 1; fi),1)
39KERNELTARGETS += $(MODULE_DIR)/i2c-algo-bit.o
40KERNELINCLUDES += $(MODULE_DIR)/i2c-algo-bit.h
41endif
42ifneq ($(shell if grep -q '^CONFIG_I2C_PHILIPSPAR=y' $(LINUX)/.config; then echo 1; fi),1)
43KERNELTARGETS += $(MODULE_DIR)/i2c-philips-par.o
44endif
45ifneq ($(shell if grep -q '^CONFIG_I2C_ELV=y' $(LINUX)/.config; then echo 1; fi),1)
46KERNELTARGETS += $(MODULE_DIR)/i2c-elv.o
47endif
48ifneq ($(shell if grep -q '^CONFIG_I2C_VELLEMAN=y' $(LINUX)/.config; then echo 1; fi),1)
49KERNELTARGETS += $(MODULE_DIR)/i2c-velleman.o
50endif
51ifneq ($(shell if grep -q '^CONFIG_I2C_ALGOPCF=y' $(LINUX)/.config; then echo 1; fi),1)
52KERNELTARGETS += $(MODULE_DIR)/i2c-algo-pcf.o
53KERNELINCLUDES += $(MODULE_DIR)/i2c-algo-pcf.h
54endif
55ifneq ($(shell if grep -q '^CONFIG_I2C_ELEKTOR=y' $(LINUX)/.config; then echo 1; fi),1)
56KERNELTARGETS += $(MODULE_DIR)/i2c-elektor.o
57KERNELINCLUDES += $(MODULE_DIR)/i2c-elektor.h $(MODULE_DIR)/i2c-pcf8584.h
58endif
59
60# Include all dependency files
61INCLUDEFILES += $(KERNELTARGETS:.o=.d)
62
63all-kernel: $(KERNELTARGETS)
64all :: all-kernel
65
66install-kernel: all-kernel
67        if [ -n "$(KERNELTARGETS)" ] ; then \
68          $(MKDIR) $(DESTDIR)$(MODDIR) ; \
69          $(INSTALL) -o root -g root -m 644 $(KERNELTARGETS) $(DESTDIR)$(MODDIR) ; \
70        fi
71        if [ -n "$(KERNELINCLUDES)" ] ; then \
72          $(MKDIR) $(DESTDIR)$(LINUX_INCLUDE_DIR) ; \
73        $(INSTALL) -o root -g root -m 644 $(KERNELINCLUDES) $(DESTDIR)$(LINUX_INCLUDE_DIR) ; \
74        fi
75install :: install-kernel
76
77clean-kernel:
78        $(RM) $(KERNELDIR)/*.o $(KERNELDIR)/*.d $(KERNELDIR)/.*.o.flags
79        $(RM) $(KERNELDIR)/*~
80clean :: clean-kernel
81
Note: See TracBrowser for help on using the browser.