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

Revision 3385, 3.1 KB (checked in by frodo, 14 years ago)

Somewhat more thourough `make clean' implementation.

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