mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
The defines.mk file always set -DDEBUG, inherited from the xdp-tools build system. However, the configure script in this repository doesn't actually support the PRODUCTION variable, so change the define to only set -DDEBUG if a DEBUG variable is supplied to 'make'. This way DEBUG can be turned on with a command-line DEBUG=1 parameter to 'make', but will be unset otherwise. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
37 lines
910 B
Makefile
37 lines
910 B
Makefile
CFLAGS ?= -O2 -g
|
|
BPF_CFLAGS ?= -Wno-visibility
|
|
|
|
include $(LIB_DIR)/../config.mk
|
|
|
|
PREFIX?=/usr/local
|
|
LIBDIR?=$(PREFIX)/lib
|
|
SBINDIR?=$(PREFIX)/sbin
|
|
HDRDIR?=$(PREFIX)/include/xdp
|
|
DATADIR?=$(PREFIX)/share
|
|
MANDIR?=$(DATADIR)/man
|
|
BPF_DIR_MNT ?=/sys/fs/bpf
|
|
BPF_OBJECT_DIR ?=$(LIBDIR)/bpf
|
|
MAX_DISPATCHER_ACTIONS ?=10
|
|
|
|
# headers/ dir contains include header files needed to compile BPF programs
|
|
HEADER_DIR = $(LIB_DIR)/../headers
|
|
# include/ dir contains the projects own include header files
|
|
INCLUDE_DIR = $(LIB_DIR)/../include
|
|
TEST_DIR = $(LIB_DIR)/testing
|
|
LIBBPF_DIR := $(LIB_DIR)/libbpf
|
|
|
|
DEFINES := -DBPF_DIR_MNT=\"$(BPF_DIR_MNT)\" -DBPF_OBJECT_PATH=\"$(BPF_OBJECT_DIR)\"
|
|
|
|
ifeq ($(DEBUG),1)
|
|
DEFINES += -DDEBUG
|
|
endif
|
|
|
|
HAVE_FEATURES :=
|
|
|
|
CFLAGS += $(DEFINES)
|
|
BPF_CFLAGS += $(DEFINES)
|
|
|
|
CONFIGMK := $(LIB_DIR)/../config.mk
|
|
LIBMK := Makefile $(CONFIGMK) $(LIB_DIR)/defines.mk $(LIB_DIR)/common.mk $(LIB_DIR)/util/util.mk
|
|
|