xref: /spdk/lib/Makefile (revision b3bec07939ebe2ea2e0c43931705d32aa9e06719)
1#  SPDX-License-Identifier: BSD-3-Clause
2#  Copyright (C) 2015 Intel Corporation.
3#  All rights reserved.
4#
5
6SPDK_ROOT_DIR := $(abspath $(CURDIR)/..)
7include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
8include $(SPDK_ROOT_DIR)/mk/spdk.lib_deps.mk
9
10DIRS-y += bdev blob blobfs conf dma accel event json jsonrpc \
11          log lvol rpc sock thread trace util nvme vmd nvmf scsi \
12          ioat ut_mock iscsi notify init trace_parser
13ifeq ($(OS),Linux)
14DIRS-y += nbd ftl vfio_user
15ifeq ($(CONFIG_UBLK),y)
16DIRS-y += ublk
17endif
18endif
19
20# The ut library is used by unit tests and some functional tests, so build it only when either of
21# these configs is enabled
22ifeq ($(filter $(CONFIG_TESTS) $(CONFIG_UNIT_TESTS),y),y)
23DIRS-y += ut
24endif
25
26DIRS-$(CONFIG_OCF) += env_ocf
27DIRS-$(CONFIG_IDXD) += idxd
28DIRS-$(CONFIG_VHOST) += vhost
29DIRS-$(CONFIG_VIRTIO) += virtio
30DIRS-$(CONFIG_VBDEV_COMPRESS) += reduce
31DIRS-$(CONFIG_RDMA) += rdma
32DIRS-$(CONFIG_VFIO_USER) += vfu_tgt
33
34ifeq ($(CONFIG_RDMA_PROV),mlx5_dv)
35DIRS-y += mlx5
36endif
37# If CONFIG_ENV is pointing at a directory in lib, build it.
38# Out-of-tree env implementations must be built separately by the user.
39ENV_NAME := $(notdir $(CONFIG_ENV))
40ifeq ($(abspath $(CONFIG_ENV)),$(SPDK_ROOT_DIR)/lib/$(ENV_NAME))
41DIRS-y += $(ENV_NAME)
42endif
43
44.PHONY: all clean $(DIRS-y)
45
46all: $(DIRS-y)
47clean: $(DIRS-y)
48
49include $(SPDK_ROOT_DIR)/mk/spdk.subdirs.mk
50