2022-10-30 15:09:59 +00:00
|
|
|
diff --git a/Makefile b/Makefile
|
2023-04-12 12:48:02 +00:00
|
|
|
index d7596a1a..dd7b97b6 100644
|
2022-10-30 15:09:59 +00:00
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
|
|
|
@@ -50,6 +50,7 @@ CMD_STATICCHECK ?= staticcheck
|
|
|
|
# libs
|
|
|
|
#
|
|
|
|
|
|
|
|
+LIB_BPF ?= libbpf
|
|
|
|
LIB_ELF ?= libelf
|
|
|
|
LIB_ZLIB ?= zlib
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
@@ -279,8 +280,6 @@ OUTPUT_DIR = ./dist
|
2022-10-30 15:09:59 +00:00
|
|
|
$(OUTPUT_DIR):
|
|
|
|
#
|
|
|
|
@$(CMD_MKDIR) -p $@
|
|
|
|
- @$(CMD_MKDIR) -p $@/libbpf
|
|
|
|
- @$(CMD_MKDIR) -p $@/libbpf/obj
|
|
|
|
|
|
|
|
#
|
|
|
|
# embedded btfhub
|
2023-04-12 12:48:02 +00:00
|
|
|
@@ -418,7 +417,6 @@ TRACEE_EBPF_OBJ_CORE_HEADERS = $(shell find pkg/ebpf/c -name *.h)
|
2022-10-30 15:09:59 +00:00
|
|
|
bpf-core: $(OUTPUT_DIR)/tracee.bpf.core.o
|
|
|
|
|
|
|
|
$(OUTPUT_DIR)/tracee.bpf.core.o: \
|
|
|
|
- $(OUTPUT_DIR)/libbpf/libbpf.a \
|
|
|
|
$(TRACEE_EBPF_OBJ_SRC) \
|
|
|
|
$(TRACEE_EBPF_OBJ_CORE_HEADERS)
|
|
|
|
#
|
2023-04-12 12:48:02 +00:00
|
|
|
@@ -453,8 +451,8 @@ ifeq ($(STATIC), 1)
|
2022-10-30 15:09:59 +00:00
|
|
|
GO_TAGS_EBPF := $(GO_TAGS_EBPF),netgo
|
|
|
|
endif
|
|
|
|
|
|
|
|
-CUSTOM_CGO_CFLAGS = "-I$(abspath $(OUTPUT_DIR)/libbpf)"
|
|
|
|
-CUSTOM_CGO_LDFLAGS = "$(shell $(call pkg_config, $(LIB_ELF))) $(shell $(call pkg_config, $(LIB_ZLIB))) $(abspath $(OUTPUT_DIR)/libbpf/libbpf.a)"
|
|
|
|
+CUSTOM_CGO_CFLAGS = ""
|
|
|
|
+CUSTOM_CGO_LDFLAGS = "$(shell $(call pkg_config, $(LIB_BPF))) $(shell $(call pkg_config, $(LIB_ELF))) $(shell $(call pkg_config, $(LIB_ZLIB)))"
|
|
|
|
|
|
|
|
GO_ENV_EBPF =
|
|
|
|
GO_ENV_EBPF += GOOS=linux
|
2023-04-12 12:48:02 +00:00
|
|
|
@@ -474,6 +472,7 @@ $(OUTPUT_DIR)/tracee-ebpf: \
|
2022-10-30 15:09:59 +00:00
|
|
|
$(TRACEE_EBPF_SRC) \
|
|
|
|
./embedded-ebpf.go \
|
|
|
|
| .checkver_$(CMD_GO) \
|
|
|
|
+ .checklib_$(LIB_BPF) \
|
|
|
|
.checklib_$(LIB_ELF) \
|
|
|
|
.checklib_$(LIB_ZLIB) \
|
|
|
|
btfhub
|