From dc7e039124fbaf6e2e0b693790cf765d4c388de8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 25 Mar 2019 22:10:21 +0000 Subject: [PATCH] Makefiles: Remove most instances of $(SCST_INC_DIR) Move the $(SCST_INC_DIR) definitions from the out-of-tree sections into the in-kernel sections. Since SCST is now distributed as a single tar archive, only support in-tree builds with $(SCST_INC_DIR) and $(SCST_DIR). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8079 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/Makefile | 14 ++++---------- fcst/Makefile_in-tree | 3 ++- iscsi-scst/Makefile | 25 ++++++------------------- iscsi-scst/kernel/Makefile | 2 +- iscsi-scst/kernel/isert-scst/Makefile | 2 +- iscsi-scst/usr/Makefile | 2 +- qla2x00t/Makefile | 7 +------ qla2x00t/qla2x00-target/Makefile | 17 +++++------------ scst/src/Makefile | 4 +--- scst/src/dev_handlers/Makefile | 4 +--- scst_local/Makefile | 14 ++++---------- srpt/Makefile | 19 +++---------------- srpt/src/Makefile | 2 +- 13 files changed, 31 insertions(+), 84 deletions(-) diff --git a/fcst/Makefile b/fcst/Makefile index 9ef92d635..e6ae0ecb3 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -60,24 +60,18 @@ endif INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra -SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \ - then echo "$$PWD/../scst/include"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) -SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; then echo "$$PWD/../scst/src"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) +SCST_DIR := $(shell echo "$$PWD")/../scst all: Modules.symvers Module.symvers - $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ - SCST_INC_DIR=$(SCST_INC_DIR) + $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m tgt: Modules.symvers Module.symvers - $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=n \ - SCST_INC_DIR=$(SCST_INC_DIR) + $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=n install: all $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ $$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \ - SCST_INC_DIR=$(SCST_INC_DIR) modules_install + modules_install ins: ./config diff --git a/fcst/Makefile_in-tree b/fcst/Makefile_in-tree index 8f9ad3366..c7028e58f 100644 --- a/fcst/Makefile_in-tree +++ b/fcst/Makefile_in-tree @@ -7,7 +7,8 @@ BUILD_MODE_CFLAGS_ = -DDEBUG_WORK_IN_THREAD -DCONFIG_SCST_TRACING \ -fno-inline -fno-inline-functions BUILD_MODE_CFLAGS_RELEASE = -DCONFIG_SCST_TRACING BUILD_MODE_CFLAGS_PERF = -ccflags-y += -I$(SCST_INC_DIR) $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) +ccflags-y += -I$(KBUILD_EXTMOD)/../scst/include +ccflags-y += $(BUILD_MODE_CFLAGS_$(BUILD_MODE)) obj-$(CONFIG_FCST) += fcst.o diff --git a/iscsi-scst/Makefile b/iscsi-scst/Makefile index fecf4d9b1..a457ece07 100644 --- a/iscsi-scst/Makefile +++ b/iscsi-scst/Makefile @@ -11,18 +11,7 @@ endif SHELL=/bin/bash -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) +SCST_SYMVERS_DIR := $(shell echo "$$PWD")/../scst SBINDIR := $(PREFIX)/sbin INITDIR := /etc/init.d RCDIR := /etc/rc.d @@ -129,18 +118,16 @@ ISER_CFLAGS = $(OFED_CFLAGS) -DOFED_FLAVOR=$(OFED_FLAVOR) $(PRE_CFLAGS) mods: include/iscsi_scst_itf_ver.h Modules.symvers Module.symvers \ $(CONFTEST_OUTPUTS) - $(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) M=$(KMOD) \ - PRE_CFLAGS="$(PRE_CFLAGS)" modules + $(MAKE) -C $(KDIR) M=$(KMOD) PRE_CFLAGS="$(PRE_CFLAGS)" modules echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)" if $(INFINIBAND_ENABLED); then \ echo " Building against $(OFED_FLAVOR) InfiniBand kernel headers."; \ - $(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) M=$(ISERTMOD) \ - PRE_CFLAGS="$(ISER_CFLAGS)" \ + $(MAKE) -C $(KDIR) M=$(ISERTMOD) PRE_CFLAGS="$(ISER_CFLAGS)" \ KBUILD_EXTRA_SYMBOLS=$(ISER_SYMVERS) modules; \ fi progs: include/iscsi_scst_itf_ver.h - $(MAKE) -C usr SCST_INC_DIR=$(SCST_INC_DIR) + $(MAKE) -C usr include/iscsi_scst_itf_ver.h: include/iscsi_scst.h echo "/* Autogenerated, don't edit */" >include/iscsi_scst_itf_ver.h @@ -155,12 +142,12 @@ install: all @install -vD -m 644 doc/manpages/iscsi-scstd.8 $(DESTDIR)$(MANDIR)/man8/iscsi-scstd.8 @install -vD -m 755 usr/iscsi-scst-adm $(DESTDIR)$(SBINDIR)/iscsi-scst-adm @install -vD -m 644 doc/manpages/iscsi-scst-adm.8 $(DESTDIR)$(MANDIR)/man8/iscsi-scst-adm.8 - $(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) M=$(KMOD) \ + $(MAKE) -C $(KDIR) M=$(KMOD) \ $$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \ modules_install echo "$@: INFINIBAND_ENABLED = $(INFINIBAND_ENABLED)" if $(INFINIBAND_ENABLED); then \ - $(MAKE) -C $(KDIR) SCST_INC_DIR=$(SCST_INC_DIR) M=$(ISERTMOD) \ + $(MAKE) -C $(KDIR) M=$(ISERTMOD) \ $$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \ modules_install; \ fi diff --git a/iscsi-scst/kernel/Makefile b/iscsi-scst/kernel/Makefile index 70ae0ca8d..6090e9dfe 100644 --- a/iscsi-scst/kernel/Makefile +++ b/iscsi-scst/kernel/Makefile @@ -20,7 +20,7 @@ # # Note 2! The CFLAGS definitions are now in the main makefile. -ccflags-y += -I$(src)/../include -I$(SCST_INC_DIR) +ccflags-y += -I$(src)/../include -I$(src)/../../scst/include ccflags-y += $(call cc-option,-Wextra) \ $(call cc-option,-Wno-old-style-declaration) \ -Wno-unused-parameter -Wno-missing-field-initializers diff --git a/iscsi-scst/kernel/isert-scst/Makefile b/iscsi-scst/kernel/isert-scst/Makefile index a4adc5438..5ac04aaaa 100644 --- a/iscsi-scst/kernel/isert-scst/Makefile +++ b/iscsi-scst/kernel/isert-scst/Makefile @@ -21,7 +21,7 @@ # Note 2! The CFLAGS definitions are now in the main makefile. LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) -ccflags-y += -I$(src)/../../include -I$(SCST_INC_DIR) +ccflags-y += -I$(src)/../../include -I$(KBUILD_EXTMOD)/../../../scst/include ccflags-y += $(call cc-option,-Wextra) \ $(call cc-option,-Wno-old-style-declaration) \ -Wno-unused-parameter -Wno-missing-field-initializers diff --git a/iscsi-scst/usr/Makefile b/iscsi-scst/usr/Makefile index d03ef4799..c94a9d409 100644 --- a/iscsi-scst/usr/Makefile +++ b/iscsi-scst/usr/Makefile @@ -33,7 +33,7 @@ CFLAGS += -O2 -Wall -Wextra -Wstrict-prototypes -Wno-sign-compare \ -Wimplicit-function-declaration -Wno-unused-parameter \ -Wno-missing-field-initializers \ $(call cc-option,-Wno-format-truncation) \ - -g -I../include -I$(SCST_INC_DIR) + -g -I../include -I../../scst/include CFLAGS += -D_GNU_SOURCE # required for glibc >= 2.8 CFLAGS += $(LOCAL_CFLAGS) diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index aafa94f53..1e318cf49 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -22,10 +22,6 @@ SHELL=/bin/bash KMOD := $(shell pwd)/kernel -SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \ - then echo "$$PWD/../scst/include"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) - ifeq ($(KVER),) ifeq ($(KDIR),) KVER := $(shell uname -r) @@ -47,7 +43,7 @@ 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$(SCST_INC_DIR) + -Wno-missing-field-initializers -I$(src)/../scst/include ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET) @@ -60,7 +56,6 @@ else all: $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ - SCST_INC_DIR=$(SCST_INC_DIR) \ $(CONFIG_SCSI_QLA2XXX_TARGET)=CONFIG_SCSI_QLA2XXX_TARGET install: all diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index 84b900dbd..b0537d5a1 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -59,7 +59,7 @@ QLA2XXX_SCST := qla2xxx_scst endif ifneq ($(PATCHLEVEL),) -ccflags-y += -I$(SCST_INC_DIR) +ccflags-y += -I$(KBUILD_EXTMOD)/../../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 @@ -91,12 +91,7 @@ endif INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra -SCST_INC_DIR := $(shell if [ -e "$$PWD/../../scst" ]; \ - then echo "$$PWD/../../scst/include"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) -SCST_DIR := $(shell if [ -e "$$PWD/../../scst" ]; \ - then echo "$$PWD/../../scst/src"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) +SCST_DIR := $(shell echo "$$PWD")/../../scst ifneq ($(BUILD_2X_MODULE),) # We need to make qla2xxx_scst before Module.symvers @@ -104,17 +99,15 @@ ifneq ($(BUILD_2X_MODULE),) endif all: $(QLA2XXX_SCST) Modules.symvers Module.symvers - $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ - SCST_INC_DIR=$(SCST_INC_DIR) + $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m install: all ifneq ($(BUILD_2X_MODULE),) - $(MAKE) M=$(QLA2XXX_DIR) -C $(QLA2XXX_DIR) $@ \ - SCST_INC_DIR=$(SCST_INC_DIR) + $(MAKE) M=$(QLA2XXX_DIR) -C $(QLA2XXX_DIR) $@ endif $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ $$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \ - SCST_INC_DIR=$(SCST_INC_DIR) modules_install + modules_install uninstall: ifneq ($(BUILD_2X_MODULE),) diff --git a/scst/src/Makefile b/scst/src/Makefile index 04b7a43fd..b84bad3e8 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -36,9 +36,7 @@ SHELL=/bin/bash DEV_HANDLERS_DIR = dev_handlers ifneq ($(PATCHLEVEL),) -SCST_INC_DIR := $(KBUILD_EXTMOD)/../include - -ccflags-y += -I$(SCST_INC_DIR) $(call cc-option,-Wextra) \ +ccflags-y += -I$(KBUILD_EXTMOD)/../include $(call cc-option,-Wextra) \ -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare\ $(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM) diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 20855a3b3..afe961295 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -30,9 +30,7 @@ SHELL=/bin/bash ifneq ($(PATCHLEVEL),) -SCST_INC_DIR := $(KBUILD_EXTMOD)/../include - -ccflags-y += -I$(SCST_INC_DIR) \ +ccflags-y += -I$(KBUILD_EXTMOD)/../include \ $(call cc-option,-Wextra) \ -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare #ccflags-y += -DCONFIG_DEBUG_EXT_COPY_REMAP diff --git a/scst_local/Makefile b/scst_local/Makefile index a58f35f3f..93abadb8f 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -7,7 +7,7 @@ SHELL=/bin/bash KMOD := $(shell pwd)/kernel ifneq ($(PATCHLEVEL),) -ccflags-y += -I$(SCST_INC_DIR) +ccflags-y += -I$(KBUILD_EXTMOD)/../scst/include ccflags-y += $(call cc-option,-Wextra) -Wno-unused-parameter\ -Wno-missing-field-initializers @@ -50,21 +50,15 @@ endif INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra -SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \ - then echo "$$PWD/../scst/include"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) -SCST_DIR := $(shell if [ -e "$$PWD/../scst" ]; \ - then echo "$$PWD/../scst/src"; \ - else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) +SCST_DIR := $(shell echo "$$PWD")/../scst all: Modules.symvers Module.symvers - $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ - SCST_INC_DIR=$(SCST_INC_DIR) + $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m install: all $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ $$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \ - SCST_INC_DIR=$(SCST_INC_DIR) modules_install + modules_install SCST_MOD_VERS := $(shell ls $(SCST_DIR)/Modules.symvers 2>/dev/null) ifneq ($(SCST_MOD_VERS),) diff --git a/srpt/Makefile b/srpt/Makefile index e76306d5f..703a63bd6 100644 --- a/srpt/Makefile +++ b/srpt/Makefile @@ -6,18 +6,7 @@ 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) +SCST_SYMVERS_DIR := $(shell echo "$$PWD")/../scst/src ifeq ($(KVER),) ifeq ($(KDIR),) @@ -106,8 +95,7 @@ PRE_CFLAGS = $(OFED_CFLAGS) \ done) all: check src/$(MODULE_SYMVERS) $(CONFTEST_OUTPUTS) - $(MAKE) -C $(KDIR) M=$(shell pwd)/src \ - PRE_CFLAGS="$(PRE_CFLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) modules + $(MAKE) -C $(KDIR) M=$(shell pwd)/src PRE_CFLAGS="$(PRE_CFLAGS)" modules src/$(MODULE_SYMVERS): $(SCST_SYMVERS_DIR)/$(MODULE_SYMVERS) \ $(OFED_MODULE_SYMVERS) @@ -118,8 +106,7 @@ install: all @[ -z "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && \ find /lib/modules/$(KVER) -name ib_srpt.ko -exec rm {} \; ; \ true - $(MAKE) -C $(KDIR) M=$(shell pwd)/src \ - PRE_CFLAGS="$(PRE_CFLAGS)" SCST_INC_DIR=$(SCST_INC_DIR) \ + $(MAKE) -C $(KDIR) M=$(shell pwd)/src PRE_CFLAGS="$(PRE_CFLAGS)" \ $$([ -n "$(DESTDIR)$(INSTALL_MOD_PATH)" ] && echo DEPMOD=true) \ modules_install diff --git a/srpt/src/Makefile b/srpt/src/Makefile index 95d8fa11f..ce70bbd39 100644 --- a/srpt/src/Makefile +++ b/srpt/src/Makefile @@ -1,6 +1,6 @@ LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) CPPFLAGS := $(PRE_CFLAGS) $(CPPFLAGS) -ccflags-y += -I$(SCST_INC_DIR) +ccflags-y += -I$(KBUILD_EXTMOD)/../../scst/include -include $(KBUILD_EXTMOD)/../../build_mode