]> git.baikalelectronics.ru Git - kernel.git/commit
tools/bpftool: Force clean of out-of-tree build
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Tue, 10 Nov 2020 16:43:06 +0000 (17:43 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 11 Nov 2020 20:18:22 +0000 (12:18 -0800)
commit26223ba71947ac5681c78dd9baff5bd1d0c786a8
tree95bd06ea2f8e637eac88396cc09bc8b95d0dc6b4
parentdf0b526fe59f67103d907ca578151a40f65c589c
tools/bpftool: Force clean of out-of-tree build

Cleaning a partial build can fail if the output directory for libbpf
wasn't created:

$ make -C tools/bpf/bpftool O=/tmp/bpf clean
/bin/sh: line 0: cd: /tmp/bpf/libbpf/: No such file or directory
tools/scripts/Makefile.include:17: *** output directory "/tmp/bpf/libbpf/" does not exist.  Stop.
make: *** [Makefile:36: /tmp/bpf/libbpf/libbpf.a-clean] Error 2

As a result make never gets around to clearing the leftover objects. Add
the libbpf output directory as clean dependency to ensure clean always
succeeds (similarly to the "descend" macro). The directory is later
removed by the clean recipe.

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20201110164310.2600671-3-jean-philippe@linaro.org
tools/bpf/bpftool/Makefile