Skip to contentSkip to conversation

tools/bpftool: support passing BPFTOOL_VERSION to make

PATCH Applied Tony Ambardar 4 participants 5 messages Sep 17, 2020 – Sep 18, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/bpftool: support passing BPFTOOL_VERSION to make

This change facilitates out-of-tree builds, packaging, and versioning for test and debug purposes. Defining BPFTOOL_VERSION allows self-contained builds within the tools tree, since it avoids use of the 'kernelversion' target in the top-level makefile, which would otherwise pull in several other includes from outside the tools tree.

---
 tools/bpf/bpftool/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/Makefile +1 -1
index 8462690a039b..4828913703b6 100644
@@ -25,7 +25,7 @@ endif
 
 LIBBPF = $(LIBBPF_PATH)libbpf.a
 
-BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../.. kernelversion)
+BPFTOOL_VERSION ?= $(shell make -rR --no-print-directory -sC ../../.. kernelversion)
 
 $(LIBBPF): FORCE
 	$(if $(LIBBPF_OUTPUT),@mkdir -p $(LIBBPF_OUTPUT))
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Tony Ambardar

This change facilitates out-of-tree builds, packaging, and versioning for test and debug purposes. Defining BPFTOOL_VERSION allows self-contained builds within the tools tree, since it avoids use of the 'kernelversion' target in the top-level makefile, which would otherwise pull in several other includes from outside the tools tree.

reviewer Acked-by
#2 lore raw
Quoted 11 lines · Quentin Monnet
Quoted 7 lines · Tony Ambardar

This change facilitates out-of-tree builds, packaging, and versioning for test and debug purposes. Defining BPFTOOL_VERSION allows self-contained builds within the tools tree, since it avoids use of the 'kernelversion' target in the top-level makefile, which would otherwise pull in several other includes from outside the tools tree.

#3 lore raw
Quoted 10 lines · Song Liu
Quoted 8 lines · Quentin Monnet
Quoted 6 lines · Tony Ambardar

This change facilitates out-of-tree builds, packaging, and versioning for test and debug purposes. Defining BPFTOOL_VERSION allows self-contained builds within the tools tree, since it avoids use of the 'kernelversion' target in the top-level makefile, which would otherwise pull in several other includes from outside the tools tree.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I should clarify for those performing stand-alone builds that a few items are still required from outside the tools/ tree:
kernel/bpf/disasm.[ch] and scripts/bpf_helpers_doc.py. Not sure that's worth updating the commit description however.

maintainer Applied
#4 lore raw
In reply to Tony Ambardar
Quoted 7 lines · Tony Ambardar

This change facilitates out-of-tree builds, packaging, and versioning for test and debug purposes. Defining BPFTOOL_VERSION allows self-contained builds within the tools tree, since it avoids use of the 'kernelversion' target in the top-level makefile, which would otherwise pull in several other includes from outside the tools tree.

Applied, thanks!