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