[PATCH v2] bpftool: Set srctree correctly when not building out of source tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Without this change, building bpftool via "make -C tools/bpf/bpftool"
fails with the following error:

"""
+ make ARCH=x86 -C tools/bpf/bpftool bootstrap
Makefile:127: tools/build/Makefile.feature: No such file or directory
make[3]: *** No rule to make target 'tools/build/Makefile.feature'.  Stop.
error: Bad exit status from /var/tmp/rpm-tmp.3p0IcJ (%build)
"""

This is the same workaround that is also applied in tools/bpf/Makefile.
---
 tools/bpf/bpftool/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index ba927379eb20..7c7d731077c9 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -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)))
-- 
2.47.0





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux