diff --git a/fcst/Kbuild b/fcst/Kbuild new file mode 100644 index 000000000..1954f60a5 --- /dev/null +++ b/fcst/Kbuild @@ -0,0 +1,10 @@ +KBUILD_EXTRA_SYMBOLS=$(src)/../scst/src/Module.symvers +ccflags-y += -I$(src)/../scst/include + +obj-$(CONFIG_FCST) += fcst.o + +fcst-objs := \ + ft_cmd.o \ + ft_io.o \ + ft_scst.o \ + ft_sess.o diff --git a/fcst/Makefile b/fcst/Makefile index ae40f0b92..ac6e640d4 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -32,11 +32,6 @@ export CONFIG_FCST := m MODULE_NAME = fcst -ifneq ($(KERNELRELEASE),) -include $(src)/Makefile_in-tree -else -######### BEGIN OUT-OF-TREE RULES ######### - ifndef PREFIX PREFIX=/usr/local endif @@ -79,13 +74,8 @@ uninstall: rm -f $(INSTALL_DIR)/$(MODULE_NAME).ko -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) -########## END OUT-OF-TREE RULES ########## -endif - clean: - rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend *~ \ - Module.symvers Module.markers modules.order - rm -rf .tmp_versions + $(MAKE) -C $(KDIR) M=$(shell pwd) $@ extraclean: clean rm -f *.orig *.rej diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index 6e992e603..6c488c141 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -99,8 +99,20 @@ else endif endif -# Use make instead of $(MAKE) to get rid of command-line option -i -run_conftest = $(shell if [ "0$(V)" -gt 0 ]; then output=/dev/stdout; else output=/dev/null; fi; if MAKEFLAGS= make -C $(KDIR) V=$(V) M="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" $(OFED_CONFIG) KBUILD_EXTRA_SYMBOLS="$(OFED_MODULE_SYMVERS)" 1>&2 2>$${output}; then echo "$(strip $2)"; else echo "$(strip $3)"; fi) +# Use make instead of $(MAKE) to get rid of command-line option -i. Enable +# -Wno-deprecated-declarations for the RHEL 7.x kernels. +run_conftest = $(shell \ + export KCFLAGS="-Wno-deprecated-declarations"; \ + if [ "0$(V)" -gt 0 ]; then \ + output=/dev/stdout; \ + else \ + output=conftest/$1/build-output-$(KVER).txt; \ + fi; \ + if MAKEFLAGS= make -C $(KDIR) V=$(V) M="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" $(OFED_CONFIG) KBUILD_EXTRA_SYMBOLS="$(OFED_MODULE_SYMVERS)" 1>&2 2>$${output}; then \ + echo "$(strip $2)"; \ + else \ + echo "$(strip $3)"; \ + fi) run_conftest_bool = $(call run_conftest,$1,-D$(strip $2)=1,-D$(strip $2)=0) CONFTESTS = $(shell ls -d conftest/*) @@ -164,18 +176,14 @@ uninstall: -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) clean: + rm -rf include/iscsi_scst_itf_ver.h + rm -rf conftest/*/{build-output,result}*.txt + for d in conftest/* kernel kernel/isert-scst; do \ + [ -d "$$d" ] && $(MAKE) -C $(KDIR) M=$(shell pwd)/$$d $@ & \ + rm -f $$d/result*.txt; \ + done; \ + wait $(MAKE) -C usr $@ - $(MAKE) -C $(KDIR) M=$(KMOD) $@ - $(MAKE) -C $(KDIR) M=$(ISERTMOD) $@ - rm -f kernel/Module.symvers \ - kernel/Module.markers kernel/modules.order \ - kernel/isert-scst/Module.symvers \ - kernel/isert-scst/Module.markers kernel/isert-scst/modules.order \ - include/iscsi_scst_itf_ver.h - rm -rf conftest/*/*.ko conftest/*/*.mod.c conftest/*/Module.symvers conftest/*/*.o \ - conftest/*/*.o.cmd conftest/*/*.ko.cmd conftest/*/.*.o.cmd conftest/*/.*.ko.cmd \ - conftest/*/*.order conftest/*/.*.o.d conftest/*/.tmp_versions/ \ - conftest/*/result*.txt extraclean: clean rm -f kernel/*.orig kernel/*.rej \ diff --git a/qla2x00t-32gbit/Kbuild b/qla2x00t-32gbit/Kbuild new file mode 100644 index 000000000..ec35194de --- /dev/null +++ b/qla2x00t-32gbit/Kbuild @@ -0,0 +1,14 @@ +ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter \ + -Wno-missing-field-initializers \ + -I$(src)/../scst/include -I$(src)/include \ + -DDEFAULT_SYMBOL_NAMESPACE=QLA32GB + +ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) +ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET) +endif + +obj-m := qla2xxx_scst.o +qla2xxx_scst-objs := \ + qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ + qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o qla_bsg.o \ + qla_nx.o qla_mr.o qla_nx2.o qla_target.o qla_tmpl.o qla_nvme.o diff --git a/qla2x00t-32gbit/Makefile b/qla2x00t-32gbit/Makefile index 3c529c611..2cc88c31f 100644 --- a/qla2x00t-32gbit/Makefile +++ b/qla2x00t-32gbit/Makefile @@ -44,23 +44,6 @@ endif INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra -ifneq ($(PATCHLEVEL),) -ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter \ - -Wno-missing-field-initializers \ - -I$(src)/../scst/include -I$(src)/include \ - -DDEFAULT_SYMBOL_NAMESPACE=QLA32GB - -ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) -ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET) -endif - -obj-m := qla2xxx_scst.o -qla2xxx_scst-objs := \ - qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ - qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o qla_bsg.o \ - qla_nx.o qla_mr.o qla_nx2.o qla_target.o qla_tmpl.o qla_nvme.o -else - all: $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(CONFIG_SCSI_QLA2XXX_TARGET)=CONFIG_SCSI_QLA2XXX_TARGET @@ -76,11 +59,9 @@ uninstall: -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) ########## END OUT-OF-TREE RULES ########## -endif clean: - @$(MAKE) -C $(KDIR) M=$(shell pwd) clean - @$(RM) tags Modules.symvers module.symvers Module.markers modules.order + $(MAKE) -C $(KDIR) M=$(shell pwd) $@ extraclean: clean rm -f *.orig *.rej diff --git a/qla2x00t-32gbit/qla2x00-target/Kbuild b/qla2x00t-32gbit/qla2x00-target/Kbuild new file mode 100644 index 000000000..eb3b6be8f --- /dev/null +++ b/qla2x00t-32gbit/qla2x00-target/Kbuild @@ -0,0 +1,13 @@ +KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \ + $(src)/../Module.symvers +ccflags-y += -I$(src)/../../scst/include -I$(src)/.. +ccflags-y += -Wextra -Wno-unused-parameter -Wno-missing-field-initializers +#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD +#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR + +ifneq ($(BUILD_2X_MODULE),) +ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=y +endif + +obj-m := qla2x00tgt.o +qla2x00tgt-objs := qla_tgt.o scst_qla2xxx.o diff --git a/qla2x00t-32gbit/qla2x00-target/Makefile b/qla2x00t-32gbit/qla2x00-target/Makefile index d45cfd5f2..94598660a 100644 --- a/qla2x00t-32gbit/qla2x00-target/Makefile +++ b/qla2x00t-32gbit/qla2x00-target/Makefile @@ -51,34 +51,11 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -ifeq ($(BUILD_2X_MODULE),) -QLA2XXX_INC_DIR := $(KDIR)/drivers/scsi/qla2xxx -else -QLA2XXX_INC_DIR := $(src)/.. +ifneq ($(BUILD_2X_MODULE),) QLA2XXX_DIR := $(shell pwd)/.. QLA2XXX_SCST := qla2xxx_scst endif -ifneq ($(PATCHLEVEL),) - -KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \ - $(src)/../Module.symvers -ccflags-y += -I$(src)/../../scst/include -ccflags-y += -W -Wno-unused-parameter -Wno-missing-field-initializers -#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD -#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR - -ifneq ($(BUILD_2X_MODULE),) -ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=y -endif - -ccflags-y += -I$(QLA2XXX_INC_DIR) - -obj-m := qla2x00tgt.o -qla2x00tgt-objs := qla_tgt.o scst_qla2xxx.o -else -######### BEGIN OUT-OF-TREE RULES ######### - ifndef PREFIX PREFIX=/usr/local endif @@ -112,13 +89,11 @@ qla2xxx_scst: M=$(QLA2XXX_DIR) -C $(QLA2XXX_DIR) all endif -########## END OUT-OF-TREE RULES ########## -endif - clean: - rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend *~ \ - Module.symvers Module.markers modules.order - rm -rf .tmp_versions +ifneq ($(BUILD_2X_MODULE),) + $(MAKE) -C $(QLA2XXX_DIR) $@ +endif + $(MAKE) -C $(KDIR) M=$(shell pwd) $@ extraclean: clean rm -f *.orig *.rej diff --git a/qla2x00t/Kbuild b/qla2x00t/Kbuild new file mode 100644 index 000000000..d18d16379 --- /dev/null +++ b/qla2x00t/Kbuild @@ -0,0 +1,11 @@ +ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter \ + -Wno-missing-field-initializers -I$(src)/../scst/include\ + -DDEFAULT_SYMBOL_NAMESPACE=QLA16GB + +ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) +ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET) +endif + +obj-m := qla2xxx_scst.o +qla2xxx_scst-objs := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ + qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o qla_bsg.o qla_nx.o diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index e51634e77..0dce532fa 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -43,20 +43,6 @@ endif INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra -ifneq ($(PATCHLEVEL),) -ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter \ - -Wno-missing-field-initializers -I$(src)/../scst/include\ - -DDEFAULT_SYMBOL_NAMESPACE=QLA16GB - -ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) -ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET) -endif - -obj-m := qla2xxx_scst.o -qla2xxx_scst-objs := qla_os.o qla_init.o qla_mbx.o qla_iocb.o qla_isr.o qla_gs.o \ - qla_dbg.o qla_sup.o qla_attr.o qla_mid.o qla_dfs.o qla_bsg.o qla_nx.o -else - all: $(MAKE) -C $(KDIR) M=$(shell pwd) \ $(CONFIG_SCSI_QLA2XXX_TARGET)=CONFIG_SCSI_QLA2XXX_TARGET @@ -72,11 +58,9 @@ uninstall: -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) ########## END OUT-OF-TREE RULES ########## -endif clean: - @$(MAKE) -C $(KDIR) M=$(shell pwd) clean - @$(RM) tags Modules.symvers module.symvers Module.markers modules.order + $(MAKE) -C $(KDIR) M=$(shell pwd) $@ extraclean: clean rm -f *.orig *.rej diff --git a/qla2x00t/qla2x00-target/Kbuild b/qla2x00t/qla2x00-target/Kbuild new file mode 100644 index 000000000..e00c73e73 --- /dev/null +++ b/qla2x00t/qla2x00-target/Kbuild @@ -0,0 +1,13 @@ +KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \ + $(src)/../Module.symvers +ccflags-y += -I$(src)/../../scst/include -I$(src)/.. +ccflags-y += -Wextra -Wno-unused-parameter -Wno-missing-field-initializers +#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD +#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR + +ifneq ($(BUILD_2X_MODULE),) +ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=y +endif + +obj-m := qla2x00tgt.o +qla2x00tgt-objs := qla2x00t.o diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index 644d89b94..d6f3f0888 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -50,34 +50,11 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -ifeq ($(BUILD_2X_MODULE),) -QLA2XXX_INC_DIR := $(KDIR)/drivers/scsi/qla2xxx -else -QLA2XXX_INC_DIR := $(src)/.. +ifneq ($(BUILD_2X_MODULE),) QLA2XXX_DIR := $(shell pwd)/.. QLA2XXX_SCST := qla2xxx_scst endif -ifneq ($(PATCHLEVEL),) - -KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \ - $(src)/../Module.symvers -ccflags-y += -I$(src)/../../scst/include -ccflags-y += -W -Wno-unused-parameter -Wno-missing-field-initializers -#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD -#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR - -ifneq ($(BUILD_2X_MODULE),) -ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=y -endif - -ccflags-y += -I$(QLA2XXX_INC_DIR) - -obj-m := qla2x00tgt.o -qla2x00tgt-objs := qla2x00t.o -else -######### BEGIN OUT-OF-TREE RULES ######### - ifndef PREFIX PREFIX=/usr/local endif @@ -111,13 +88,11 @@ qla2xxx_scst: M=$(QLA2XXX_DIR) -C $(QLA2XXX_DIR) all endif -########## END OUT-OF-TREE RULES ########## -endif - clean: - rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend *~ \ - Module.symvers Module.markers modules.order - rm -rf .tmp_versions +ifneq ($(BUILD_2X_MODULE),) + $(MAKE) -C $(QLA2XXX_DIR) $@ +endif + $(MAKE) -C $(KDIR) M=$(shell pwd) $@ extraclean: clean rm -f *.orig *.rej diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index 25e14b445..4a891db86 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -459,7 +459,7 @@ if [ "${include_fcst}" = true ]; then done fi - add_file "fcst/Makefile_in-tree" \ + add_file "fcst/Kbuild" \ "drivers/scst/fcst/Makefile" add_file "fcst/Kconfig" "drivers/scst/fcst/Kconfig" diff --git a/scst/Makefile b/scst/Makefile index 3c325f8c6..68b4d7378 100644 --- a/scst/Makefile +++ b/scst/Makefile @@ -42,6 +42,7 @@ uninstall: cd $(SCST_DIR) && $(MAKE) $@ clean: + rm -f include/build_mode.h cd $(SCST_DIR) && $(MAKE) $@ extraclean: diff --git a/scst/include/backport.h b/scst/include/backport.h index 8093f3c90..2a724ecef 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -805,10 +805,10 @@ enum umh_wait { /* */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35) /* - * See also commit 8488a38f4d2f ("kobject: Break the kobject namespace defs - * into their own header") # v2.6.36. + * See also commit 608b4b9548de ("netns: Teach network device kobjects which + * namespace they are in.") # v2.6.35. */ enum kobj_ns_type { KOBJ_NS_TYPE_NET = 1, diff --git a/scst/src/Kbuild b/scst/src/Kbuild new file mode 100644 index 000000000..5f58b7dfe --- /dev/null +++ b/scst/src/Kbuild @@ -0,0 +1,38 @@ +# See also Documentation/core-api/symbol-namespaces.rst for more information +# about DEFAULT_SYMBOL_NAMESPACE. +ccflags-y += -I$(src)/../include $(call cc-option,-Wextra) \ + -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare\ + -DDEFAULT_SYMBOL_NAMESPACE=SCST\ + $(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM) + +#ccflags-y += -DCONFIG_SCST_STRICT_SERIALIZING +#ccflags-y += -DCONFIG_SCST_USE_EXPECTED_VALUES +#ccflags-y += -DCONFIG_SCST_TEST_IO_IN_SIRQ +#ccflags-y += -DCONFIG_SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING +#ccflags-y += -DCONFIG_SCST_DEBUG_RETRY +#ccflags-y += -DCONFIG_SCST_DEBUG_OOM +#ccflags-y += -DCONFIG_SCST_DEBUG_SN +#ccflags-y += -DCONFIG_SCST_DEBUG_SYSFS_EAGAIN + +# If defined, makes SCST zero allocated data buffers. +# Undefining it considerably improves performance and eases CPU load, +# but could create a security hole (information leakage), so +# enable it if you have strict security requirements. +#ccflags-y += -DSCST_STRICT_SECURITY + +obj-m := scst.o + +scst-y += scst_copy_mgr.o +scst-y += scst_debug.o +scst-y += scst_dlm.o +scst-y += scst_event.o +scst-y += scst_lib.o +scst-y += scst_local_cmd.o +scst-y += scst_main.o +scst-y += scst_mem.o +scst-y += scst_no_dlm.o +scst-y += scst_pres.o +scst-y += scst_sysfs.o +scst-y += scst_targ.o +scst-y += scst_tg.o +obj-$(CONFIG_SCST) += scst.o dev_handlers/ diff --git a/scst/src/Makefile b/scst/src/Makefile index ffa701c31..240a6061d 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -35,51 +35,6 @@ SHELL=/bin/bash DEV_HANDLERS_DIR = dev_handlers -ifneq ($(PATCHLEVEL),) -# See also Documentation/core-api/symbol-namespaces.rst for more information -# about DEFAULT_SYMBOL_NAMESPACE. -ccflags-y += -I$(src)/../include $(call cc-option,-Wextra) \ - -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare\ - -DDEFAULT_SYMBOL_NAMESPACE=SCST\ - $(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM) - -#ccflags-y += -DCONFIG_SCST_STRICT_SERIALIZING -#ccflags-y += -DCONFIG_SCST_USE_EXPECTED_VALUES -#ccflags-y += -DCONFIG_SCST_TEST_IO_IN_SIRQ -#ccflags-y += -DCONFIG_SCST_ABORT_CONSIDER_FINISHED_TASKS_AS_NOT_EXISTING -#ccflags-y += -DCONFIG_SCST_DEBUG_RETRY -#ccflags-y += -DCONFIG_SCST_DEBUG_OOM -#ccflags-y += -DCONFIG_SCST_DEBUG_SN -#ccflags-y += -DCONFIG_SCST_DEBUG_SYSFS_EAGAIN - -# If defined, makes SCST zero allocated data buffers. -# Undefining it considerably improves performance and eases CPU load, -# but could create a security hole (information leakage), so -# enable it if you have strict security requirements. -#ccflags-y += -DSCST_STRICT_SECURITY - -obj-m := scst.o - -scst-y += scst_copy_mgr.o -scst-y += scst_debug.o -scst-y += scst_dlm.o -scst-y += scst_event.o -scst-y += scst_lib.o -scst-y += scst_local_cmd.o -scst-y += scst_main.o -scst-y += scst_mem.o -scst-y += scst_no_dlm.o -scst-y += scst_pres.o -scst-y += scst_sysfs.o -scst-y += scst_targ.o -scst-y += scst_tg.o -obj-$(CONFIG_SCST) += scst.o dev_handlers/ - -obj-$(BUILD_DEV) += $(DEV_HANDLERS_DIR)/ - -else -######### BEGIN OUT-OF-TREE RULES ######### - ifeq ($(KVER),) ifeq ($(KDIR),) KVER := $(shell uname -r) @@ -115,10 +70,11 @@ $(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCS all: $(SCST_INTF_VER_FILE) $(MAKE) -C certs KDIR=$(KDIR) - $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_DEV=m + $(MAKE) -C $(KDIR) M=$(shell pwd) + $(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers scst: - $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_DEV=n + $(MAKE) -C $(KDIR) M=$(shell pwd) install: all @if [ -z "$(DESTDIR)" ] && \ @@ -172,17 +128,13 @@ uninstall: -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) rm -rf $(INSTALL_DIR_H) -########## END OUT-OF-TREE RULES ########## -endif - INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst clean: - rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend Modules.symvers \ - Module.symvers Module.markers modules.order - rm -rf .tmp_versions - cd $(DEV_HANDLERS_DIR) && $(MAKE) $@ + rm -f $(SCST_INTF_VER_FILE) + $(MAKE) -C $(KDIR) M=$(shell pwd) $@ + $(MAKE) -C $(DEV_HANDLERS_DIR) $@ extraclean: clean rm -f $(SCST_INTF_VER_FILE) diff --git a/scst/src/dev_handlers/Kbuild b/scst/src/dev_handlers/Kbuild new file mode 100644 index 000000000..a7996af0e --- /dev/null +++ b/scst/src/dev_handlers/Kbuild @@ -0,0 +1,8 @@ +KBUILD_EXTRA_SYMBOLS=$(src)/../Module.symvers +ccflags-y += -I$(src)/../../include \ + $(call cc-option,-Wextra) \ + -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare +#ccflags-y += -DCONFIG_DEBUG_EXT_COPY_REMAP + +obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \ + scst_vdisk.o scst_raid.o scst_processor.o scst_user.o diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 157aaacd2..bddc1a87f 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -29,19 +29,6 @@ SHELL=/bin/bash -ifneq ($(PATCHLEVEL),) -KBUILD_EXTRA_SYMBOLS=$(src)/../../Module.symvers -ccflags-y += -I$(src)/../../include \ - $(call cc-option,-Wextra) \ - -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare -#ccflags-y += -DCONFIG_DEBUG_EXT_COPY_REMAP - -obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \ - scst_vdisk.o scst_raid.o scst_processor.o scst_user.o - -else -######### BEGIN OUT-OF-TREE RULES ######### - ifeq ($(KVER),) ifeq ($(KDIR),) KVER := $(shell uname -r) @@ -77,13 +64,8 @@ install: all uninstall: rm -f $(INSTALL_DIR)/dev_handlers/scst_*.ko -########## END OUT-OF-TREE RULES ########## -endif - clean: - rm -f *.o *.ko .*.cmd *.mod.c .*.d .depend Modules.symvers \ - Module.symvers Module.markers modules.order - rm -rf .tmp_versions + $(MAKE) -C $(KDIR) M=$(shell pwd) $@ extraclean: clean rm -f *.orig *.rej diff --git a/scst_local/Kbuild b/scst_local/Kbuild new file mode 100644 index 000000000..e96859041 --- /dev/null +++ b/scst_local/Kbuild @@ -0,0 +1,6 @@ +KBUILD_EXTRA_SYMBOLS=$(src)/../scst/src/Module.symvers +ccflags-y += -I$(src)/../scst/include +ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter\ + -Wno-missing-field-initializers + +obj-m := scst_local.o diff --git a/scst_local/Makefile b/scst_local/Makefile index 80a8056bc..5dba991dc 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -6,16 +6,6 @@ SHELL=/bin/bash KMOD := $(shell pwd)/kernel -ifneq ($(PATCHLEVEL),) -KBUILD_EXTRA_SYMBOLS=$(src)/../scst/src/Module.symvers -ccflags-y += -I$(src)/../scst/include -ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter\ - -Wno-missing-field-initializers - -obj-m := scst_local.o -else -######### BEGIN OUT-OF-TREE RULES ######### - ifndef PREFIX PREFIX=/usr/local endif @@ -54,12 +44,8 @@ uninstall: rm -f $(INSTALL_DIR)/scst_local.ko -/sbin/depmod -b $(INSTALL_MOD_PATH)/ -a $(KVER) -########## END OUT-OF-TREE RULES ########## -endif - clean: - @$(MAKE) -C $(KDIR) M=$(shell pwd) clean - @$(RM) tags Module.symvers Module.markers modules.order + $(MAKE) -C $(KDIR) M=$(shell pwd) $@ extraclean: clean rm -f *.orig *.rej diff --git a/srpt/Makefile b/srpt/Makefile index 67354b571..d96d6df9b 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -76,8 +76,20 @@ endif OFED_MODULE_SYMVERS:=$(OFED_KERNEL_DIR)/Module.symvers endif -# Use make instead of $(MAKE) to get rid of command-line option -i -run_conftest = $(shell if [ "0$(V)" -gt 0 ]; then output=/dev/stdout; else output=/dev/null; fi; if MAKEFLAGS= make -C $(KDIR) V=$(V) M="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" $(OFED_CONFIG) KBUILD_EXTRA_SYMBOLS="$(OFED_MODULE_SYMVERS)" 1>&2 2>$${output}; then echo "$(strip $2)"; else echo "$(strip $3)"; fi) +# Use make instead of $(MAKE) to get rid of command-line option -i. Enable +# -Wno-deprecated-declarations for the RHEL 7.x kernels. +run_conftest = $(shell \ + export KCFLAGS="-Wno-deprecated-declarations"; \ + if [ "0$(V)" -gt 0 ]; then \ + output=/dev/stdout; \ + else \ + output=conftest/$1/build-output-$(KVER).txt; \ + fi; \ + if MAKEFLAGS= make -C $(KDIR) V=$(V) M="$(shell pwd)/conftest/$1" PRE_CFLAGS="-Werror $(OFED_CFLAGS)" $(OFED_CONFIG) KBUILD_EXTRA_SYMBOLS="$(OFED_MODULE_SYMVERS)" 1>&2 2>$${output}; then \ + echo "$(strip $2)"; \ + else \ + echo "$(strip $3)"; \ + fi) run_conftest_bool = $(call run_conftest,$1,-D$(strip $2)=1,-D$(strip $2)=0) CONFTESTS = $(shell ls -d conftest/*) @@ -131,11 +143,12 @@ check: clean: rm -rf conftest/pre_cflags conftest/kcflags - for d in conftest/* src; do \ - [ -d "$$d" ] && $(MAKE) -C $(KDIR) M=$(shell pwd)/$$d clean; \ - rm -f $$d/result*.txt; \ - done - rm -f src/Module.symvers src/Module.markers src/modules.order + rm -rf conftest/*/{build-output,result}*.txt + for d in conftest/* src; do \ + [ -d "$$d" ] && $(MAKE) -C $(KDIR) M=$(shell pwd)/$$d $@ & \ + rm -f $$d/result*.txt; \ + done; \ + wait extraclean: clean rm -f *.orig *.rej diff --git a/usr/events/Makefile b/usr/events/Makefile index c5da707da..023b3a633 100644 --- a/usr/events/Makefile +++ b/usr/events/Makefile @@ -22,7 +22,7 @@ CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter -Wstrict-prototypes \ PROGS = events LIBS = -lpthread -CFLAGS += -W -Wno-unused-parameter +CFLAGS += -Wextra -Wno-unused-parameter CFLAGS += $(LOCAL_CFLAGS) #CFLAGS += -DDEBUG_NOMEM diff --git a/usr/fileio/Makefile b/usr/fileio/Makefile index b46372f91..a5135e372 100644 --- a/usr/fileio/Makefile +++ b/usr/fileio/Makefile @@ -38,7 +38,7 @@ CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter -Wstrict-prototypes \ PROGS = fileio_tgt LIBS = -lpthread -CFLAGS += -W -Wno-unused-parameter +CFLAGS += -Wextra -Wno-unused-parameter CFLAGS += $(LOCAL_CFLAGS) #CFLAGS += -DDEBUG_NOMEM #CFLAGS += -DDEBUG_SENSE diff --git a/usr/stpgd/Makefile b/usr/stpgd/Makefile index 9a67f312f..55dac703a 100644 --- a/usr/stpgd/Makefile +++ b/usr/stpgd/Makefile @@ -24,7 +24,7 @@ CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter -Wstrict-prototypes \ PROGS = stpgd LIBS = -lpthread -CFLAGS += -W -Wno-unused-parameter +CFLAGS += -Wextra -Wno-unused-parameter CFLAGS += $(LOCAL_CFLAGS) #CFLAGS += -DDEBUG_NOMEM