public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Cc: Hans-Peter Nilsson <hp@axis.com>
Subject: Should we require GNU make in binutils?
Date: Fri, 25 Aug 2023 12:53:29 +0930	[thread overview]
Message-ID: <ZOgesf+pTitJDdSN@squeak.grove.modra.org> (raw)

I see the toplevel Makefile.in makes use of $(filter-out ..) and other
GNU Make extensions, and requires GNU Make 3.80 or later when building
gcc.  gdb also uses GNU make extensions.  It seems silly to me that
binutils is still trying to avoid GNU make extensions.

We could start with the following (originally from Hans-Peter) which
avoids a whole lot of entering/leaving messages when building with
--enable-targets=all.  What do people think?

diff --git a/ld/Makefile.am b/ld/Makefile.am
index be456275748..fcb93060a14 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -633,19 +633,10 @@ GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
 
 @TDIRS@
 
-# We can't use pattern rules as we don't want to depend on GNU
-# make, or else these rules could have been expressed in one
-# two-liner: 'e%.c:' and '	${GENSCRIPTS} $* "$(tdir_$*)"'.
-# (The recursive variable expansion is portable.)
-
-run-genscripts:
-	$(AM_V_at)${GENSCRIPTS} $(script_target) "$($(script_tdirname))"
-
-.PHONY: run-genscripts
+e%.c:
+	$(AM_V_GEN)${GENSCRIPTS} $* "$(tdir_$*)"
 
 $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES): $(GEN_DEPENDS)
-	$(AM_V_GEN)base=`echo $@ | sed -e 's,e\(.*\).c,\1,'`; \
-	$(MAKE) run-genscripts "script_target=$$base" "script_tdirname=tdir_$$base"
 
 # It's a pity we can't generate these include "./deps/e*.Pc" lines
 # from ALL_EMULATION_SOURCES and ALL_64_EMULATION_SOURCES, but that isn't

-- 
Alan Modra
Australia Development Lab, IBM

             reply	other threads:[~2023-08-25  3:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25  3:23 Alan Modra [this message]
2023-08-25  5:12 ` Fangrui Song
2023-08-25  8:15 ` Jan Beulich
2023-08-25  9:26   ` Alan Modra
2023-08-25  8:37 ` Jose E. Marchesi

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=ZOgesf+pTitJDdSN@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=hp@axis.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).