From b69787ba59f2dc6e9454f81c6d789d7989abf96b Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 25 Aug 2010 18:45:28 +0000 Subject: [PATCH] Patch from Bryan Mesich that sets KVER if KDIR is defined. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1993 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- Makefile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 464ad3984..1a681f9fe 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,22 @@ SHELL = /bin/bash -# Decide to use which kernel src. If not specified, is current running kernel. +# Define the location to the kernel src. Can be defined here or on +# the command line during the build process. If KDIR is defined, +# we will set an appropriate value for KVER by running "make +# kernelversion" in the kernel source tree. KVER can still be +# overrode by the user via the command line or by defining it in +# this Makefile. If KDIR and KVER are not defined by the user, +# the current running kernel version is used to define KVER. + #export KDIR=/usr/src/linux-2.6 +#export KVER=2.6.x + +ifdef KDIR + ifndef KVER + export KVER = $(strip $(shell make -s -C $(KDIR) kernelversion)) + endif +endif SCST_DIR=scst SCSTADM_DIR=scstadmin