Files
scst/mpt/Makefile
Vladislav Bolkhovitin cc28ddcdf2 Apparently the SCST code with debugging and/or tracing enabled compiles fine as
an external module. When applying the SCST kernel patch to the mainstream 
kernel tree with debugging and/or tracing enabled however, the resulting code
triggers a compiler error. This is because the symbols DEBUG and TRACING
conflict with symbols with the same named defined in unrelated kernel headers.
The patch below resolves these conflicts by renaming the following preprocessor 
symbols:
- DEBUG into CONFIG_SCST_DEBUG.
- DEBUG_DIGEST_FAILURES into CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES.
- DEBUG_OOM into CONFIG_SCST_DEBUG_OOM.
- DEBUG_RETRY into CONFIG_SCST_DEBUG_RETRY.
- DEBUG_SN into CONFIG_SCST_DEBUG_SN.
- DEBUG_TM into CONFIG_SCST_DEBUG_TM.
- EXTRACHECKS into CONFIG_SCST_EXTRACHECKS.
- SCST_HIGHMEM into CONFIG_SCST_HIGHMEM.
- STRICT_SERIALIZING into CONFIG_SCST_STRICT_SERIALIZING.
- TM_DBG_GO_OFFLINE into CONFIG_SCST_TM_DBG_GO_OFFLINE. Mapped 0/1 values
  into macro undefined / macro defined.
- TRACING into CONFIG_SCST_TRACING.
- USE_EXPECTED_VALUES into CONFIG_SCST_USE_EXPECTED_VALUES.
- In qla_isp/linux/isp_scst.c, renamed DEBUG into DEBUG_ISP_SCST.
- In qla_isp/..., renamed SCSI_TARGET in SCST_SCSI_TARGET.
- In qla_isp/..., renamed SCSI_TARGET_DEV in SCST_SCSI_TARGET_DEV.
Additionally, all CONFIG_SCSI_TARGET* macro's are renamed into CONFIG_SCST* in
order to avoid confusion between the STGT CONFIG-symbols and the SCST CONFIG-
symbols.

The following additional options are now configurable through Kconfig:
- CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
- CONFIG_SCST_STRICT_SERIALIZING
- CONFIG_SCST_STRICT_SECURITY
- CONFIG_SCST_ALLOW_PASSTHROUGH_IO_SUBMIT_IN_SIRQ
- CONFIG_SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING
- CONFIG_SCST_USE_EXPECTED_VALUES
- CONFIG_SCST_DEBUG_OOM
- CONFIG_SCST_DEBUG_RETRY
- CONFIG_SCST_DEBUG_SN
- CONFIG_SCST_DEBUG_TM
- CONFIG_SCST_TM_DBG_GO_OFFLINE

The patch below has been verified as follows:
- Verified that the following command does not print any new warning messages:
  make -s clean && make -C srpt -s clean && make -s scst iscsi-scst && make -C srpt -s
- Verified as follows that the internal SCST patches still apply cleanly:
  for p in *patch; do patch -p0 --dry-run -f -s <$p; done
- Checked that the patch generated by generate-kernel-patch still applies
  cleanly to the 2.6.25.7 kernel, and that the patched kernel tree still
  compiles, installs and boots fine, that the iscsi-scst, ib_srpt,
  scst_disk and scst_vdisk modules still load, and that iSCSI communication
  still works fine. All SCST kernel configuration options that could be
  enabled have been enabled during this test.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@453 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-07-10 10:49:06 +00:00

93 lines
2.4 KiB
Makefile

# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# Main targets:
# all (the default) : make all
# clean : clean files
# extraclean : clean + clean dependencies
# install : install
# uninstall : uninstall
#
# Notes :
# - install and uninstall must be made as root
#
#SCST_INC_DIR := /usr/local/include/scst
#SCST_DIR := $(SCST_INC_DIR)
SCST_INC_DIR := $(SUBDIRS)/../scst/include
SCST_DIR := $(shell pwd)/../scst/src
FUSION_INC_DIR := drivers/message/fusion
EXTRA_CFLAGS += -I$(SCST_INC_DIR) -I$(FUSION_INC_DIR) -Iinclude/scsi
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
#EXTRA_CFLAGS += -DCONFIG_SCST_TRACING
EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG
#EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD
ifeq ($(KVER),)
ifeq ($(KDIR),)
KDIR := /lib/modules/$(shell uname -r)/build
endif
else
KDIR := /lib/modules/$(KVER)/build
endif
LSI_INC_DIR := $(KDIR)/drivers/message/fusion
EXTRA_CFLAGS += -I$(LSI_INC_DIR)
ifneq ($(KERNELRELEASE),)
obj-m += mpt_scst.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=n
install: all
$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_INI=m \
modules_install
-depmod -a
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)/mpt_scst.ko
-/sbin/depmod -a
endif
clean:
rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend *~ Modules.symvers \
Module.symvers Module.markers modules.order
rm -rf .tmp_versions
extraclean: clean
.PHONY: all tgt install uninstall clean extraclean