lib/mk: update OCF build.

The OCF build was broken by some of the recent changes
to the Makefiles. This change aims to fix that by separating out the ocf
environment from the ocf bdev.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465808 (master)

(cherry picked from commit 407e88fd2a)
Change-Id: Id445340033898e9ae70a4bcfc799951110762d55
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467293
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Seth Howell 2019-08-20 09:58:45 -07:00 committed by Jim Harris
parent 79602d10c6
commit a1d67ab87a
11 changed files with 16 additions and 12 deletions

View File

@ -28,7 +28,7 @@ if [ "$SPDK_TEST_OCF" -eq 1 ]; then
# So we precompile OCF now for further use as standalone static library
./configure $(echo $config_params | sed 's/--enable-coverage//g')
$MAKE $MAKEFLAGS include/spdk/config.h
CC=gcc CCAR=ar $MAKE $MAKEFLAGS -C module/bdev/ocf/env exportlib O=$rootdir/build/ocf.a
CC=gcc CCAR=ar $MAKE $MAKEFLAGS -C lib/env_ocf exportlib O=$rootdir/build/ocf.a
# Set config to use precompiled library
config_params="$config_params --with-ocf=/$rootdir/build/ocf.a"
fi

View File

@ -42,6 +42,10 @@ ifeq ($(OS),Linux)
DIRS-y += nbd ftl
endif
ifeq ($(CONFIG_OCF), y)
DIRS-y += env_ocf
endif
DIRS-$(CONFIG_VHOST) += vhost
DIRS-$(CONFIG_VIRTIO) += virtio
DIRS-$(CONFIG_REDUCE) += reduce

View File

@ -37,7 +37,7 @@
# Else if SPDK is configured with OCF precompiled library
# we just use it as SPDK lib by copying it to /build/lib/
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..)
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
OCFDIR=$(CONFIG_OCF_DIR)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
@ -76,17 +76,17 @@ all: ocf_inc ocf_src
$(Q)$(MAKE) $(LIB)
ocf_inc:
$(Q)$(MAKE) -C "$(CONFIG_OCF_PATH)" inc O="$(SPDK_ROOT_DIR)/module/bdev/ocf/env/" --quiet
$(Q)$(MAKE) -C "$(CONFIG_OCF_PATH)" inc O="$(SPDK_ROOT_DIR)/lib/env_ocf/" ENV= --quiet
ocf_src: ocf_inc
$(Q)$(MAKE) -C "$(CONFIG_OCF_PATH)" src O="$(SPDK_ROOT_DIR)/module/bdev/ocf/env/" CMD=cp --quiet
$(Q)$(MAKE) -C "$(CONFIG_OCF_PATH)" src O="$(SPDK_ROOT_DIR)/lib/env_ocf/" CMD=cp ENV= --quiet
ocf_distclean:
$(Q)$(MAKE) -C "$(CONFIG_OCF_PATH)" distclean O="$(SPDK_ROOT_DIR)/module/bdev/ocf/env/" --quiet
$(Q)$(MAKE) -C "$(CONFIG_OCF_PATH)" distclean O="$(SPDK_ROOT_DIR)/lib/env_ocf/" ENV= --quiet
clean: ocf_distclean
$(Q)rm -rf "$(SPDK_ROOT_DIR)/module/bdev/ocf/env/include" \
"$(SPDK_ROOT_DIR)/module/bdev/ocf/env/src" \
$(Q)rm -rf "$(SPDK_ROOT_DIR)/lib/env_ocf/include" \
"$(SPDK_ROOT_DIR)/lib/env_ocf/src" \
$(LIB) $(OBJS);
$(LIB): $(OBJS)

View File

@ -40,6 +40,7 @@
JSON_LIBS := json jsonrpc rpc
DEPDIRS-env_ocf :=
DEPDIRS-log :=
DEPDIRS-ioat := log
@ -120,6 +121,7 @@ DEPDIRS-bdev_nvme = $(BDEV_DEPS_CONF_THREAD) nvme
ifeq ($(OS),Linux)
DEPDIRS-bdev_nvme += ftl
endif
DEPDIRS-bdev_ocf := $(BDEV_DEPS_CONF_THREAD)
DEPDIRS-bdev_passthru := $(BDEV_DEPS_CONF_THREAD)
DEPDIRS-bdev_pmem := $(BDEV_DEPS_CONF_THREAD)
DEPDIRS-bdev_raid := $(BDEV_DEPS_CONF_THREAD)

View File

@ -42,8 +42,6 @@ endif
ifeq ($(CONFIG_OCF), y)
DIRS-y += ocf
DIRS-y += ocf/env
DEPDIRS-ocf := ocf/env
endif
ifeq ($(CONFIG_REDUCE),y)

View File

@ -35,13 +35,13 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
CFLAGS += $(ENV_CFLAGS) -I$(CURDIR)/env -I$(CURDIR)/env/include
CFLAGS += $(ENV_CFLAGS) -I$(SPDK_ROOT_DIR)/lib/env_ocf -I$(SPDK_ROOT_DIR)/lib/env_ocf/include
C_SRCS = $(shell ls *.c)
LIBNAME := bdev_ocf
include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
SPDK_DEP_LIBS = $(call spdk_lib_list_to_static_libs,ocfenv)
OCF_ENV := $(call spdk_lib_list_to_static_libs,ocfenv)
$(LIB) : $(SPDK_DEP_LIBS)
$(LIB) : $(OCF_ENV)