From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 4/7] gdb, gdbserver: always use order-only prerequisites for generated files
Date: Mon, 31 Aug 2026 14:51:43 -0400 [thread overview]
Message-ID: <20260831185300.572297-5-simon.marchi@efficios.com> (raw)
In-Reply-To: <20260831185300.572297-1-simon.marchi@efficios.com>
Both gdb/Makefile.in and gdbserver/Makefile.in guard their use of
order-only prerequisites behind a check for the .VARIABLES variable,
falling back to a normal prerequisite when it is not defined:
# Ensure that generated files are created early. Use order-only
# dependencies if available. They require GNU make 3.80 or newer,
# and the .VARIABLES variable was introduced at the same time.
ifdef .VARIABLES
$(all_object_files): | $(generated_files)
else
$(all_object_files) : $(generated_files)
endif
Building GDB requires GNU make >= 3.82, as documented in gdb/NEWS and
(as of the previous patch) in gdb/README. On top of that,
gdb/Makefile.in already uses an order-only prerequisite unconditionally,
in the rule for compiling .c files in the top-level gdb directory:
%.o: %.c | $(CONFIG_DEP_SUBDIR)
Remove the conditional and trim the comment accordingly.
Change-Id: Ic5cca15f21dc1a4908f978c788f416780ea1b5cd
---
gdb/Makefile.in | 8 +-------
gdbserver/Makefile.in | 8 +-------
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 5741ee5e2e92..cdf73ec708e0 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2837,14 +2837,8 @@ all_object_files = gdb.o $(LIBGDB_OBS) gdbtk/generic/gdbtk-main.o
all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
$(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
-# Ensure that generated files are created early. Use order-only
-# dependencies if available. They require GNU make 3.80 or newer,
-# and the .VARIABLES variable was introduced at the same time.
-ifdef .VARIABLES
+# Ensure that generated files are created early.
$(all_object_files): | $(generated_files)
-else
-$(all_object_files) : $(generated_files)
-endif
# Dependencies.
-include $(all_deps_files)
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 3a3c8e62d14f..7c6ab64196e2 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -602,14 +602,8 @@ gdbreplay.o: gdbreplay.cc
# dependency tracking.
all_object_files = $(OBS) $(GDBREPLAY_OBS) $(IPA_OBJS)
-# Ensure that generated files are created early. Use order-only
-# dependencies if available. They require GNU make 3.80 or newer,
-# and the .VARIABLES variable was introduced at the same time.
-ifdef .VARIABLES
+# Ensure that generated files are created early.
$(all_object_files): | $(generated_files)
-else
-$(all_object_files) : $(generated_files)
-endif
# All the .deps files to include.
all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
--
2.55.0
next prev parent reply other threads:[~2026-08-31 18:54 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 18:51 [PATCH 0/7] Some Makefile cleanups Simon Marchi
2026-08-31 18:51 ` [PATCH 1/7] gdb: update README about the GNU make requirement Simon Marchi
2026-09-01 12:26 ` Eli Zaretskii
2026-09-01 13:36 ` Simon Marchi
2026-08-31 18:51 ` [PATCH 2/7] gdb, gdbserver: require gcc-style dependency generation, drop the depcomp fallback Simon Marchi
2026-09-01 16:32 ` Tom Tromey
2026-09-01 20:16 ` Simon Marchi
2026-09-02 7:37 ` Rainer Orth
2026-09-02 12:26 ` Simon Marchi
2026-08-31 18:51 ` [PATCH 3/7] gdbserver: fix missing dependency tracking for gdbreplay.o Simon Marchi
2026-09-01 16:33 ` Tom Tromey
2026-08-31 18:51 ` Simon Marchi [this message]
2026-09-01 16:34 ` [PATCH 4/7] gdb, gdbserver: always use order-only prerequisites for generated files Tom Tromey
2026-08-31 18:51 ` [PATCH 5/7] gdb, gdbserver: remove the .NOEXPORT target Simon Marchi
2026-09-01 16:37 ` Tom Tromey
2026-08-31 18:51 ` [PATCH 6/7] gdb: remove the explicit ada-exp.o rule Simon Marchi
2026-09-01 16:38 ` Tom Tromey
2026-08-31 18:51 ` [PATCH 7/7] gdb, gdbserver: create the dependency directories from the Makefiles Simon Marchi
2026-09-01 16:47 ` Tom Tromey
2026-09-01 20:18 ` Simon Marchi
2026-09-01 20:37 ` Simon Marchi
2026-09-02 18:36 ` Tom Tromey
2026-09-03 13:45 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260831185300.572297-5-simon.marchi@efficios.com \
--to=simon.marchi@efficios.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox