Files
scst/srpt/Makefile
Yan Burman f704a4afee Merged revisions 5785-5786,5793-5796,5798,5801-5802,5804-5806,5808,5810-5811,5814,5816-5817 via svnmerge from
svn+ssh://yanb123@svn.code.sf.net/p/scst/svn/trunk

........
  r5785 | bvassche | 2014-09-09 14:09:20 +0300 (Tue, 09 Sep 2014) | 9 lines
  
  scst_local: Change max_lun into SCST_MAX_LUN (16383)
  
  Today SCST does not support LUN numbers >= 16384. Additionally,
  there is a bug in older Linux initiator systems that prevents
  proper handling of LUN numbers >= 2**32. See also Hannes Reinecke,
  scsi_scan: Fixup scsilun_to_int(), June 25, 2014 (commit ID
  d9e5d6183715e691b37afd3785c311d05cd1338d). Hence set max_lun to
  16383.
........
  r5786 | bvassche | 2014-09-09 14:27:27 +0300 (Tue, 09 Sep 2014) | 6 lines
  
  scst_local: Set max_id to 1
      
  The value 0 is not valid for the max_id member of struct Scsi_Host.
      
  Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
........
  r5793 | bvassche | 2014-09-10 14:42:54 +0300 (Wed, 10 Sep 2014) | 1 line
  
  scstadmin: Sync saved configuration files
........
  r5794 | bvassche | 2014-09-10 14:44:14 +0300 (Wed, 10 Sep 2014) | 2 lines
  
  scstadmin test 06-cont-on-err.t: Filter out scstadmin version number
........
  r5795 | bvassche | 2014-09-10 15:18:09 +0300 (Wed, 10 Sep 2014) | 1 line
  
  ib_srpt: Add max_sge_delta kernel module parameter
........
  r5796 | bvassche | 2014-09-10 15:20:30 +0300 (Wed, 10 Sep 2014) | 1 line
  
  ib_srpt: Update Subversion ignore lists
........
  r5798 | bvassche | 2014-09-12 14:16:35 +0300 (Fri, 12 Sep 2014) | 1 line
  
  fcst/Makefile: Add release-archive target
........
  r5801 | bvassche | 2014-09-12 14:20:16 +0300 (Fri, 12 Sep 2014) | 1 line
  
  fcst: Change version number from 0.3 into 3.1.0-pre
........
  r5802 | vlnb | 2014-09-13 04:13:29 +0300 (Sat, 13 Sep 2014) | 3 lines
  
  Fix autofinding SCST headers in fileio_tgt
........
  r5804 | vlnb | 2014-09-13 04:35:12 +0300 (Sat, 13 Sep 2014) | 3 lines
  
  Web updates
........
  r5805 | vlnb | 2014-09-13 04:37:12 +0300 (Sat, 13 Sep 2014) | 3 lines
  
  Update root README to use symlink instead of bind mount for QLogic git driver integration
........
  r5806 | bvassche | 2014-09-15 15:30:43 +0300 (Mon, 15 Sep 2014) | 1 line
  
  ib_srpt: Make "make -j<n> install" work for n >= 2 if "make all" has not been run first
........
  r5808 | bvassche | 2014-09-16 14:06:00 +0300 (Tue, 16 Sep 2014) | 6 lines
  
  scst/src/Makefile: Make "make install" without prior "make" work
      
  Avoid that MOD_VERS and MODS_VERS evaluate to an empty string.
      
  Reported-by: Yan Burman <yanb@mellanox.com>
........
  r5810 | bvassche | 2014-09-17 13:54:25 +0300 (Wed, 17 Sep 2014) | 1 line
  
  scst_vdisk: Insert a blank line
........
  r5811 | bvassche | 2014-09-17 13:56:40 +0300 (Wed, 17 Sep 2014) | 14 lines
  
  vdisk_blockio: Make large COMPARE AND WRITE requests work for stacked block devices
      
  Stacked block devices impose weird restrictions on S/G-lists. Hence
  make the COMPARE AND WRITE implementation independent of these
  restrictions.
      
  Additionally, reduce the MAXIMUM COMPARE AND WRITE LENGTH limit from
  0xff (no limit) to 0xfe to reduce the maximum amount of memory allocated
  during a COMPARE AND WRITE. Also serialize COMPARE AND WRITE
  operations, fix the offset reported for miscompares and fix the start
  offset of the region that is synchronized if the FUA bit has been set.
      
  Reported-by: Vishal Tripathi <vishal.tripathi@calsoftinc.com>
