pci: introduce library and driver
[dpdk.git] / drivers / net / qede / Makefile
1 #    Copyright (c) 2016 QLogic Corporation.
2 #    All rights reserved.
3 #    www.qlogic.com
4 #
5 #    See LICENSE.qede_pmd for copyright and licensing details.
6
7 include $(RTE_SDK)/mk/rte.vars.mk
8
9 #
10 # library name
11 #
12 LIB = librte_pmd_qede.a
13
14 CFLAGS += -O3
15 CFLAGS += $(WERROR_FLAGS)
16 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
17 LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
18 LDLIBS += -lrte_bus_pci
19
20 EXPORT_MAP := rte_pmd_qede_version.map
21
22 LIBABIVER := 1
23
24 #
25 # OS
26 #
27 OS_TYPE := $(shell uname -s)
28
29 #
30 # CFLAGS
31 #
32 CFLAGS_BASE_DRIVER = -Wno-unused-parameter
33 CFLAGS_BASE_DRIVER += -Wno-sign-compare
34 CFLAGS_BASE_DRIVER += -Wno-missing-prototypes
35 CFLAGS_BASE_DRIVER += -Wno-cast-qual
36 CFLAGS_BASE_DRIVER += -Wno-unused-function
37 CFLAGS_BASE_DRIVER += -Wno-unused-variable
38 CFLAGS_BASE_DRIVER += -Wno-strict-aliasing
39 CFLAGS_BASE_DRIVER += -Wno-missing-prototypes
40
41 ifneq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
42 CFLAGS_BASE_DRIVER += -Wno-unused-value
43 CFLAGS_BASE_DRIVER += -Wno-format-nonliteral
44 ifeq ($(OS_TYPE),Linux)
45 ifeq ($(shell clang -Wno-shift-negative-value -Werror -E - < /dev/null > /dev/null 2>&1; echo $$?),0)
46 CFLAGS_BASE_DRIVER += -Wno-shift-negative-value
47 endif
48 endif
49 endif
50
51 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
52 ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
53 CFLAGS_BASE_DRIVER += -Wno-unused-but-set-variable
54 endif
55 CFLAGS_BASE_DRIVER += -Wno-missing-declarations
56 ifeq ($(shell test $(GCC_VERSION) -ge 46 && echo 1), 1)
57 CFLAGS_BASE_DRIVER += -Wno-maybe-uninitialized
58 endif
59 CFLAGS_BASE_DRIVER += -Wno-strict-prototypes
60 ifeq ($(shell test $(GCC_VERSION) -ge 60 && echo 1), 1)
61 CFLAGS_BASE_DRIVER += -Wno-shift-negative-value
62 ifeq ($(shell test $(GCC_VERSION) -ge 70 && echo 1), 1)
63 CFLAGS_BASE_DRIVER += -Wno-implicit-fallthrough
64 endif
65 endif
66 else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
67 CFLAGS_BASE_DRIVER += -Wno-format-extra-args
68 CFLAGS_BASE_DRIVER += -Wno-visibility
69 CFLAGS_BASE_DRIVER += -Wno-empty-body
70 CFLAGS_BASE_DRIVER += -Wno-invalid-source-encoding
71 CFLAGS_BASE_DRIVER += -Wno-sometimes-uninitialized
72 ifeq ($(shell clang -Wno-pointer-bool-conversion -Werror -E - < /dev/null > /dev/null 2>&1; echo $$?),0)
73 CFLAGS_BASE_DRIVER += -Wno-pointer-bool-conversion
74 endif
75 else
76 CFLAGS_BASE_DRIVER += -wd188 #188: enumerated type mixed with another type
77 endif
78
79 #
80 # Add extra flags for base ecore driver files
81 # to disable warnings in them
82 #
83 #
84 BASE_DRIVER_OBJS=$(sort $(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))))
85 $(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER)))
86
87 VPATH += $(SRCDIR)/base
88
89 #
90 # all source are stored in SRCS-y
91 #
92 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_dev.c
93 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_hw.c
94 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_cxt.c
95 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_l2.c
96 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_sp_commands.c
97 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_init_fw_funcs.c
98 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_spq.c
99 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_init_ops.c
100 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_mcp.c
101 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_int.c
102 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_dcbx.c
103 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += bcm_osal.c
104 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_sriov.c
105 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += ecore_vf.c
106 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_ethdev.c
107 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_main.c
108 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_rxtx.c
109 SRCS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede_fdir.c
110
111 include $(RTE_SDK)/mk/rte.lib.mk