1 diff --git a/Makefile b/Makefile
2 index 29be1ae71..b88f31cba 100644
5 @@ -54,6 +54,7 @@ CMD_CONTROLLER_GEN ?= controller-gen
13 @@ -299,8 +300,6 @@ OUTPUT_DIR = ./dist
17 - $(CMD_MKDIR) -p $@/libbpf
18 - $(CMD_MKDIR) -p $@/libbpf/obj
22 @@ -353,7 +352,6 @@ TRACEE_EBPF_OBJ_HEADERS = $(shell find pkg/ebpf/c -name *.h)
23 bpf: $(OUTPUT_DIR)/tracee.bpf.o
25 $(OUTPUT_DIR)/tracee.bpf.o: \
26 - $(OUTPUT_DIR)/libbpf/libbpf.a \
27 $(TRACEE_EBPF_OBJ_SRC) \
28 $(TRACEE_EBPF_OBJ_HEADERS)
30 @@ -391,8 +389,8 @@ endif
31 TRACEE_SRC_DIRS = ./cmd/ ./pkg/ ./signatures/
32 TRACEE_SRC = $(shell find $(TRACEE_SRC_DIRS) -type f -name '*.go' ! -name '*_test.go')
34 -CUSTOM_CGO_CFLAGS = "-I$(abspath $(OUTPUT_DIR)/libbpf)"
35 -CUSTOM_CGO_LDFLAGS = "$(shell $(call pkg_config, $(LIB_ELF))) $(shell $(call pkg_config, $(LIB_ZLIB))) $(abspath $(OUTPUT_DIR)/libbpf/libbpf.a)"
36 +CUSTOM_CGO_CFLAGS = ""
37 +CUSTOM_CGO_LDFLAGS = "$(shell $(call pkg_config, $(LIB_BPF))) $(shell $(call pkg_config, $(LIB_ELF))) $(shell $(call pkg_config, $(LIB_ZLIB)))"
40 GO_ENV_EBPF += GOOS=linux
41 @@ -437,6 +435,7 @@ $(OUTPUT_DIR)/tracee: \
42 $(OUTPUT_DIR)/tracee.bpf.o \
44 | .checkver_$(CMD_GO) \
45 + .checklib_$(LIB_BPF) \
46 .checklib_$(LIB_ELF) \
47 .checklib_$(LIB_ZLIB) \