........
  r5814 | bvassche | 2014-09-18 10:08:49 +0300 (Thu, 18 Sep 2014) | 1 line
  
  nightly build: Update kernel versions
........
  r5816 | vlnb | 2014-09-20 09:31:43 +0300 (Sat, 20 Sep 2014) | 3 lines
  
  Web updates
........
  r5817 | bvassche | 2014-09-28 21:54:04 +0200 (Sun, 28 Sep 2014) | 1 line
  
  scripts/rebuild-rhel-kernel-rpm: Enable put_page_callback patch for RHEL 7
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5819 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-29 08:31:12 +00:00

167 lines
6.7 KiB
Makefile

#
# Makefile for ib_srpt.ko.
#
ifndef PREFIX
PREFIX=/usr/local
endif
SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \
then echo "$$PWD/../scst/include"; \
else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi)
SCST_SYMVERS_DIR := $(shell if [ -e $$PWD/../scst ]; then \
echo $$PWD/../scst/src; \
else echo $(DESTDIR)$(PREFIX)/include/scst; fi)
ifeq ($(KVER),)
ifeq ($(KDIR),)
KVER := $(shell uname -r)
KDIR := /lib/modules/$(KVER)/build
else
ifeq ($(KERNELRELEASE),)
KVER := $(strip $(shell \
cat $(KDIR)/include/config/kernel.release 2>/dev/null || \
make -s -C $(KDIR) kernelversion))
else
KVER := $(KERNELRELEASE)
endif
endif
else
KDIR := /lib/modules/$(KVER)/build
endif
ifeq ($(INSTALL_MOD_PATH),)
export INSTALL_MOD_PATH := $(DESTDIR)
endif
INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra
# Set variable $(2) to value $(3) in file $(1).
set_var = $(shell { if [ -e "$(1)" ]; then grep -v '^$(2)=' "$(1)"; fi; echo "$(2)=$(3)"; } >/tmp/$(1)-$$$$.tmp && mv /tmp/$(1)-$$$$.tmp $(1))
SRC_FILES=$(wildcard */*.[ch])
# The file Modules.symvers has been renamed in the 2.6.18 kernel to
# Module.symvers. Find out which name to use by looking in $(KDIR).
MODULE_SYMVERS:=$(shell if [ -e $(KDIR)/Module.symvers ]; then \
echo Module.symvers; else echo Modules.symvers; fi)
# Name of the OFED kernel RPM.
OFED_KERNEL_IB_RPM:=$(shell for r in mlnx-ofa_kernel compat-rdma kernel-ib; do rpm -q $$r 2>/dev/null | grep -q "^$$r" && echo $$r && break; done)
# Name of the OFED kernel development RPM.
OFED_KERNEL_IB_DEVEL_RPM:=$(shell for r in mlnx-ofa_kernel-devel compat-rdma-devel kernel-ib-devel; do rpm -q $$r 2>/dev/null | grep -q "^$$r" && echo $$r && break; done)
OFED_FLAVOR=$(shell /usr/bin/ofed_info 2>/dev/null | head -n1 | sed -n 's/^MLNX_OFED.*/MOFED/p;s/^OFED-.*/OFED/p')
ifneq ($(OFED_KERNEL_IB_RPM),)
ifeq ($(OFED_KERNEL_IB_RPM),compat-rdma)
# OFED 3.x
OFED_KERNEL_DIR:=/usr/src/compat-rdma
OFED_CFLAGS:=-I$(OFED_KERNEL_DIR)/include
else
ifeq ($(OFED_FLAVOR),MOFED)
# Mellanox OFED with or without kernel-ib RPM. Since several MOFED backport
# header files use the LINUX_BACKPORT() macro without including
# <linux/compat-2.6.h>, include that header file explicitly.
OFED_KERNEL_DIR:=/usr/src/ofa_kernel/default
OFED_CFLAGS:=-I$(OFED_KERNEL_DIR)/include -include linux/compat-2.6.h
else
# OFED 1.5
OFED_KERNEL_DIR:=/usr/src/ofa_kernel
include $(OFED_KERNEL_DIR)/config.mk
OFED_CFLAGS:=$(BACKPORT_INCLUDES) -I$(OFED_KERNEL_DIR)/include
endif
endif
# Any OFED version
OFED_MODULE_SYMVERS:=$(OFED_KERNEL_DIR)/$(MODULE_SYMVERS)
endif
HAVE_KCFLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/kcflags KCFLAGS=-DKCFLAGS_MACRO=1 >/dev/null 2>&1 && echo true || echo false)
HAVE_PRE_CFLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/pre_cflags PRE_CFLAGS=-DPRE_CFLAGS_MACRO=1 >/dev/null 2>&1 && echo true || echo false)
AUTOCONF_FLAGS = $(shell $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/conftest/gid_change PRE_CFLAGS="$(OFED_CFLAGS)" >/dev/null 2>&1 && echo -DHAVE_IB_EVENT_GID_CHANGE)
all: src/$(MODULE_SYMVERS)
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \
PRE_CFLAGS="$(OFED_CFLAGS) $(AUTOCONF_FLAGS)" \
KCFLAGS="$(AUTOCONF_FLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules
install: all
@[ -z "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && \
find /lib/modules/$(KVER) -name ib_srpt.ko -exec rm {} \; ; \
true
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src \
PRE_CFLAGS="$(OFED_CFLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) \
$$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \
modules_install
uninstall:
rm -f $(INSTALL_DIR)/ib_srpt.ko
-/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER)
src/$(MODULE_SYMVERS): $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) \
$(OFED_MODULE_SYMVERS)
@if [ "$(HAVE_KCFLAGS)" = false -a "$(HAVE_PRE_CFLAGS)" = false -a \
-n "$(AUTOCONF_FLAGS)" ]; then \
echo "Error: the kernel build system has not yet been patched.";\
false; \
fi
@if [ -n "$(OFED_KERNEL_IB_RPM)" ]; then \
if [ -z "$(OFED_KERNEL_IB_DEVEL_RPM)" ]; then \
echo "Error: the OFED package $(OFED_KERNEL_IB_RPM)-devel has" \
"not yet been installed."; \
false; \
elif [ "$(HAVE_PRE_CFLAGS)" = false ]; then \
echo "Error: the kernel build system has not yet been patched.";\
false; \
else \
echo " Building against $(OFED_FLAVOR) $(OFED_KERNEL_IB_RPM)" \
"InfiniBand kernel headers."; \
( \
cat $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) | \
grep -v 'drivers/infiniband/' | \
grep -v 'net/sunrpc/xprtrdma/' | \
grep -v 'net/rds/' | \
grep -v 'extra/ib_srpt'; \
cat $(OFED_MODULE_SYMVERS) \
) >$@; \
fi \
else \
if [ -n "$(OFED_KERNEL_IB_DEVEL_RPM)" ]; then \
echo "Error: the OFED kernel package has not yet been" \
"installed."; \
false; \
else \
echo " Building against in-tree InfiniBand kernel headers."; \
cp $< $@; \
fi; \
fi
clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd)/src clean
rm -f src/$(MODULE_SYMVERS) src/Module.markers src/modules.order
extraclean: clean
rm -f *.orig *.rej
2debug:
-$(MAKE) clean
$(call set_var,build_mode,BUILDMODE,)
2release:
-$(MAKE) clean
$(call set_var,build_mode,BUILDMODE,RELEASE)
2perf:
-$(MAKE) clean
$(call set_var,build_mode,BUILDMODE,PERF)
release-archive:
../scripts/generate-release-archive srpt "$$(sed -n 's/^#define[[:blank:]]DRV_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' src/ib_srpt.c)"
kerneldoc.html: $(SRC_FILES)
$(KDIR)/scripts/kernel-doc -html $(SRC_FILES) >$@
.PHONY: all install clean extraclean 2debug 2release 2perf