1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
7 # all source are stored in SRCS-y
9 SRCS-y += config_parse.c
11 SRCS-y += config_parse_tm.c
12 SRCS-y += config_check.c
15 SRCS-y += cpu_core_map.c
17 # Build using pkg-config variables if possible
18 $(shell pkg-config --exists libdpdk)
19 ifeq ($(.SHELLSTATUS),0)
23 shared: build/$(APP)-shared
24 ln -sf $(APP)-shared build/$(APP)
25 static: build/$(APP)-static
26 ln -sf $(APP)-static build/$(APP)
28 PC_FILE := $(shell pkg-config --path libdpdk)
29 CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
30 LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
31 LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
34 CFLAGS += -I. -I./pipeline/
35 CFLAGS += -DALLOW_EXPERIMENTAL_API
37 OBJS := $(patsubst %.c,build/%.o,$(SRCS-y))
39 build/%.o: %.c Makefile $(PC_FILE) | build
40 $(CC) $(CFLAGS) -c $< -o $@
42 build/$(APP)-shared: $(OBJS)
43 $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
45 build/$(APP)-static: $(OBJS)
46 $(CC) $(OBJS) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)
53 rm -f build/$(APP)* build/*.o
54 rmdir --ignore-fail-on-non-empty build
59 $(error "Please define RTE_SDK environment variable")
62 VPATH += $(SRCDIR)/pipeline
64 # Default target, can be overridden by command line or environment
65 RTE_TARGET ?= x86_64-native-linuxapp-gcc
67 include $(RTE_SDK)/mk/rte.vars.mk
69 INC += $(sort $(wildcard *.h)) $(sort $(wildcard pipeline/*.h))
71 SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) := $(SRCS-y)
73 CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/pipeline
75 CFLAGS += $(WERROR_FLAGS) -Wno-error=unused-function -Wno-error=unused-variable
76 CFLAGS += -DALLOW_EXPERIMENTAL_API
78 include $(RTE_SDK)/mk/rte.extapp.mk