Commit bd2b1d37 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

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: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412248


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 65e56caa
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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)