1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2016 Intel Corporation
7 # all source are stored in SRCS-y
16 SRCS-y += ipsec_process.c
17 SRCS-y += ipsec-secgw.c
21 # Build using pkg-config variables if possible
22 ifeq ($(shell pkg-config --exists libdpdk && echo 0),0)
26 shared: build/$(APP)-shared
27 ln -sf $(APP)-shared build/$(APP)
28 static: build/$(APP)-static
29 ln -sf $(APP)-static build/$(APP)
31 PKGCONF=pkg-config --define-prefix
33 PC_FILE := $(shell $(PKGCONF) --path libdpdk)
34 CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
35 LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
36 LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)
38 CFLAGS += -DALLOW_EXPERIMENTAL_API
40 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
41 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
43 build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build
44 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)
51 rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
52 test -d build && rmdir -p build || true
57 $(error "Please define RTE_SDK environment variable")
60 # Default target, detect a build directory, by looking for a path with a .config
61 RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))
63 include $(RTE_SDK)/mk/rte.vars.mk
65 ifneq ($(MAKECMDGOALS),clean)
66 ifneq ($(CONFIG_RTE_LIBRTE_IPSEC),y)
67 $(error "RTE_LIBRTE_IPSEC is required to build ipsec-secgw")
71 CFLAGS += -DALLOW_EXPERIMENTAL_API
72 CFLAGS += -O3 -gdwarf-2
73 CFLAGS += $(WERROR_FLAGS)
74 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
75 CFLAGS_sa.o += -diag-disable=vec
79 CFLAGS += -DIPSEC_DEBUG -fstack-protector-all -O0
82 include $(RTE_SDK)/mk/rte.extapp.mk