kbuild: Do not clean resolve_btfids if the output does not exist
authorJiri Olsa <jolsa@kernel.org>
Thu, 11 Feb 2021 12:40:04 +0000 (13:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Apr 2021 11:36:10 +0000 (13:36 +0200)
commit76983e24490855aa3bfa0a5dfdb74995d5628b73
treeaa335877cf2c886fc663be8137b7471450e2508c
parent0945d67e5d43be9b1b130d8893dce4f2a8f589dd
kbuild: Do not clean resolve_btfids if the output does not exist

[ Upstream commit 0e1aa629f1ce9e8cb89e0cefb9e3bfb3dfa94821 ]

Nathan reported issue with cleaning empty build directory:

  $ make -s O=build distclean
  ../../scripts/Makefile.include:4: *** \
  O=/ho...build/tools/bpf/resolve_btfids does not exist.  Stop.

The problem that tools scripts require existing output
directory, otherwise it fails.

Adding check around the resolve_btfids clean target to
ensure the output directory is in place.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/bpf/20210211124004.1144344-1-jolsa@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Makefile