From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A06E8C433B4 for ; Fri, 9 Apr 2021 10:09:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77E2161182 for ; Fri, 9 Apr 2021 10:09:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234062AbhDIKJe (ORCPT ); Fri, 9 Apr 2021 06:09:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:46030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233741AbhDIKCD (ORCPT ); Fri, 9 Apr 2021 06:02:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E678B6120C; Fri, 9 Apr 2021 10:00:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617962402; bh=N8n3jcYHWyo1wp21uJxRgPbrFjs21WTUixqnVBSy01Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y3Z62XP0zPtQFvO6p4UeByqaTM8gYemtKPi3lkVVcANcazCdCY/Tz5qQmOPiYJV81 g6kvm/TVuGpv5g7Z91pNkN8RxAajppc37eYslNa1OWcKyGct/TQxIj8eEjCH396R3K LGnOeODQd92RjBoE5cBWElRpZrkdFdiKpPdkZEGk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiri Olsa , Andrii Nakryiko , Nathan Chancellor , Sasha Levin Subject: [PATCH 5.10 36/41] kbuild: Do not clean resolve_btfids if the output does not exist Date: Fri, 9 Apr 2021 11:53:58 +0200 Message-Id: <20210409095305.973227790@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210409095304.818847860@linuxfoundation.org> References: <20210409095304.818847860@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Olsa [ 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 Signed-off-by: Andrii Nakryiko Tested-by: Nathan Chancellor Link: https://lore.kernel.org/bpf/20210211124004.1144344-1-jolsa@kernel.org Signed-off-by: Sasha Levin --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3a3937ab7ed0..4420131d4709 100644 --- a/Makefile +++ b/Makefile @@ -1085,8 +1085,14 @@ endif PHONY += resolve_btfids_clean +resolve_btfids_O = $(abspath $(objtree))/tools/bpf/resolve_btfids + +# tools/bpf/resolve_btfids directory might not exist +# in output directory, skip its clean in that case resolve_btfids_clean: - $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(abspath $(objtree))/tools/bpf/resolve_btfids clean +ifneq ($(wildcard $(resolve_btfids_O)),) + $(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean +endif ifdef CONFIG_BPF ifdef CONFIG_DEBUG_INFO_BTF -- 2.30.2