vhost: try to unroll for each loop
[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 LIBABIVER := 4
12
13 CFLAGS += -DALLOW_EXPERIMENTAL_API
14 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
15 CFLAGS += -I vhost_user
16 CFLAGS += -fno-strict-aliasing
17 LDLIBS += -lpthread
18
19 ifeq ($(RTE_TOOLCHAIN), gcc)
20 ifeq ($(shell test $(GCC_VERSION) -ge 83 && echo 1), 1)
21 CFLAGS += -DVHOST_GCC_UNROLL_PRAGMA
22 endif
23 endif
24
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
28 endif
29 endif
30
31 ifeq ($(RTE_TOOLCHAIN), icc)
32 ifeq ($(shell test $(ICC_MAJOR_VERSION) -ge 16 && echo 1), 1)
33 CFLAGS += -DVHOST_ICC_UNROLL_PRAGMA
34 endif
35 endif
36
37 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
38 LDLIBS += -lnuma
39 endif
40 LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net
41
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
45
46 # install includes
47 SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h
48
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
54 endif
55
56 include $(RTE_SDK)/mk/rte.lib.mk