examples/vhost: remove DMA type option help info
[dpdk.git] / examples / ethtool / lib / Makefile
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2015-2020 Intel Corporation
3
4
5 PKGCONF ?= pkg-config
6
7 ifneq ($(shell $(PKGCONF) --exists libdpdk && echo 0),0)
8 $(error "no installation of DPDK found")
9 endif
10 ifneq ($(shell uname),Linux)
11 $(error This application can only operate in a linux environment)
12 endif
13
14 # library name
15 LIB = librte_ethtool.so
16 LIB_STATIC = librte_ethtool.a
17 SRCS = rte_ethtool.c
18
19 CFLAGS += -O3
20 CFLAGS += -fPIC
21 CFLAGS += -DALLOW_EXPERIMENTAL_API
22
23 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
24 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
25 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
26 LDFLAGS += -Wl,--no-undefined $(LDFLAGS_SHARED)
27
28 # check for ixgbe by grepping pre-processor output
29 ifneq ($(shell $(CC) $(CFLAGS) -dM -E - < /dev/null | grep IXGBE),)
30 LDFLAGS += -lrte_net_ixgbe
31 endif
32
33 .PHONY: all clean static shared
34 all shared: build/$(LIB)
35 static: build/$(LIB_STATIC)
36
37 clean:
38         rm -f build/$(LIB)
39         test -d build && rmdir -p build || true
40
41 build:
42         @mkdir -p $@
43
44 build/%.so: $(SRCS) Makefile $(PC_FILE) | build
45         $(CC) $(CFLAGS) -o $@ -shared $(SRCS) $(LDFLAGS)
46
47 build/%.a: $(SRCS) Makefile $(PC_FILE) | build
48         $(CC) $(CFLAGS) -c $(SRCS) -o build/$(SRCS).o
49         $(AR) -cr $@ build/*.o