From patchwork Thu Mar 30 12:15:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 77160 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1080639vqo; Thu, 30 Mar 2023 05:16:42 -0700 (PDT) X-Google-Smtp-Source: AKy350b1FlDig7Mzf61Q1aGHzPQzuj6BtgipuetaK0VdMKpzAGGbxh4OxCqUD4HaargYQHryi2zy X-Received: by 2002:a17:906:f212:b0:8f6:dc49:337f with SMTP id gt18-20020a170906f21200b008f6dc49337fmr22219407ejb.43.1680178602454; Thu, 30 Mar 2023 05:16:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680178602; cv=none; d=google.com; s=arc-20160816; b=bt7o6hPvvSgYSt/gASQtGJrqQXZX8Ny1502dRdaMgsdaLv8xq7iHk1Fwj9iFZA2Ril 0/Dov13AO/Whq18Rx4Vr7DrFBjrRHzYN4x3BBN5BVTmP7ICiTLC8T7dj0S51uK1OX3Ym 1lX8WO6L83Ek2ern1QxgWAurJMGr9HMKuczkgjA5tDaijW8UKYal6rMMxXiqk0MI730q QDhCHnEJr/XlfudhALEVCeb44YB5R10bc1O2pAnEGYd8fmIAWW3JVeFxTPcTxOX9EelW 66hVowrzJyaatVV31efVID9fGzgGBam1zo5TAOzCcYeiq/bZOrrLzdiSJOmxp1PK8ePC viJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=3ey6KZEelV1mnDUD3XapetPVmMXtilUk0nsbeNlPn0Y=; b=e8ApP1h2Pfm1SdcyaLt2n0ofmfpiMHF3IEQe3++tZrBZSZwA9h7r0NttVdHID633SO qWjXgLrL3XeqvaY+Cq/ZCRDWXsXMlIQYelkhTysWznhufQCjPHbqZKLtQtr/7ZLmbjvx HuWDRJ2/JfA6ps5f/ANL0GNnQXuEixkkSkzElBBGeBd3mJVXGDMzIiumMJqMIg+ZVqo8 0Y7XgaLPhjnAZA0PnRlafUVaHTbuncYCs1AvOUKHc7wKRkXOTT+eMiJSjHzWYZP5rbQQ bSUISqzX1BXINytOTZDytH51TPyuc9v/FeV4GX23BrWTtOjbfxE/bLTXYjETo+nYOkSG qOsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=CarKEKYk; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id i24-20020aa7dd18000000b004acb2c92ba6si38314781edv.79.2023.03.30.05.16.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 05:16:42 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=CarKEKYk; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BCA2D385B527 for ; Thu, 30 Mar 2023 12:16:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BCA2D385B527 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680178596; bh=3ey6KZEelV1mnDUD3XapetPVmMXtilUk0nsbeNlPn0Y=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=CarKEKYkgSE1lOd/e3xg/3lSJYdgELTyIp0sRlumLxAeSAuEhJsKwiy3KfLS57Vri 3sWW+l4Hz5Ij2lAtKmeF4JAW3CK1QVh6bB3/DGkJXrH3WTar2UCiHQf8juCEby0E3R 6fHSM1hO/12tA1JMXgDgPyVDyadp6lQ2sUlRB9Rg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 483913858CDA for ; Thu, 30 Mar 2023 12:15:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 483913858CDA Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-56-xI66-v0ZMdOcl7KJcoBT8w-1; Thu, 30 Mar 2023 08:15:47 -0400 X-MC-Unique: xI66-v0ZMdOcl7KJcoBT8w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6732D884EC1; Thu, 30 Mar 2023 12:15:47 +0000 (UTC) Received: from localhost (unknown [10.33.36.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 223FC1121330; Thu, 30 Mar 2023 12:15:47 +0000 (UTC) To: gcc-patches@gcc.gnu.org Cc: Jason Merrill , Alexandre Oliva , Segher Boessenkool Subject: [PATCH] c++tools: Fix Makefile to properly clean and rebuild [PR101834] Date: Thu, 30 Mar 2023 13:15:46 +0100 Message-Id: <20230330121546.1454231-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761794957962914420?= X-GMAIL-MSGID: =?utf-8?q?1761794957962914420?= Tested with various combinations of 'make clean all' etc. OK for trunk? And backport to gcc-12 and gcc-11 after some soak time on trunk? -- >8 -- The c++tools makefile doesn't remove progressively more files in each of mostlyclean, clean, and distclean. Instead, each removes a different set of files (and some files are not removed by any target). Use prerequisites so that everything is removed. Also, building in the $objdir/c++tools directory doesn't work, because the INSTALL variable is never set. It works when building from the top-level because INSTALL is set in the environment when recursively invoking make for sub-directories. c++tools/ChangeLog: PR bootstrap/101834 * Makefile.in (INSTALL): Set variable. (mostlyclean): Mark as a phony target. (clean): Add mostlyclean as a prerequisite. (distclean): Add clean as a prerequisite and remove more files. (maintainer-clean): Add distclean as a prerequisite. --- c++tools/Makefile.in | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/c++tools/Makefile.in b/c++tools/Makefile.in index 56cba090135..77bda3d56dc 100644 --- a/c++tools/Makefile.in +++ b/c++tools/Makefile.in @@ -22,6 +22,7 @@ libexecdir := @libexecdir@ target_noncanonical := @target_noncanonical@ gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER) libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) +INSTALL := @INSTALL@ INSTALL_PROGRAM := @INSTALL_PROGRAM@ INSTALL_STRIP_PROGRAM := $(srcdir)/../install-sh -c -s AUTOCONF := @AUTOCONF@ @@ -41,13 +42,14 @@ all:: mostlyclean:: rm -f $(MAPPER.O) -clean:: +clean:: mostlyclean rm -f g++-mapper-server$(exeext) -distclean:: - rm -f config.log config.status config.h +distclean:: clean + rm -f config.log config.status config.h config.cache Makefile + rm -f $(MAPPER.O:%.o=%.d) -maintainer-clean:: +maintainer-clean:: distclean install:: @@ -132,6 +134,6 @@ config.h: config.status config.h.in config.status: $(srcdir)/configure $(srcdir)/config.h.in if test -x $@; then ./$@ -recheck; else $< @configure_args@; fi -.PHONY: all check clean distclean maintainer-clean +.PHONY: all check mostlyclean clean distclean maintainer-clean -include $(MAPPER.O:.o=.d)