Skip to content

Commit 0c2552b

Browse files
Merge pull request #1327 from petterreinholdtsen/installed-kernel-headers
Changed how ebpf build find kernel headers from running to installed version.
2 parents 030b849 + 42119c5 commit 0c2552b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ebpf_prog/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
# On Debian based distros we need the following 2 directories.
44
# Otherwise, just use the kernel headers from the kernel sources.
55
#
6-
KERNEL_DIR ?= /lib/modules/$(shell uname -r)/source
7-
KERNEL_HEADERS ?= /usr/src/linux-headers-$(shell uname -r)/
6+
KERNEL_VER ?= $(shell ls -d /lib/modules/*/source | sort | tail -1 | cut -d/ -f4)
7+
KERNEL_DIR ?= /lib/modules/$(KERNEL_VER)/source
8+
KERNEL_HEADERS ?= /usr/src/linux-headers-$(KERNEL_VER)/
89
CC = clang
910
LLC ?= llc
1011
ARCH ?= $(shell uname -m)

0 commit comments

Comments
 (0)