examples/ip_pipeline: remove passthrough 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_classification_be.c
25 SRCS-y += pipeline_flow_classification.c
26 SRCS-y += pipeline_flow_actions_be.c
27 SRCS-y += pipeline_flow_actions.c
28 SRCS-y += pipeline_routing_be.c
29 SRCS-y += pipeline_routing.c
30
31 # Build using pkg-config variables if possible
32 $(shell pkg-config --exists libdpdk)
33 ifeq ($(.SHELLSTATUS),0)
34
35 all: shared
36 .PHONY: shared static
37 shared: build/$(APP)-shared
38         ln -sf $(APP)-shared build/$(APP)
39 static: build/$(APP)-static
40         ln -sf $(APP)-static build/$(APP)
41
42 PC_FILE := $(shell pkg-config --path libdpdk)
43 CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
44 LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
45 LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
46
47 VPATH += pipeline
48 CFLAGS += -I. -I./pipeline/
49 CFLAGS += -DALLOW_EXPERIMENTAL_API
50
51 OBJS := $(patsubst %.c,build/%.o,$(SRCS-y))
52
53 build/%.o: %.c Makefile $(PC_FILE) | build
54         $(CC) $(CFLAGS) -c $< -o $@
55
56 build/$(APP)-shared: $(OBJS)
57         $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
58
59 build/$(APP)-static: $(OBJS)
60         $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)
61
62 build:
63         @mkdir -p $@
64
65 .PHONY: clean
66 clean:
67         rm -f build/$(APP)* build/*.o
68         rmdir --ignore-fail-on-non-empty build
69
70 else
71
72 ifeq ($(RTE_SDK),)
73 $(error "Please define RTE_SDK environment variable")
74 endif
75
76 VPATH += $(SRCDIR)/pipeline
77
78 # Default target, can be overridden by command line or environment
79 RTE_TARGET ?= x86_64-native-linuxapp-gcc
80
81 include $(RTE_SDK)/mk/rte.vars.mk
82
83 INC += $(sort $(wildcard *.h)) $(sort $(wildcard pipeline/*.h))
84
85 SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) := $(SRCS-y)
86
87 CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/pipeline
88 CFLAGS += -O3
89 CFLAGS += $(WERROR_FLAGS) -Wno-error=unused-function -Wno-error=unused-variable
90 CFLAGS += -DALLOW_EXPERIMENTAL_API
91
92 include $(RTE_SDK)/mk/rte.extapp.mk
93
94 endif