bpf/preload: Clean up .gitignore and "clean-files" target
Subsystems (3)
PATCH v2 1/1 bpf/preload: Clean up .gitignore and "clean-files" target
kernel/bpf/preload/Makefile was recently updated to have it install libbpf's headers locally instead of pulling them from tools/lib/bpf. But two items still need to be addressed.
First, the local .gitignore file was not adjusted to ignore the files generated in the new kernel/bpf/preload/libbpf output directory.
Second, the "clean-files" target is now incorrect. The old artefacts names were not removed from the target, while the new ones were added incorrectly. This is because "clean-files" expects names relative to $(obj), but we passed the absolute path instead. This results in the output and header-destination directories for libbpf (and their contents) not being removed from kernel/bpf/preload on "make clean" from the root of the repository.
This commit fixes both issues. Note that $(userprogs) needs not be added to "clean-files", because the cleaning infrastructure already accounts for it.
Cleaning the files properly also prevents make from printing the following message, for builds coming after a "make clean":
"make[4]: Nothing to be done for 'install_headers'."
v2: Simplify the "clean-files" target.
--- kernel/bpf/preload/.gitignore | 4 +--- kernel/bpf/preload/Makefile | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-)
kernel/bpf/preload/.gitignore +1 -3
@@ -1,4 +1,2 @@ -/FEATURE-DUMP.libbpf -/bpf_helper_defs.h -/feature +/libbpf /bpf_preload_umd
kernel/bpf/preload/Makefile +1 -2
@@ -27,8 +27,7 @@ userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi \ userprogs := bpf_preload_umd -clean-files := $(userprogs) bpf_helper_defs.h FEATURE-DUMP.libbpf staticobjs/ feature/ -clean-files += $(LIBBPF_OUT) $(LIBBPF_DESTDIR) +clean-files := libbpf/ $(obj)/iterators/iterators.o: | libbpf_hdrs
Signature · 1 line
2.30.2
Andrii Nakryiko
AppliedQuoted 24 lines · Quentin Monnet
kernel/bpf/preload/Makefilewas recently updated to have it install libbpf's headers locally instead of pulling them fromtools/lib/bpf. But two items still need to be addressed.First, the local .gitignore file was not adjusted to ignore the files generated in the new
kernel/bpf/preload/libbpfoutput directory.Second, the "clean-files" target is now incorrect. The old artefacts names were not removed from the target, while the new ones were added incorrectly. This is because "clean-files" expects names relative to $(obj), but we passed the absolute path instead. This results in the output and header-destination directories for libbpf (and their contents) not being removed from
kernel/bpf/preloadon "make clean" from the root of the repository.This commit fixes both issues. Note that $(userprogs) needs not be added to "clean-files", because the cleaning infrastructure already accounts for it.
Cleaning the files properly also prevents make from printing the following message, for builds coming after a "make clean":
"make[4]: Nothing to be done for 'install_headers'."
Quoted 6 lines
v2: Simplify the "clean-files" target.
Fixes bf60791741d4 ("bpf: preload: Install libbpf headers when building")Signed-off-by Quentin Monnet <[email protected]>Acked-by John Fastabend <[email protected]>---
Applied to bpf-next, thanks.
Quoted 31 lines
kernel/bpf/preload/.gitignore | 4 +--- kernel/bpf/preload/Makefile | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-)kernel/bpf/preload/.gitignore +1
-3@@ -1,4 +1,2 @@ -/FEATURE-DUMP.libbpf -/bpf_helper_defs.h -/feature +/libbpf /bpf_preload_umdkernel/bpf/preload/Makefile +1
-3@@ -27,8 +27,7 @@ userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi \ userprogs := bpf_preload_umd -clean-files := $(userprogs) bpf_helper_defs.h FEATURE-DUMP.libbpf staticobjs/ feature/ -clean-files += $(LIBBPF_OUT) $(LIBBPF_DESTDIR) +clean-files := libbpf/ $(obj)/iterators/iterators.o: | libbpf_hdrs --2.30.2