# Copyright (C) 1997-2001 SpellCaster Telecommunications Inc. # $Id: common.kernel.mak.in,v 1.2 2004/07/14 19:23:13 bcrl Exp $ # Released under the GNU Public License. See LICENSE file for details. # # Declarations common to all our modules. SYSTEM:=$(shell uname -s) ifeq (Linux,$(SYSTEM)) # Kernel source directory (in general) KERNEL_DIR=/usr/src/linux # Module install directory SYSTEM_RELEASE=@kernel@ MODULE_DIR=/lib/modules/$(SYSTEM_RELEASE) MODULE_INCLUDE=$(MODULE_DIR)/build/include #MODVERSIONS=$(shell [ -f $(MODULE_INCLUDE) ] && echo -include $(MODULE_INCLUDE) -DMODVERSIONS) MODVERSIONS=$(shell ( if [ -d $(MODULE_INCLUDE) ] ; then echo "-include $(MODULE_INCLUDE)/linux/modversions.h -DMODVERSIONS" ; elif [ -L $(KERNEL_DIR)/include -o -d $(KERNEL_DIR)/include ] ; then echo "-include $(MODULE_INCLUDE)/linux/modversions.h -DMODVERSIONS" ; else echo "" ; fi )) # Include define for makefiles. Trys to guess where include files are located # that we need to build against. MODINCDIR looks (in kernel v2.4) like its # going to be the place, but who knows... INC=$(shell ( if [ -L $(MODULE_INCLUDE) -o -d $(MODULE_INCLUDE) ] ; then echo "-I$(MODULE_INCLUDE)" ; elif [ -L $(KERNEL_DIR)/include -o -d $(KERNEL_DIR)/include ] ; then echo "-I$(KERNEL_DIR)/include" ; else echo "-I/usr/include" ; fi )) endif