vhost: split vDPA header file
[dpdk.git] / lib / librte_vhost / Makefile
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
3
4 include $(RTE_SDK)/mk/rte.vars.mk
5
6 # library name
7 LIB = librte_vhost.a
8
9 EXPORT_MAP := rte_vhost_version.map
10
11 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
12 CFLAGS += -I vhost_user
13 CFLAGS += -fno-strict-aliasing
14 LDLIBS += -lpthread
15
16 ifeq ($(RTE_TOOLCHAIN), gcc)
17 ifeq ($(shell test $(GCC_VERSION) -ge 83 && echo 1), 1)
18 CFLAGS += -DVHOST_GCC_UNROLL_PRAGMA
19 endif
20 endif
21
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
25 endif
26 endif
27
28 ifeq ($(RTE_TOOLCHAIN), icc)
29 ifeq ($(shell test $(ICC_MAJOR_VERSION) -ge 16 && echo 1), 1)
30 CFLAGS += -DVHOST_ICC_UNROLL_PRAGMA
31 endif
32 endif
33
34 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
35 LDLIBS += -lnuma
36 endif
37 LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net
38
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
42
43 # install includes
44 SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h \
45                                                 rte_vdpa_dev.h
46
47 # only compile vhost crypto when cryptodev is enabled
48 ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
49 LDLIBS += -lrte_cryptodev -lrte_hash
50 SRCS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost_crypto.c
51 SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost_crypto.h
52 endif
53
54 include $(RTE_SDK)/mk/rte.lib.mk