examples: use new link status print format
[dpdk.git] / examples / performance-thread / l3fwd-thread / Makefile
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2020 Intel Corporation
3
4 # binary name
5 APP = l3fwd-thread
6
7 # all source are stored in SRCS-y
8 SRCS-y := main.c
9
10 include ../common/common.mk
11
12 CFLAGS += -DALLOW_EXPERIMENTAL_API
13
14 # Build using pkg-config variables if possible
15 ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
16 $(error "no installation of DPDK found")
17 endif
18
19 all: shared
20 .PHONY: shared static
21 shared: build/$(APP)-shared
22         ln -sf $(APP)-shared build/$(APP)
23 static: build/$(APP)-static
24         ln -sf $(APP)-static build/$(APP)
25
26 PKGCONF ?= pkg-config
27
28 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
29 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
30 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
31 LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
32
33 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
34         $(CC) $(CFLAGS) $(filter %.c,$^) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
35
36 build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build
37         $(CC) $(CFLAGS) $(filter %.c,$^) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
38
39 build:
40         @mkdir -p $@
41
42 .PHONY: clean
43 clean:
44         rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
45         test -d build && rmdir -p build || true