2022-10-30 15:09:59 +00:00
|
|
|
diff --git a/Makefile b/Makefile
|
2024-04-21 15:54:59 +00:00
|
|
|
index 29be1ae71..b88f31cba 100644
|
2022-10-30 15:09:59 +00:00
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
2024-04-21 15:54:59 +00:00
|
|
|
@@ -54,6 +54,7 @@ CMD_CONTROLLER_GEN ?= controller-gen
|
2022-10-30 15:09:59 +00:00
|
|
|
# libs
|
|
|
|
#
|
|
|
|
|
|
|
|
+LIB_BPF ?= libbpf
|
|
|
|
LIB_ELF ?= libelf
|
|
|
|
LIB_ZLIB ?= zlib
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
@@ -299,8 +300,6 @@ OUTPUT_DIR = ./dist
|
2022-10-30 15:09:59 +00:00
|
|
|
$(OUTPUT_DIR):
|
|
|
|
#
|
|
|
|
@$(CMD_MKDIR) -p $@
|
2024-04-21 15:54:59 +00:00
|
|
|
- $(CMD_MKDIR) -p $@/libbpf
|
|
|
|
- $(CMD_MKDIR) -p $@/libbpf/obj
|
2022-10-30 15:09:59 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# embedded btfhub
|
2024-04-21 15:54:59 +00:00
|
|
|
@@ -353,7 +352,6 @@ TRACEE_EBPF_OBJ_HEADERS = $(shell find pkg/ebpf/c -name *.h)
|
|
|
|
bpf: $(OUTPUT_DIR)/tracee.bpf.o
|
2022-10-30 15:09:59 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
$(OUTPUT_DIR)/tracee.bpf.o: \
|
2022-10-30 15:09:59 +00:00
|
|
|
- $(OUTPUT_DIR)/libbpf/libbpf.a \
|
|
|
|
$(TRACEE_EBPF_OBJ_SRC) \
|
2024-04-21 15:54:59 +00:00
|
|
|
$(TRACEE_EBPF_OBJ_HEADERS)
|
2022-10-30 15:09:59 +00:00
|
|
|
#
|
2024-04-21 15:54:59 +00:00
|
|
|
@@ -391,8 +389,8 @@ endif
|
|
|
|
TRACEE_SRC_DIRS = ./cmd/ ./pkg/ ./signatures/
|
|
|
|
TRACEE_SRC = $(shell find $(TRACEE_SRC_DIRS) -type f -name '*.go' ! -name '*_test.go')
|
2022-10-30 15:09:59 +00:00
|
|
|
|
|
|
|
-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
|
2024-04-21 15:54:59 +00:00
|
|
|
@@ -437,6 +435,7 @@ $(OUTPUT_DIR)/tracee: \
|
|
|
|
$(OUTPUT_DIR)/tracee.bpf.o \
|
|
|
|
$(TRACEE_SRC) \
|
2022-10-30 15:09:59 +00:00
|
|
|
| .checkver_$(CMD_GO) \
|
|
|
|
+ .checklib_$(LIB_BPF) \
|
|
|
|
.checklib_$(LIB_ELF) \
|
|
|
|
.checklib_$(LIB_ZLIB) \
|
2024-04-21 15:54:59 +00:00
|
|
|
btfhub \
|