From 74e5b31b9573b5c2624c9ef93515e2a020113c28 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 25 Mar 2019 19:55:15 +0000 Subject: [PATCH] Makefiles: Use cc-option instead of enable-Wextra git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8075 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/Makefile | 8 ++------ iscsi-scst/kernel/isert-scst/Makefile | 8 ++------ qla2x00t/Makefile | 20 ++++++++++---------- scst/src/Makefile | 6 ++---- scst/src/dev_handlers/Makefile | 8 +++----- scst_local/Makefile | 6 ++---- 6 files changed, 21 insertions(+), 35 deletions(-) diff --git a/iscsi-scst/kernel/Makefile b/iscsi-scst/kernel/Makefile index 1843aca72..d5fb29bcc 100644 --- a/iscsi-scst/kernel/Makefile +++ b/iscsi-scst/kernel/Makefile @@ -20,14 +20,10 @@ # # Note 2! The CFLAGS definitions are now in the main makefile. -cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) -enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) - EXTRA_CFLAGS += -I$(src)/../include -I$(SCST_INC_DIR) -EXTRA_CFLAGS += $(call enable-Wextra,-Wextra \ +EXTRA_CFLAGS += $(call cc-option,-Wextra) \ $(call cc-option,-Wno-old-style-declaration) \ - -Wno-unused-parameter -Wno-missing-field-initializers) + -Wno-unused-parameter -Wno-missing-field-initializers EXTRA_CFLAGS += $(PRE_CFLAGS) #EXTRA_CFLAGS += -DCONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES diff --git a/iscsi-scst/kernel/isert-scst/Makefile b/iscsi-scst/kernel/isert-scst/Makefile index df19dec40..140d5d2a8 100644 --- a/iscsi-scst/kernel/isert-scst/Makefile +++ b/iscsi-scst/kernel/isert-scst/Makefile @@ -20,15 +20,11 @@ # # Note 2! The CFLAGS definitions are now in the main makefile. -cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ - > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) -enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) - LINUXINCLUDE := $(PRE_CFLAGS) $(LINUXINCLUDE) EXTRA_CFLAGS += -I$(src)/../../include -I$(SCST_INC_DIR) -EXTRA_CFLAGS += $(call enable-Wextra,-Wextra \ +EXTRA_CFLAGS += $(call cc-option,-Wextra) \ $(call cc-option,-Wno-old-style-declaration) \ - -Wno-unused-parameter -Wno-missing-field-initializers) + -Wno-unused-parameter -Wno-missing-field-initializers -include $(KBUILD_EXTMOD)/../../../build_mode diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index 6f65d07af..f57921a52 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -26,15 +26,6 @@ SCST_INC_DIR := $(shell if [ -e "$$PWD/../scst" ]; \ then echo "$$PWD/../scst/include"; \ else echo "$(DESTDIR)$(PREFIX)/include/scst"; fi) -enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) - -EXTRA_CFLAGS += $(call enable-Wextra,-Wextra -Wno-unused-parameter \ - -Wno-missing-field-initializers) -I$(SCST_INC_DIR) - -ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) -EXTRA_CFLAGS += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET) -endif - ifeq ($(KVER),) ifeq ($(KDIR),) KVER := $(shell uname -r) @@ -55,13 +46,22 @@ endif INSTALL_DIR := $(INSTALL_MOD_PATH)/lib/modules/$(KVER)/extra ifneq ($(PATCHLEVEL),) +EXTRA_CFLAGS += $(call cc-option,-Wextra) -Wno-unused-parameter \ + -Wno-missing-field-initializers -I$(SCST_INC_DIR) + +ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),) +EXTRA_CFLAGS += -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) BUILD_INI=m EXTRA_CFLAGS="$(EXTRA_CFLAGS)" + $(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 $(MAKE) -C $(KDIR) M=$(shell pwd) BUILD_INI=m \ diff --git a/scst/src/Makefile b/scst/src/Makefile index 54d903b91..f13573208 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -38,10 +38,8 @@ DEV_HANDLERS_DIR = dev_handlers ifneq ($(PATCHLEVEL),) SCST_INC_DIR := $(KBUILD_EXTMOD)/../include -enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) - -EXTRA_CFLAGS += -I$(SCST_INC_DIR) $(call enable-Wextra,-Wextra \ - -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare) \ +EXTRA_CFLAGS += -I$(SCST_INC_DIR) $(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) #EXTRA_CFLAGS += -DCONFIG_SCST_STRICT_SERIALIZING diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 86cf74e78..dda5c7cc1 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -32,11 +32,9 @@ SHELL=/bin/bash ifneq ($(PATCHLEVEL),) SCST_INC_DIR := $(KBUILD_EXTMOD)/../include -enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) - -EXTRA_CFLAGS += -I$(SCST_INC_DIR) \ - $(call enable-Wextra,-Wextra \ - -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare) +EXTRA_CFLAGS += -I$(SCST_INC_DIR) \ + $(call cc-option,-Wextra) \ + -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare #EXTRA_CFLAGS += -DCONFIG_DEBUG_EXT_COPY_REMAP -include $(KBUILD_EXTMOD)/../../build_mode diff --git a/scst_local/Makefile b/scst_local/Makefile index cd1728866..99ed16207 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -7,11 +7,9 @@ SHELL=/bin/bash KMOD := $(shell pwd)/kernel ifneq ($(PATCHLEVEL),) -enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi) - EXTRA_CFLAGS += -I$(SCST_INC_DIR) -EXTRA_CFLAGS += $(call enable-Wextra,-Wextra -Wno-unused-parameter\ - -Wno-missing-field-initializers) +EXTRA_CFLAGS += $(call cc-option,-Wextra) -Wno-unused-parameter\ + -Wno-missing-field-initializers #EXTRA_CFLAGS += -DCONFIG_SCST_LOCAL_DIRECT_PROCESSING