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
11 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
12 CFLAGS += -I vhost_user
13 CFLAGS += -fno-strict-aliasing
16 ifeq ($(RTE_TOOLCHAIN), gcc)
17 ifeq ($(shell test $(GCC_VERSION) -ge 83 && echo 1), 1)
18 CFLAGS += -DVHOST_GCC_UNROLL_PRAGMA
22 ifeq ($(RTE_TOOLCHAIN), clang)
23 ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -ge 37 && echo 1), 1)
24 CFLAGS += -DVHOST_CLANG_UNROLL_PRAGMA
28 ifeq ($(RTE_TOOLCHAIN), icc)
29 ifeq ($(shell test $(ICC_MAJOR_VERSION) -ge 16 && echo 1), 1)
30 CFLAGS += -DVHOST_ICC_UNROLL_PRAGMA
34 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
37 LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net
39 # all source are stored in SRCS-y
40 SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := fd_man.c iotlb.c socket.c vhost.c \
41 vhost_user.c virtio_net.c vdpa.c
44 SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h
46 # only compile vhost crypto when cryptodev is enabled
47 ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
48 LDLIBS += -lrte_cryptodev -lrte_hash
49 SRCS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost_crypto.c
50 SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost_crypto.h
53 include $(RTE_SDK)/mk/rte.lib.mk