From 7daaa8bcda1474822a1a4d84d2b97197694ee0a2 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 24 Jul 2005 15:41:02 +0000 Subject: [PATCH] Detect 2.6+ kernels and check targets. Original patch by Jim Cromie. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3045 7894878c-1315-0410-8ee3-d5d059ff63e0 --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index cc04186d..d3cba4d2 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,16 @@ CC := gcc # /lib/modules/2.4.29 MODPREF := /lib/modules/$(shell $(CC) -I$(LINUX_HEADERS) -E etc/config.c | grep uts_release |cut -f 2 -d'"') +# Prevent 2.6+ users from using improper targets, as this won't work. +ifeq (,$(findstring /2.4., $(MODPREF))) + ifeq (, $(MAKECMDGOALS)) + $(error For 2.6 kernels and later, use "make user") + endif + ifeq (install, $(MAKECMDGOALS)) + $(error For 2.6 kernels and later, use "make user_install") + endif +endif + # This is the directory where sensors.conf will be installed, if no other # configuration file is found ETCDIR := /etc