From bd2b1d372adf8f885821acba845683f6c4ca7fd1 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Wed, 23 May 2018 10:18:25 -0700 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/412248 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Makefile b/lib/Makefile index 789c924ec..e1b4bdd4b 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -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)