]> git.baikalelectronics.ru Git - kernel.git/commit
tools, bpf: Fix build for 'make -s tools/bpf O=<dir>'
authorQuentin Monnet <quentin.monnet@netronome.com>
Tue, 19 Nov 2019 10:56:26 +0000 (10:56 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 25 Nov 2019 00:58:45 +0000 (16:58 -0800)
commit49735f36c448095d3cb4d0a7f0ffad87297dacf3
tree3ce36bc3f89b98f8b62709d5b3df099db7d71850
parent60d01b64d917e0cc69f819bc2dc3e3781e09e29c
tools, bpf: Fix build for 'make -s tools/bpf O=<dir>'

Building selftests with 'make TARGETS=bpf kselftest' was fixed in commit
766d51691095 ("tools: bpf: Use !building_out_of_srctree to determine
srctree"). However, by updating $(srctree) in tools/bpf/Makefile for
in-tree builds only, we leave out the case where we pass an output
directory to build BPF tools, but $(srctree) is not set. This
typically happens for:

    $ make -s tools/bpf O=/tmp/foo
    Makefile:40: /tools/build/Makefile.feature: No such file or directory

Fix it by updating $(srctree) in the Makefile not only for out-of-tree
builds, but also if $(srctree) is empty.

Detected with test_bpftool_build.sh.

Fixes: 766d51691095 ("tools: bpf: Use !building_out_of_srctree to determine srctree")
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Link: https://lore.kernel.org/bpf/20191119105626.21453-1-quentin.monnet@netronome.com
tools/bpf/Makefile