Files
scst/scst_local/Makefile
Vladislav Bolkhovitin 00b094c7fa Patch from Ruben Laban <r.laban@ism.nl>:
While writing DKMS support for the SCST and iSCST-SCST kernel modules, I ran 
into a (common) problem with regard to out-of-tree build detection. A common 
method to detect out-of-tree building is by using the KERNELRELEASE variable. 
The usage of this variable poses a problem when using DKMS. DKMS itself uses 
the KERNELRELEASE variable to specify the kernel for which the driver to 
build. A suggested alternative would to use the PATCHLEVEL variable as part 
of the detection mechanism instead. I attached a patch reflecting this 
suggested change.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@720 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-25 19:42:03 +00:00

72 lines
1.7 KiB
Makefile

#
# A Makefile for the scst-local ...
#
#SCST_INC_DIR := /usr/local/include/scst
#SCST_DIR := $(SCST_INC_DIR)
SCST_INC_DIR := $(SUBDIRS)/../scst/include/
SCST_DIR := $(shell pwd)/../scst/src
EXTRA_CFLAGS += -I$(SCST_INC_DIR) -I$(SCST_DIR)
EXTRA_CFLAGS += -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
#EXTRA_CFLAGS += -DCONFIG_SCST_LOCAL_FORCE_DIRECT_PROCESSING
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG
ifeq ($(KVER),)
ifeq ($(KDIR),)
KDIR := /lib/modules/$(shell uname -r)/build
endif
else
KDIR := /lib/modules/$(KVER)/build
endif
ifneq ($(PATCHLEVEL),)
obj-m := scst_local.o
else
all: Modules.symvers Module.symvers
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m
tgt: Modules.symvers Module.symvers
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m
install: all
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
modules_install
-/sbin/depmod -aq $(KVER)
SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Modules.symvers 2>/dev/null)
ifneq ($(SCST_MOD_VERS),)
Modules.symvers: $(SCST_DIR)/Modules.symvers
cp $(SCST_DIR)/Modules.symvers .
else
.PHONY: Modules.symvers
endif
# It's renamed in 2.6.18
SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Module.symvers 2>/dev/null)
ifneq ($(SCST_MOD_VERS),)
Module.symvers: $(SCST_DIR)/Module.symvers
cp $(SCST_DIR)/Module.symvers .
else
.PHONY: Module.symvers
endif
uninstall:
rm -f $(INSTALL_DIR)/scst_local.kp
-/sbin/depmod -a $(KVER)
endif
clean:
@$(MAKE) -C $(KDIR) M=$(PWD) clean
@$(RM) tags Modules.symvers module.symvers Module.markers modules.order
extraclean: clean
.PHONY: all tgt install uninstall clean extraclean