From 0a0860a7cd86cf665e4c5e542716727296681736 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Sun, 12 Sep 1999 00:25:00 +0000 Subject: [PATCH] Makefile now automatically detects whether kernel modules need to be made, or only the user-space utiltities. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@556 7894878c-1315-0410-8ee3-d5d059ff63e0 --- Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5b438aef..07d70e64 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,13 @@ LINUX=/usr/src/linux LINUX_HEADERS=$(LINUX)/include +# Determine whether we need to compile the kernel modules, or only the +# user-space utilities. +COMPILE_KERNEL := $(shell if test -d $(LINUX)/drivers/sensors ; \ + then echo 0; else echo 1; fi) +#COMPILE_KERNEL := 0 +#COMPILE_KERNEL := 1 + # If you have installed the i2c header at some other place (like # /usr/local/include/linux), set that directory here. Please check this out # if you get strange compilation errors; the default Linux i2c headers @@ -122,10 +129,12 @@ MANGRP := root # all, install and clean. Use double colons instead of single ones # to do this. - # The subdirectories we need to build things in -SRCDIRS := kernel kernel/busses kernel/chips kernel/include lib prog/sensors \ - prog/dump prog/detect etc +SRCDIRS := +ifeq ($(COMPILE_KERNEL),1) +SRCDIRS += kernel kernel/busses kernel/chips kernel/include +endif +SRCDIRS += lib prog/sensors prog/dump prog/detect etc # Some often-used commands with default options MKDIR := mkdir -p