ci: cover all libbpf Makefile tutorials (#213)

* ci: cover all libbpf Makefile tutorials

* ci: build modules against HWE headers

---------

Co-authored-by: LinuxDev9002 <i@littlefisher.me>
This commit is contained in:
云微
2026-07-14 05:25:47 -07:00
committed by GitHub
parent 37375ff87e
commit b1d81046d7
16 changed files with 104 additions and 39 deletions

View File

@@ -2,10 +2,11 @@ obj-m += hello.o # hello.o is the target
# Enable BTF generation
KBUILD_CFLAGS += -g -O2
KDIR ?= /lib/modules/$(shell uname -r)/build
all:
# Compile the module with BTF information
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
+$(MAKE) -C $(KDIR) M=$(CURDIR) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
+$(MAKE) -C $(KDIR) M=$(CURDIR) clean