Skip to contentSkip to conversation

bpf: fix bad include in libbpf when srctree is set

PATCH RESEND In review Alexander Alemayhu 2 participants 2 messages Jan 1, 2018 – Jan 4, 2018

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

PATCH RESEND 1/1 bpf: fix bad include in libbpf when srctree is set

The relative path can be wrong and prevents the build.

Makefile:57: ../../scripts/Makefile.include: No such file or directory
make: *** No rule to make target '../../scripts/Makefile.include'. Stop.

---
 tools/lib/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/Makefile +1 -1
index 4555304dc18e..0068829a56db 100644
@@ -54,7 +54,7 @@ man_dir_SQ = '$(subst ','\'',$(man_dir))'
 export man_dir man_dir_SQ INSTALL
 export DESTDIR DESTDIR_SQ
 
-include ../../scripts/Makefile.include
+include $(srctree)/tools/scripts/Makefile.include
 
 # copy a bit from Linux kbuild
 
Signature · 1 line
2.13.6
maintainer
#1 lore raw
Quoted 1 line · Alexander Alemayhu

The relative path can be wrong and prevents the build.

You mean if you move the files from tools/lib/bpf/ to a different location, and then specify srctree var pointing to a kernel tree?

I think this would also break various other assumptions inside the tools/lib/bpf/Makefile, e.g. the uapi header checks also depending on relative paths.

Quoted 22 lines

Makefile:57: ../../scripts/Makefile.include: No such file or directory
make: *** No rule to make target '../../scripts/Makefile.include'. Stop.

---
 tools/lib/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/Makefile +1 -1
index 4555304dc18e..0068829a56db 100644
@@ -54,7 +54,7 @@ man_dir_SQ = '$(subst ','\'',$(man_dir))'
 export man_dir man_dir_SQ INSTALL
 export DESTDIR DESTDIR_SQ
 
-include ../../scripts/Makefile.include
+include $(srctree)/tools/scripts/Makefile.include
 
 # copy a bit from Linux kbuild