public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Should we require GNU make in binutils?
@ 2023-08-25  3:23 Alan Modra
  2023-08-25  5:12 ` Fangrui Song
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alan Modra @ 2023-08-25  3:23 UTC (permalink / raw)
  To: binutils; +Cc: Hans-Peter Nilsson

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Should we require GNU make in binutils?
  2023-08-25  3:23 Should we require GNU make in binutils? Alan Modra
@ 2023-08-25  5:12 ` Fangrui Song
  2023-08-25  8:15 ` Jan Beulich
  2023-08-25  8:37 ` Jose E. Marchesi
  2 siblings, 0 replies; 5+ messages in thread
From: Fangrui Song @ 2023-08-25  5:12 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, Hans-Peter Nilsson

On Thu, Aug 24, 2023 at 8:23 PM Alan Modra via Binutils
<binutils@sourceware.org> wrote:
>
> 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?

This is a good idea!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Should we require GNU make in binutils?
  2023-08-25  3:23 Should we require GNU make in binutils? Alan Modra
  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
  2 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2023-08-25  8:15 UTC (permalink / raw)
  To: Alan Modra; +Cc: Hans-Peter Nilsson, binutils

On 25.08.2023 05:23, Alan Modra via Binutils wrote:
> 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.

Aren't pattern rules a GNU extension as well? We're already using them
in e.g. bfd/Makefile.

Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Should we require GNU make in binutils?
  2023-08-25  3:23 Should we require GNU make in binutils? Alan Modra
  2023-08-25  5:12 ` Fangrui Song
  2023-08-25  8:15 ` Jan Beulich
@ 2023-08-25  8:37 ` Jose E. Marchesi
  2 siblings, 0 replies; 5+ messages in thread
From: Jose E. Marchesi @ 2023-08-25  8:37 UTC (permalink / raw)
  To: Alan Modra via Binutils; +Cc: Alan Modra, Hans-Peter Nilsson


> 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.

+1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Should we require GNU make in binutils?
  2023-08-25  8:15 ` Jan Beulich
@ 2023-08-25  9:26   ` Alan Modra
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Modra @ 2023-08-25  9:26 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Hans-Peter Nilsson, binutils

On Fri, Aug 25, 2023 at 10:15:33AM +0200, Jan Beulich wrote:
> On 25.08.2023 05:23, Alan Modra via Binutils wrote:
> > 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.
> 
> Aren't pattern rules a GNU extension as well? We're already using them
> in e.g. bfd/Makefile.

Yes, came in with commit bd32be01c997, Jan 2022.  OK, I'll commit the
ld change too.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-25  9:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-25  3:23 Should we require GNU make in binutils? Alan Modra
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

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).