]> git.proxmox.com Git - ceph.git/blame - ceph/src/seastar/dpdk/examples/ipsec-secgw/Makefile
import 15.2.0 Octopus source
[ceph.git] / ceph / src / seastar / dpdk / examples / ipsec-secgw / Makefile
CommitLineData
9f95a23c
TL
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright(c) 2016 Intel Corporation
3
4APP = ipsec-secgw
5
7c673cae 6#
9f95a23c 7# all source are stored in SRCS-y
7c673cae 8#
9f95a23c
TL
9SRCS-y += parser.c
10SRCS-y += ipsec.c
11SRCS-y += esp.c
12SRCS-y += sp4.c
13SRCS-y += sp6.c
14SRCS-y += sa.c
15SRCS-y += rt.c
16SRCS-y += ipsec_process.c
17SRCS-y += ipsec-secgw.c
18
19CFLAGS += -gdwarf-2
20
21# Build using pkg-config variables if possible
22$(shell pkg-config --exists libdpdk)
23ifeq ($(.SHELLSTATUS),0)
24
25all: shared
26.PHONY: shared static
27shared: build/$(APP)-shared
28 ln -sf $(APP)-shared build/$(APP)
29static: build/$(APP)-static
30 ln -sf $(APP)-static build/$(APP)
31
32PC_FILE := $(shell pkg-config --path libdpdk)
33CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)
34LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)
35LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)
36
37CFLAGS += -DALLOW_EXPERIMENTAL_API
38
39build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
40 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
41
42build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build
43 $(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)
44
45build:
46 @mkdir -p $@
47
48.PHONY: clean
49clean:
50 rm -f build/$(APP) build/$(APP)-static build/$(APP)-shared
51 rmdir --ignore-fail-on-non-empty build
52
53else
7c673cae
FG
54
55ifeq ($(RTE_SDK),)
9f95a23c 56$(error "Please define RTE_SDK environment variable")
7c673cae
FG
57endif
58
9f95a23c
TL
59# Default target, detect a build directory, by looking for a path with a .config
60RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))
7c673cae
FG
61
62include $(RTE_SDK)/mk/rte.vars.mk
63
9f95a23c
TL
64ifneq ($(MAKECMDGOALS),clean)
65ifneq ($(CONFIG_RTE_LIBRTE_IPSEC),y)
66$(error "RTE_LIBRTE_IPSEC is required to build ipsec-secgw")
67endif
68endif
7c673cae 69
9f95a23c 70CFLAGS += -DALLOW_EXPERIMENTAL_API
7c673cae
FG
71CFLAGS += -O3 -gdwarf-2
72CFLAGS += $(WERROR_FLAGS)
73ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
74CFLAGS_sa.o += -diag-disable=vec
75endif
76
77ifeq ($(DEBUG),1)
78CFLAGS += -DIPSEC_DEBUG -fstack-protector-all -O0
79endif
80
7c673cae 81include $(RTE_SDK)/mk/rte.extapp.mk
9f95a23c
TL
82
83endif