examples/ip_pipeline: remove flow classification pipeline
[dpdk.git] / examples / ip_pipeline / Makefile
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
3
4 # binary name
5 APP = ip_pipeline
6
7 # all source are stored in SRCS-y
8 SRCS-y := main.c
9 SRCS-y += config_parse.c
10 SRCS-y += parser.c
11 SRCS-y += config_parse_tm.c
12 SRCS-y += config_check.c
13 SRCS-y += init.c
14 SRCS-y += thread.c
15 SRCS-y += thread_fe.c
16 SRCS-y += cpu_core_map.c
17
18 SRCS-y += pipeline_common_be.c
19 SRCS-y += pipeline_common_fe.c
20 SRCS-y += pipeline_master_be.c
21 SRCS-y += pipeline_master.c
22 SRCS-y += pipeline_firewall_be.c
23 SRCS-y += pipeline_firewall.c
24 SRCS-y += pipeline_flow_actions_be.c
25 SRCS-y += pipeline_flow_actions.c
26
27 # Build using pkg-config variables if possible
28 $(shell pkg-config --exists libdpdk)
29 ifeq ($(.SHELLSTATUS),0)
30
31 all: shared
32 .PHONY: shared static
33 shared: build/$(APP)-shared
34         ln -sf $(APP)-shared build/$(APP)
35 static: build/$(APP)-static
36         ln -sf $(APP)-static build/$(APP)
37
38 PC_FILE := $(shell pkg-config --path libdpdk)
39 CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
40 LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
41 LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
42
43 VPATH += pipeline
44 CFLAGS += -I. -I./pipeline/
45 CFLAGS += -DALLOW_EXPERIMENTAL_API
46
47 OBJS := $(patsubst %.c,build/%.o,$(SRCS-y))
48
49 build/%.o: %.c Makefile $(PC_FILE) | build
50         $(CC) $(CFLAGS) -c $< -o $@
51
52 build/$(APP)-shared: $(OBJS)
53         $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
54
55 build/$(APP)-static: $(OBJS)
56         $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)
57
58 build:
59         @mkdir -p $@
60
61 .PHONY: clean
62 clean:
63         rm -f build/$(APP)* build/*.o
64         rmdir --ignore-fail-on-non-empty build
65
66 else
67
68 ifeq ($(RTE_SDK),)
69 $(error "Please define RTE_SDK environment variable")
70 endif
71
72 VPATH += $(SRCDIR)/pipeline
73
74 # Default target, can be overridden by command line or environment
75 RTE_TARGET ?= x86_64-native-linuxapp-gcc
76
77 include $(RTE_SDK)/mk/rte.vars.mk
78
79 INC += $(sort $(wildcard *.h)) $(sort $(wildcard pipeline/*.h))
80
81 SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) := $(SRCS-y)
82
83 CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/pipeline
84 CFLAGS += -O3
85 CFLAGS += $(WERROR_FLAGS) -Wno-error=unused-function -Wno-error=unused-variable
86 CFLAGS += -DALLOW_EXPERIMENTAL_API
87
88 include $(RTE_SDK)/mk/rte.extapp.mk
89
90 endif