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