From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 5AE543858C32; Mon, 8 Apr 2024 09:27:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5AE543858C32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712568424; bh=ItgbLBiHrn+7gR7K+EoXrczsO3xVpUWwa4Wf1R2Pc7E=; h=From:To:Subject:Date:From; b=QYZv3kunMGm6NWdytPPwmXCM8xA46c+4XNwsXfcC3OHgpMP6LRvK6uEN/AsqLoZDr SqxO3geURgg6kz7tcmQFJ5WZIWuBPYIMRDrrG/3+XLy8goiWV6XBGzPEvLoAlzGX4I IoCIQuGxbQqHWTAxdEPvl5pz4tAtTB0DpiLcSUFo= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/Makefile: rewrite dependencies for config.status target X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: cc7ae3ac7e7e07b3fb8e6050bd728b466e6410e4 X-Git-Newrev: 766f411f084bd6c9a224300bf946a1bfd583ab5f Message-Id: <20240408092704.5AE543858C32@sourceware.org> Date: Mon, 8 Apr 2024 09:27:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D766f411f084b= d6c9a224300bf946a1bfd583ab5f commit 766f411f084bd6c9a224300bf946a1bfd583ab5f Author: Andrew Burgess Date: Fri Apr 5 10:50:27 2024 +0100 gdb/Makefile: rewrite dependencies for config.status target =20 I noticed something weird, the rule for the config.status target looks like this: =20 config.status: $(srcdir)/configure configure.nat configure.tgt config= ure.host ../bfd/development.sh $(SHELL) config.status --recheck =20 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. =20 However, I tried touching one of those files, and the config.status rule does trigger! =20 This is thanks to the VPATH variable, which is set to $(srcdir), so make looks in $(srcdir) for any dependencies. =20 However, this inconsistency bothers me. Better, I think, to add the $(srcdir) prefix to each of these files. =20 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. =20 The configure script also pulls in two TCL and TK related files: =20 . ${TCL_BIN_DIR}/tclConfig.sh . ${TK_BIN_DIR}/tkConfig.sh =20 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. =20 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. =20 After this commit config.status will regenerate if config.bfd changes, which it wouldn't before, but nothing else changes. =20 Approved-By: Simon Marchi Diff: --- 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 =20 -config.status: $(srcdir)/configure configure.nat configure.tgt configure.h= ost ../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 =3D \ + $(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 =20 ACLOCAL =3D aclocal