2020-12-11 19:25:35 +01:00
|
|
|
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
|
|
|
|
|
|
2021-01-25 20:40:57 +01:00
|
|
|
USER_TARGETS := pping
|
|
|
|
|
TC_BPF_TARGETS := pping_kern_tc
|
|
|
|
|
BPF_TARGETS := pping_kern_xdp
|
|
|
|
|
BPF_TARGETS += $(TC_BPF_TARGETS)
|
2020-12-11 19:25:35 +01:00
|
|
|
|
2021-01-25 20:40:57 +01:00
|
|
|
LDFLAGS += -pthread
|
2021-01-26 18:34:23 +01:00
|
|
|
EXTRA_DEPS += config.mk pping.h pping_helpers.h
|
2021-01-07 18:14:27 +01:00
|
|
|
|
2020-12-11 19:25:35 +01:00
|
|
|
LIB_DIR = ../lib
|
|
|
|
|
|
|
|
|
|
include $(LIB_DIR)/common.mk
|
2021-01-25 20:40:57 +01:00
|
|
|
include config.mk
|
|
|
|
|
|
|
|
|
|
all: config.mk
|
|
|
|
|
|
|
|
|
|
config.mk: configure
|
|
|
|
|
@sh configure
|
|
|
|
|
|
|
|
|
|
ifndef HAVE_TC_LIBBPF
|
|
|
|
|
# If the iproute2 'tc' tool doesn't understand BTF debug info
|
|
|
|
|
# use llvm-strip to remove this debug info from object file
|
|
|
|
|
#
|
|
|
|
|
# *BUT* cannot strip everything as it removes ELF elems needed for
|
|
|
|
|
# creating maps
|
|
|
|
|
#
|
|
|
|
|
.PHONY: strip_tc_obj
|
|
|
|
|
strip_tc_obj: ${TC_BPF_TARGETS:=.o}
|
|
|
|
|
$(Q) echo "TC don't support libbpf - strip BTF info"
|
|
|
|
|
$(Q) llvm-strip --no-strip-all --remove-section .BTF $?
|
|
|
|
|
|
|
|
|
|
all: strip_tc_obj
|
|
|
|
|
endif
|