81c9a0dbf23a28cbbef76a0ce31ec893ce4ca4b0
[dpdk.git] / drivers / net / iavf / Makefile
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
3
4 include $(RTE_SDK)/mk/rte.vars.mk
5
6 #
7 # library name
8 #
9 LIB = librte_pmd_iavf.a
10
11 CFLAGS += -O3 $(WERROR_FLAGS) -Wno-strict-aliasing -DALLOW_EXPERIMENTAL_API
12 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
13 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_hash
14 LDLIBS += -lrte_bus_pci
15
16 EXPORT_MAP := rte_pmd_iavf_version.map
17
18 #
19 # Add extra flags for base driver files (also known as shared code)
20 # to disable warnings
21 #
22 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
23 CFLAGS_BASE_DRIVER =
24 else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
25 CFLAGS_BASE_DRIVER = -Wno-pointer-to-int-cast
26 else
27 CFLAGS_BASE_DRIVER = -Wno-pointer-to-int-cast
28
29 endif
30 OBJS_BASE_DRIVER=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))))
31 $(foreach obj, $(OBJS_BASE_DRIVER), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER)))
32
33
34 VPATH += $(SRCDIR)/base
35
36 #
37 # all source are stored in SRCS-y
38 #
39 SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_adminq.c
40 SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_common.c
41
42 SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_ethdev.c
43 SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_vchnl.c
44 SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx.c
45 ifeq ($(CONFIG_RTE_ARCH_X86), y)
46 SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx_vec_sse.c
47 endif
48
49 ifeq ($(CONFIG_RTE_LIBRTE_IAVF_PMD), y)
50         ifeq ($(findstring RTE_MACHINE_CPUFLAG_AVX2,$(CFLAGS)),RTE_MACHINE_CPUFLAG_AVX2)
51                 CC_AVX2_SUPPORT=1
52         else
53                 CC_AVX2_SUPPORT=\
54                 $(shell $(CC) -march=core-avx2 -dM -E - </dev/null 2>&1 | \
55                 grep -q AVX2 && echo 1)
56                 ifeq ($(CC_AVX2_SUPPORT), 1)
57                         ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
58                                 CFLAGS_iavf_rxtx_vec_avx2.o += -march=core-avx2
59                         else
60                                 CFLAGS_iavf_rxtx_vec_avx2.o += -mavx2
61                         endif
62                 endif
63         endif
64 endif
65
66 ifeq ($(CC_AVX2_SUPPORT), 1)
67         SRCS-$(CONFIG_RTE_LIBRTE_IAVF_PMD) += iavf_rxtx_vec_avx2.c
68 endif
69
70 include $(RTE_SDK)/mk/rte.lib.mk