2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 06:15:15 +00:00

Makefile tweaks for the new kernel directory structure

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@179 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard
1999-01-28 14:45:20 +00:00
parent e05ff970ae
commit f31a1f45f2
5 changed files with 73 additions and 63 deletions

View File

@@ -39,7 +39,9 @@ MODVER := $(shell if cat /usr/include/linux/config.h /usr/include/linux/autoconf
# i2c modules. WARNING! If the i2c module version does not match the
# smbus/sensor module versions, you will get into severe problems.
# If you want to use a self-compiled version of the i2c modules, make
# sure <linux/i2c.h> contains the *correct* i2c header file!
# sure <linux/i2c.h> contains the *correct* i2c header file! The stock
# Linux 2.1.xxx and 2.2.x modules are *not* good enough; you really need
# Simon Vogl's version!
I2C := 1
#I2C := 0
@@ -102,7 +104,8 @@ LIBINCLUDEDIR := $(INCLUDEDIR)/sensors
# to do this.
# The subdirectories we need to build things in
SRCDIRS := kernel lib prog/sensors prog/dump etc
SRCDIRS := kernel kernel/busses kernel/chips kernel/include lib prog/sensors \
prog/dump etc
ifeq ($(I2C),1)
SRCDIRS += i2c i2c/detect i2c/drivers i2c/eeprom
endif

View File

@@ -20,37 +20,23 @@
# verbatim in the rules, until it is redefined.
MODULE_DIR := kernel
SRCDIRS := kernel/busses kernel/chips
# Regrettably, even 'simply expanded variables' will not put their currently
# defined value verbatim into the command-list of rules...
SRCTARGETS := $(MODULE_DIR)/smbus.o \
$(MODULE_DIR)/i2c-proc.o \
$(MODULE_DIR)/i2c-dev.o $(MODULE_DIR)/sensors.o
SRCHEADERFILES := $(MODULE_DIR)/include/sensors.h $(MODULE_DIR)/include/isa.h \
$(MODULE_DIR)/include/smbus.h $(MODULE_DIR)/include/i2c-dev.h
KERNELTARGETS := $(MODULE_DIR)/smbus.o \
$(MODULE_DIR)/i2c-proc.o \
$(MODULE_DIR)/i2c-dev.o $(MODULE_DIR)/sensors.o
# Include all dependency files
INCLUDEFILES += $(SRCTARGETS:.o=.d)
INCLUDEFILES += $(KERNELTARGETS:.o=.d)
all-src: $(SRCTARGETS)
all :: all-src
all-kernel: $(KERNELTARGETS)
all :: all-kernel
# Include all makefiles for sub-modules
INCLUDEFILES :=
include $(patsubst %,%/Module.mk,$(SRCDIRS))
ifneq ($(MAKECMDGOALS),clean)
include $(INCLUDEFILES)
endif
install-kernel: all-kernel
$(MKDIR) $(MODDIR)
$(INSTALL) -o root -g root -m 644 $(KERNELTARGETS) $(MODDIR)
install :: install-kernel
install-src: all-src
$(MKDIR) $(MODDIR) $(SYSINCLUDEDIR)
$(INSTALL) -o root -g root -m 644 $(SRCTARGETS) $(MODDIR)
$(INSTALL) -o root -g root -m 644 $(SRCHEADERFILES) $(SYSINCLUDEDIR)
install :: install-src
clean-src:
$(RM) $(SRCTARGETS) $(SRCTARGETS:.o=.d)
clean :: clean-src
clean-kernel:
$(RM) $(KERNELTARGETS) $(KERNELTARGETS:.o=.d)
clean :: clean-kernel

View File

@@ -22,23 +22,19 @@ MODULE_DIR := kernel/busses
# Regrettably, even 'simply expanded variables' will not put their currently
# defined value verbatim into the command-list of rules...
SRCTARGETS := $(MODULE_DIR)/i2c-piix4.o $(MODULE_DIR)/i2c-isa.o
SRCHEADERFILES := $(MODULE_DIR)/../include/sensors.h $(MODULE_DIR)/../include/isa.h \
$(MODULE_DIR)/../include/smbus.h $(MODULE_DIR)/../include/i2c-dev.h
KERNELBUSSESTARGETS := $(MODULE_DIR)/i2c-piix4.o $(MODULE_DIR)/i2c-isa.o
# Include all dependency files
INCLUDEFILES += $(SRCTARGETS:.o=.d)
INCLUDEFILES += $(KERNELBUSSESTARGETS:.o=.d)
all-src: $(SRCTARGETS)
all :: all-src
all-kernel-busses: $(KERNELBUSSESTARGETS)
all :: all-kernel-busses
install-src-busses: all-src
$(MKDIR) $(MODDIR) $(SYSINCLUDEDIR)
$(INSTALL) -o root -g root -m 644 $(SRCTARGETS) $(MODDIR)
$(INSTALL) -o root -g root -m 644 $(SRCHEADERFILES) $(SYSINCLUDEDIR)
install :: install-src-busses
install-kernel-busses: all-kernel-busses
$(MKDIR) $(MODDIR)
$(INSTALL) -o root -g root -m 644 $(KERNELBUSSESTARGETS) $(MODDIR)
install :: install-kernel-busses
clean-src-busses:
$(RM) $(SRCTARGETS) $(SRCTARGETS:.o=.d)
clean :: clean-src-busses
clean-kernel-busses:
$(RM) $(KERNELBUSSESTARGETS) $(KERNELBUSSESTARGETS:.o=.d)
clean :: clean-kernel-busses

View File

@@ -22,27 +22,23 @@ MODULE_DIR := kernel/chips
# Regrettably, even 'simply expanded variables' will not put their currently
# defined value verbatim into the command-list of rules...
SRCTARGETS := $(MODULE_DIR)/adm1021.o $(MODULE_DIR)/adm9240.o \
$(MODULE_DIR)/eeprom.o $(MODULE_DIR)/gl518sm.o \
$(MODULE_DIR)/lm75.o $(MODULE_DIR)/lm78.o \
$(MODULE_DIR)/lm80.o $(MODULE_DIR)/ltc1710.o \
$(MODULE_DIR)/w83781d.o
SRCHEADERFILES := $(MODULE_DIR)/../include/sensors.h $(MODULE_DIR)/../include/isa.h \
$(MODULE_DIR)/../include/smbus.h $(MODULE_DIR)/../include/i2c-dev.h
KERNELCHIPSTARGETS := $(MODULE_DIR)/adm1021.o $(MODULE_DIR)/adm9240.o \
$(MODULE_DIR)/eeprom.o $(MODULE_DIR)/gl518sm.o \
$(MODULE_DIR)/lm75.o $(MODULE_DIR)/lm78.o \
$(MODULE_DIR)/lm80.o $(MODULE_DIR)/ltc1710.o \
$(MODULE_DIR)/w83781d.o
# Include all dependency files
INCLUDEFILES += $(SRCTARGETS:.o=.d)
INCLUDEFILES += $(KERNELCHIPSTARGETS:.o=.d)
all-src: $(SRCTARGETS)
all :: all-src
all-kernel-chips: $(KERNELCHIPSTARGETS)
all :: all-kernel-chips
install-src-chips: all-src
$(MKDIR) $(MODDIR) $(SYSINCLUDEDIR)
$(INSTALL) -o root -g root -m 644 $(SRCTARGETS) $(MODDIR)
$(INSTALL) -o root -g root -m 644 $(SRCHEADERFILES) $(SYSINCLUDEDIR)
install :: install-src-chips
install-kernel-chips: all-kernel-chips
$(MKDIR) $(MODDIR)
$(INSTALL) -o root -g root -m 644 $(KERNELCHIPSTARGETS) $(MODDIR)
install :: install-kernel-chips
clean-src-chips:
$(RM) $(SRCTARGETS) $(SRCTARGETS:.o=.d)
clean :: clean-src-chips
clean-kernel-chips:
$(RM) $(KERNELCHIPSTARGETS) $(KERNELCHIPSTARGETS:.o=.d)
clean :: clean-kernel-chips

29
kernel/include/Module.mk Normal file
View File

@@ -0,0 +1,29 @@
# Module.mk - Makefile for a Linux module for reading sensor data.
# Copyright (c) 1998 Frodo Looijaard <frodol@dds.nl>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Note that MODULE_DIR (the directory in which this file resides) is a
# 'simply expanded variable'. That means that its value is substituted
# verbatim in the rules, until it is redefined.
MODULE_DIR := kernel/include
KERNELINCLUDEHEADERFILES := $(MODULE_DIR)/sensors.h $(MODULE_DIR)/isa.h \
$(MODULE_DIR)/smbus.h $(MODULE_DIR)/i2c-dev.h
install-all-kernel-include:
$(MKDIR) $(SYSINCLUDEDIR)
$(INSTALL) -o root -g root -m 644 $(SRCHEADERFILES) $(SYSINCLUDEDIR)
install :: install-all-kernel-include