1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(C) 2019 Marvell International Ltd.
8 # all source are stored in SRCS-y
10 SRCS-y += l2fwd_poll.c
11 SRCS-y += l2fwd_event.c
12 SRCS-y += l2fwd_common.c
13 SRCS-y += l2fwd_event_generic.c
14 SRCS-y += l2fwd_event_internal_port.c
16 # Build using pkg-config variables if possible
17 ifeq ($(shell pkg-config --exists libdpdk && echo 0),0)
21 shared: build/$(APP)-shared
22 ln -sf $(APP)-shared build/$(APP)
23 static: build/$(APP)-static
24 ln -sf $(APP)-static build/$(APP)
28 PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
29 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
30 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
31 LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
33 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
34 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
36 build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build
37 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)
44 rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
45 test -d build && rmdir -p build || true
47 else # Build using legacy build system
50 $(error "Please define RTE_SDK environment variable")
53 # Default target, detect a build directory, by looking for a path with a .config
54 RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))
56 include $(RTE_SDK)/mk/rte.vars.mk
59 CFLAGS += $(WERROR_FLAGS)
61 include $(RTE_SDK)/mk/rte.extapp.mk