Files
Toke Høiland-Jørgensen 173c2d943e lib/defines.mk: Don't always set -DDEBUG
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>
2023-03-16 23:55:52 +01:00

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