test: add ENV_CFLAGS after includes

DPDK CFLAGS get put into CFLAGS in mk/cc.flags.mk,
which for system package installed DPDK will include
extra paths like /usr/include/<arch-3-tuple>/dpdk.
If a Makefile adds its own CFLAGS before including
the .mk fragment that pulls in these CFLAGS, we won't
actually get those cc.flags.mk applied since they
are defined with ?=.

This may need to be revisited - using ?= for these
has evolved through several iterations of our SPDK
configured flag files - starting with commit
08ec96eb.  But for now, let's just fix these few
Makefiles.

Fixes issue #2548.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9863db1b37b31907b4088f58cc13b81ed1bb8632
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12982
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
Jim Harris 2022-06-08 00:44:22 +00:00 committed by Tomasz Zawadzki
parent 6c2ce12217
commit 6e9cf0c7b4
4 changed files with 9 additions and 5 deletions

View File

@ -5,7 +5,8 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
CFLAGS += $(ENV_CFLAGS)
APP = env_dpdk_post_init APP = env_dpdk_post_init
include $(SPDK_ROOT_DIR)/mk/nvme.libtest.mk include $(SPDK_ROOT_DIR)/mk/nvme.libtest.mk
CFLAGS += $(ENV_CFLAGS)

View File

@ -5,8 +5,9 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
CFLAGS += $(ENV_CFLAGS)
CFLAGS += -I$(SPDK_ROOT_DIR)/test/lib
TEST_FILE = memory_ut.c TEST_FILE = memory_ut.c
include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk
CFLAGS += $(ENV_CFLAGS)
CFLAGS += -I$(SPDK_ROOT_DIR)/test/lib

View File

@ -6,7 +6,8 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
UNIT_TEST_LINK_ENV = 1 UNIT_TEST_LINK_ENV = 1
CFLAGS += $(ENV_CFLAGS)
TEST_FILE = pci_ut.c TEST_FILE = pci_ut.c
include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk
CFLAGS += $(ENV_CFLAGS)

View File

@ -6,7 +6,8 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..) SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..)
include $(SPDK_ROOT_DIR)/mk/config.mk include $(SPDK_ROOT_DIR)/mk/config.mk
CFLAGS += $(ENV_CFLAGS)
TEST_FILE = vhost_ut.c TEST_FILE = vhost_ut.c
include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk include $(SPDK_ROOT_DIR)/mk/spdk.unittest.mk
CFLAGS += $(ENV_CFLAGS)