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
This commit is contained in:
Jean Delvare committed 2005-07-24 15:41:02 +00:00
1 parent 53df3c69b8
commit 7daaa8bcda
1 file changed
+10
+10
View File
@@ -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