From patchwork Thu Jun 15 15:25:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Kuvyrkov X-Patchwork-Id: 1795494 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=tIt06XFY; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QhmNN2bcDz20QH for ; Fri, 16 Jun 2023 01:26:26 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E32E13857031 for ; Thu, 15 Jun 2023 15:26:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E32E13857031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686842783; bh=bMNdQsLKdhBHVUPnFGHiQLPn+boeeyGjcdyfrrrURP4=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=tIt06XFYM7944eql1Gzyd0Is2SDXHVICM8Z/+is0uSL3ubWwociIBzlYFUIVQM+xR djvGUYGywvurRZoypVw/6hD1rCnxQZ4pWjhHUj0Qt9IORS783vgxgPDmMYnWvoh/jh FnpS0HQUThYI11rwrgZ7mYzUB8IQIJWGgqdJ9t3E= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id BD0923857BA4 for ; Thu, 15 Jun 2023 15:26:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD0923857BA4 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2b34e0b89f8so4639801fa.0 for ; Thu, 15 Jun 2023 08:26:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686842762; x=1689434762; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bMNdQsLKdhBHVUPnFGHiQLPn+boeeyGjcdyfrrrURP4=; b=HTu2c5c6JdOZduh/Dl8DfxsWSAC9tcqquntBy7y7Zcr7LcKqcjuwCZDMuooN2DiZQ/ kFl7c3z462wLA3wWNO86dyx+lHXczO13DjNQ86a5oZukrrlp9v/84q/gdptaeBoR/81G 42LEC6d+3eaeqeR0BCExTkNlRAbYQD/UcM/Dk9k589EjBxGB6l4F6ixjFzYMnlIMH3rW BCRrY8Mp41/sSE3SN0eIuAzIU712SgcznBYBBAwJwEQKRK9TYwhj7zNa55o+vqN/Bfm2 AtGJKbE2ASLBSK+X7ne9ELpPjKPnQTdZJkrP7vF15z6swYSzLl5y5DbzGaUFu6Y6FYbK hvfw== X-Gm-Message-State: AC+VfDz1ahYFC7SqwwSAYQ/ooczJD98tckrhF6ZLzJx6cBl1HQLZNIWi hHr60Y2dOjO9oyaj+Ce80h3sr/5BRvhIciQWGQ== X-Google-Smtp-Source: ACHHUZ45ZW2CJS8fepiETXzOfe2KDJzVOIIBnFJZKo9wJ3VGZhz4DukZJEhZyqdpiFxmzg9IPzSeOw== X-Received: by 2002:a2e:b90a:0:b0:2b1:d72b:162a with SMTP id b10-20020a2eb90a000000b002b1d72b162amr10629667ljb.3.1686842762381; Thu, 15 Jun 2023 08:26:02 -0700 (PDT) Received: from localhost.localdomain (static.225.72.216.95.clients.your-server.de. [95.216.72.225]) by smtp.gmail.com with ESMTPSA id j3-20020a2e8503000000b002a8c1462ecbsm3139293lji.137.2023.06.15.08.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jun 2023 08:26:01 -0700 (PDT) To: libc-alpha@sourceware.org Cc: Carlos O'Donell , Maxim Kuvyrkov Subject: [PATCH] Fix tests-clean Makefile target (bug 30545) Date: Thu, 15 Jun 2023 15:25:47 +0000 Message-Id: <20230615152547.2924770-1-maxim.kuvyrkov@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Maxim Kuvyrkov via Libc-alpha From: Maxim Kuvyrkov Reply-To: Maxim Kuvyrkov Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" This patch improves tests-clean Makefile target to reliably clean test artifacts from a build directory. Before this patch tests-clean missed around 3k (out of total 9k) .out and .test-result files. Signed-off-by: Maxim Kuvyrkov Reviewed-by: Adhemerval Zanella Reviewed-by: Carlos O'Donell --- Makefile | 5 ++++- Makerules | 23 +++++------------------ 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 523efd42c1..f324df7a1f 100644 --- a/Makefile +++ b/Makefile @@ -518,7 +518,10 @@ mostlyclean: parent-mostlyclean @$(MAKE) subdir_mostlyclean no_deps=t -rm -f $(postclean) -tests-clean: +# Remove test artifacts from the whole glibc build. +# do-tests-clean removes test artifacts from top-level directory, and +# subdir_testclean removes them from individual sub-directories. +tests-clean: do-tests-clean @$(MAKE) subdir_testclean no_deps=t ifneq (,$(CXX)) diff --git a/Makerules b/Makerules index 2ccf26d320..018780c818 100644 --- a/Makerules +++ b/Makerules @@ -1334,18 +1334,13 @@ echo-headers: clean: common-clean mostlyclean: common-mostlyclean +# Remove test artifacts from a given directory do-tests-clean: - -rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) \ - $(tests-internal) \ - $(xtests) \ - $(test-srcs)) \ - $(addsuffix .test-result,$(tests) \ - $(tests-internal) \ - $(xtests) \ - $(test-srcs))) + -find $(objpfx) -name '*.out' -delete + -find $(objpfx) -name '*.test-result' -delete # Remove the object files. -common-mostlyclean: +common-mostlyclean: do-tests-clean -rm -f $(addprefix $(objpfx),$(tests) $(tests-internal) $(xtests) \ $(test-srcs) \ $(others) $(sysdep-others) stubs \ @@ -1354,15 +1349,7 @@ common-mostlyclean: $(xtests) \ $(test-srcs) \ $(others) \ - $(sysdep-others)) \ - $(addsuffix .out,$(tests) \ - $(tests-internal) \ - $(xtests) \ - $(test-srcs)) \ - $(addsuffix .test-result,$(tests) \ - $(tests-internal) \ - $(xtests) \ - $(test-srcs))) + $(sysdep-others))) -rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \ $(install-lib) $(install-lib.so) \ $(install-lib.so:%.so=%_pic.a))