lib: use CONFIG_ENV to pick which env dir to build

Previously, lib/Makefile just hard-coded env_dpdk in the list of
directories to build; this won't work if the user has chosen a different
env implementation via CONFIG_ENV (or configure --with-env).

Modify lib/Makefile so that the user can either put their env
implementation directly into SPDK's lib directory (like env_dpdk) or
outside of the SPDK tree (in which case the user must handle building it
before building SPDK).

Change-Id: I77e0611152f97f7bd6efcff10ffadf2fb1b1167e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412248
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Daniel Verkamp 2018-05-23 10:18:25 -07:00 committed by Jim Harris
parent 65e56caa17
commit bd2b1d372a

View File

@ -35,7 +35,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
DIRS-y += bdev blob blobfs conf copy cunit event json jsonrpc \
log lvol env_dpdk net rpc trace util nvme nvmf scsi ioat \
log lvol net rpc trace util nvme nvmf scsi ioat \
ut_mock iscsi
ifeq ($(OS),Linux)
DIRS-y += nbd
@ -43,6 +43,12 @@ DIRS-$(CONFIG_VHOST) += vhost
DIRS-$(CONFIG_VIRTIO) += virtio
endif
# If CONFIG_ENV is pointing at a directory in lib, build it.
# Out-of-tree env implementations must be built separately by the user.
ENV_NAME := $(notdir $(CONFIG_ENV))
ifeq ($(abspath $(CONFIG_ENV)),$(SPDK_ROOT_DIR)/lib/$(ENV_NAME))
DIRS-y += $(ENV_NAME)
endif
.PHONY: all clean $(DIRS-y)