1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
4 include $(RTE_SDK)/mk/rte.vars.mk
9 EXPORT_MAP := rte_vhost_version.map
13 CFLAGS += -DALLOW_EXPERIMENTAL_API
14 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
15 CFLAGS += -I vhost_user
16 CFLAGS += -fno-strict-aliasing
19 ifeq ($(RTE_TOOLCHAIN), gcc)
20 ifeq ($(shell test $(GCC_VERSION) -ge 83 && echo 1), 1)
21 CFLAGS += -DVHOST_GCC_UNROLL_PRAGMA
25 ifeq ($(RTE_TOOLCHAIN), clang)
26 ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -ge 37 && echo 1), 1)
27 CFLAGS += -DVHOST_CLANG_UNROLL_PRAGMA
31 ifeq ($(RTE_TOOLCHAIN), icc)
32 ifeq ($(shell test $(ICC_MAJOR_VERSION) -ge 16 && echo 1), 1)
33 CFLAGS += -DVHOST_ICC_UNROLL_PRAGMA
37 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
40 LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net
42 # all source are stored in SRCS-y
43 SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := fd_man.c iotlb.c socket.c vhost.c \
44 vhost_user.c virtio_net.c vdpa.c
47 SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h
49 # only compile vhost crypto when cryptodev is enabled
50 ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
51 LDLIBS += -lrte_cryptodev -lrte_hash
52 SRCS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost_crypto.c
53 SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost_crypto.h
56 include $(RTE_SDK)/mk/rte.lib.mk