Skip to contentSkip to conversation

bpftool: Set srctree correctly when not building out of source tree

PATCH Superseded Daan De Meyer 2 participants 2 messages Nov 10, 2024 – Nov 11, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpftool: Set srctree correctly when not building out of source tree

This allows building bpftool directly via "make -C tools/bpf/bpftool".

---
 tools/bpf/bpftool/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)
tools/bpf/bpftool/Makefile +6 -0
index ba927379eb20..7c7d731077c9 100644
@@ -2,6 +2,12 @@
 include ../../scripts/Makefile.include
 
 ifeq ($(srctree),)
+update_srctree := 1
+endif
+ifndef building_out_of_srctree
+update_srctree := 1
+endif
+ifeq ($(update_srctree),1)
 srctree := $(patsubst %/,%,$(dir $(CURDIR)))
 srctree := $(patsubst %/,%,$(dir $(srctree)))
 srctree := $(patsubst %/,%,$(dir $(srctree)))
Signature · 1 line
2.47.0
#1 lore raw

2024-11-10 19:44 UTC+0100 ~ Daan De Meyer <[email protected]>

Quoted 12 lines

This allows building bpftool directly via "make -C tools/bpf/bpftool".

---
 tools/bpf/bpftool/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)
tools/bpf/bpftool/Makefile +0 -0
index ba927379eb20..7c7d731077c9 100644
@@ -2,6 +2,12 @@
 include ../../scripts/Makefile.include
 

tools/bpf/bpftool/Makefile line 13

Quoted 10 lines
tools/bpf/bpftool/Makefile +6 -0
 ifeq ($(srctree),)
+update_srctree := 1
+endif
+ifndef building_out_of_srctree
+update_srctree := 1
+endif
+ifeq ($(update_srctree),1)
 srctree := $(patsubst %/,%,$(dir $(CURDIR)))
 srctree := $(patsubst %/,%,$(dir $(srctree)))
 srctree := $(patsubst %/,%,$(dir $(srctree)))

Hi and thanks! Can you please provide more context on what the change is supposed to fix, please? "make -C tools/bpf/bpftool" should work already.

Please also sign-off your patches.

Thanks,
Quentin