]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/dpdk/examples/ip_pipeline/Makefile
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / dpdk / examples / ip_pipeline / Makefile
CommitLineData
11fdf7f2
TL
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2010-2018 Intel Corporation
3
4# binary name
5APP = ip_pipeline
6
7# all source are stored in SRCS-y
8SRCS-y := action.c
9SRCS-y += cli.c
10SRCS-y += conn.c
11SRCS-y += kni.c
12SRCS-y += link.c
13SRCS-y += main.c
14SRCS-y += mempool.c
15SRCS-y += parser.c
16SRCS-y += pipeline.c
17SRCS-y += swq.c
18SRCS-y += tap.c
19SRCS-y += thread.c
20SRCS-y += tmgr.c
9f95a23c 21SRCS-y += cryptodev.c
11fdf7f2
TL
22
23# Build using pkg-config variables if possible
f67539c2 24ifeq ($(shell pkg-config --exists libdpdk && echo 0),0)
11fdf7f2
TL
25
26all: shared
27.PHONY: shared static
28shared: build/$(APP)-shared
29 ln -sf $(APP)-shared build/$(APP)
30static: build/$(APP)-static
31 ln -sf $(APP)-static build/$(APP)
32
f67539c2
TL
33PKGCONF ?= pkg-config
34
35PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
36CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
37LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
38LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
11fdf7f2
TL
39
40CFLAGS += -I.
41
42OBJS := $(patsubst %.c,build/%.o,$(SRCS-y))
43
44build/%.o: %.c Makefile $(PC_FILE) | build
45 $(CC) $(CFLAGS) -c $< -o $@
46
47build/$(APP)-shared: $(OBJS)
48 $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
49
50build/$(APP)-static: $(OBJS)
51 $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)
52
53build:
54 @mkdir -p $@
55
56.PHONY: clean
57clean:
58 rm -f build/$(APP)* build/*.o
f67539c2 59 test -d build && rmdir -p build || true
11fdf7f2
TL
60
61else
62
63ifeq ($(RTE_SDK),)
64$(error "Please define RTE_SDK environment variable")
65endif
66
9f95a23c
TL
67# Default target, detect a build directory, by looking for a path with a .config
68RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))
11fdf7f2
TL
69
70include $(RTE_SDK)/mk/rte.vars.mk
71
9f95a23c
TL
72ifneq ($(CONFIG_RTE_EXEC_ENV_LINUX),y)
73$(info This application can only operate in a linux environment, \
11fdf7f2
TL
74please change the definition of the RTE_TARGET environment variable)
75all:
76clean:
77else
78
79INC += $(sort $(wildcard *.h))
80
81SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) := $(SRCS-y)
82
83CFLAGS += -DALLOW_EXPERIMENTAL_API
84CFLAGS += -I$(SRCDIR)
85CFLAGS += -O3
86CFLAGS += $(WERROR_FLAGS)
87
88include $(RTE_SDK)/mk/rte.extapp.mk
89
90endif
91endif