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-secgw.c
20 # Build using pkg-config variables if possible
21 $(shell pkg-config --exists libdpdk)
22 ifeq ($(.SHELLSTATUS),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 PC_FILE := $(shell pkg-config --path libdpdk)
32 CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
33 LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
34 LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
36 CFLAGS += -DALLOW_EXPERIMENTAL_API
38 build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
39 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
41 build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build
42 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)
49 rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
50 rmdir --ignore-fail-on-non-empty build
55 $(error "Please define RTE_SDK environment variable")
58 # Default target, can be overridden by command line or environment
59 RTE_TARGET ?= x86_64-native-linuxapp-gcc
61 include $(RTE_SDK)/mk/rte.vars.mk
63 ifneq ($(MAKECMDGOALS),clean)
64 ifneq ($(CONFIG_RTE_LIBRTE_SECURITY),y)
65 $(error "RTE_LIBRTE_SECURITY is required to build ipsec-secgw")
69 CFLAGS += -DALLOW_EXPERIMENTAL_API
70 CFLAGS += -O3 -gdwarf-2
71 CFLAGS += $(WERROR_FLAGS)
72 ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
73 CFLAGS_sa.o += -diag-disable=vec
77 CFLAGS += -DIPSEC_DEBUG -fstack-protector-all -O0
80 include $(RTE_SDK)/mk/rte.extapp.mk