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