From patchwork Sat Apr 6 17:03:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 88129 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 64EA63858283 for ; Sat, 6 Apr 2024 17:04:04 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.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 203513858C60 for ; Sat, 6 Apr 2024 17:03:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 203513858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 203513858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712423011; cv=none; b=MHD/mus/3BZMuWMoyptaCNqD+uS7Bqbi3DcqbN2kfxvOhPuoP5VPuDwlov9CA0ZbRkH6Y9OJg2qCDELheZAq8gr7AMVLROVHTc3awWwDgb8BXhU7EMMUCWI5q8KXeTv1/QUBuInfwzcZFeDOI+Zf2YausmQrMZ1JWkfzSUVGCnk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712423011; c=relaxed/simple; bh=X/jgVdQSi3IttcNtCB7JvzBTiOEI4gS1Qj7ZTGnhVRo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=KbKfC+AePxkA4ID3kCEDq8t1mmi20+y7MqQTxgEMPO3qyAAJWWSW5q+AGDtWZW3zxrX4E+LoF02wsF44ecfHQsC6zkg/nkDZMUMdcv9ctPquSA4BGjst5UJ4kUzPVPRgUw5z7IrlmUT7YIEYJxASIRLlSN9o0+Az6aN5PSpVJd8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712423006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jXUZhxtMpLmldkBXBladnvQAfpr4TalZ+O3CYtiY58g=; b=YE/Rs83nmIyfOLWN9CmmhyHpuUf7K+nRTLCG0PcYsFmwsKb11xhDhTBz2kSrG26eOFgH0D 6TaQp2Vt7xh4/fiauDCAau/IMdDpSu3m0xcl/j18KP9POAxXe0EfvM2Zq7hpn5vT2I0Izl 4AGZKbQIWK/BcF2/1L+sXGt8V/qH15U= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-454-mGq3yES0Oa2GfJsckLkr7A-1; Sat, 06 Apr 2024 13:03:25 -0400 X-MC-Unique: mGq3yES0Oa2GfJsckLkr7A-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-516e86ccc45so111381e87.0 for ; Sat, 06 Apr 2024 10:03:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712423003; x=1713027803; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jXUZhxtMpLmldkBXBladnvQAfpr4TalZ+O3CYtiY58g=; b=hG9hPPAq8ryBWepCZG/hyKgr/i9yrfl/f691iMO7hl3j4EBYd95pI4xZxz5rDg2zuI 9fRJmMzPAsu760WcRNhBkPOxzfn1rHsvUANzfVOaYpjFI0q7gy3JRykyNcIUSYkAq9Mc l+GQggdC2QdqrJEk4sgkDCjR5WtYoY+7Jc9QcFywntIiCMREOP1UmpMJeJc3GxSgm9AR msov3qI4v1QyfG3qxyyVoWyDiJ43d42RW9OirP7MSVnzdo/oD2hgyJlsfOt4fLL95PGz dJx4pD0EOLaZdrLOozI7999cwf/aRmOnbVe68qWU0w4KRuZbFqyq87V7vriGbIlF74Fp REmg== X-Gm-Message-State: AOJu0YwWkW2sY4FLhvW861mFzl9We8c9FbGghT7S7ACr51kPq5YQ3xVw oW9xW90lsX/MN53zj0PWjyhgyJi8kkqe7iH9ajqNunna61HD5slyLm3+NtjJEl5rRx1nkxugf1P DgW7mQttuu/yTFwAp81bqZQZ8Qr9F0maiYbVFGcuwFfHrrwXVCREWXjU8EexEVnlr5I0BGSAcIN ZhVBRgNQSmb5T3O+SbxvmH9J0nzhNt+DoFxsxhPh0CDqY= X-Received: by 2002:a19:5e16:0:b0:516:d1f0:fbf7 with SMTP id s22-20020a195e16000000b00516d1f0fbf7mr3934805lfb.42.1712423003467; Sat, 06 Apr 2024 10:03:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdSf5X5beZPVonSIAtidZUU4lzeZV+oOGmF3G5k+qyTacSw8dp7fzgtVzFlGLYYHyB/Oo27Q== X-Received: by 2002:a19:5e16:0:b0:516:d1f0:fbf7 with SMTP id s22-20020a195e16000000b00516d1f0fbf7mr3934784lfb.42.1712423002816; Sat, 06 Apr 2024 10:03:22 -0700 (PDT) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id he41-20020a1709073da900b00a5195ee5d62sm2151117ejc.164.2024.04.06.10.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 10:03:21 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 2/6] gdb/Makefile: rewrite dependencies for config.status target Date: Sat, 6 Apr 2024 18:03:11 +0100 Message-Id: <20e8e8749d8119823ce18d23dffd2e47f9ad5791.1712422921.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org I noticed something weird, the rule for the config.status target looks like this: config.status: $(srcdir)/configure configure.nat configure.tgt configure.host ../bfd/development.sh $(SHELL) config.status --recheck What bothered me is that 'configure' is specified as being in $(srcdir), while all of the other files are not, even though those files are in the same $(srcdir) as the configure script. However, I tried touching one of those files, and the config.status rule does trigger! This is thanks to the VPATH variable, which is set to $(srcdir), so make looks in $(srcdir) for any dependencies. However, this inconsistency bothers me. Better, I think, to add the $(srcdir) prefix to each of these files. I also spotted that the configure script also includes the files ../bfd/config.bfd, yet that is missing from the include list, so in this commit I plan to add this as a dependency. The configure script also pulls in two TCL and TK related files: . ${TCL_BIN_DIR}/tclConfig.sh . ${TK_BIN_DIR}/tkConfig.sh However, I don't think ${TCL_BIN_DIR} and ${TK_BIN_DIR} are currently visible in GDB's Makefile, so I'm not planning to add these dependencies at this time. In this commit I add a new variable config_status_deps which holds the list of all the dependencies for config.status, with the $(srcdir) prefix included, and then I use this in the config.status rule. After this commit config.status will regenerate if config.bfd changes, which it wouldn't before, but nothing else changes. --- gdb/Makefile.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/Makefile.in b/gdb/Makefile.in index df044288b5e..9340becbdc9 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -2333,7 +2333,18 @@ nm.h: stamp-nmh ; @true stamp-nmh: config.status $(SHELL) config.status nm.h -config.status: $(srcdir)/configure configure.nat configure.tgt configure.host ../bfd/development.sh +# Files included from config.status or the configure script. When +# these change the configure script doesn't need regenerating, but its +# output (and so that of config.status) might change. +config_status_deps = \ + $(srcdir)/configure \ + $(srcdir)/configure.nat \ + $(srcdir)/configure.tgt \ + $(srcdir)/configure.host \ + $(srcdir)/../bfd/development.sh \ + $(srcdir)/../bfd/config.bfd + +config.status: $(config_status_deps) $(SHELL) config.status --recheck ACLOCAL = aclocal