Use GNU make pattern rule in ld Makefile
authorAlan Modra <amodra@gmail.com>
Thu, 24 Aug 2023 08:40:17 +0000 (18:10 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 25 Aug 2023 09:26:32 +0000 (18:56 +0930)
Use the pattern rule in a comment from commit 77ac17b8453f.

* Makefile.am (run-genscripts): Delete.  Use pattern rule
e%.c instead.
* Makefile.in: Regenerate.

ld/Makefile.am
ld/Makefile.in

index be4562757484d033fccd2206a9183bb88bb7b93f..fcb93060a143b7abd57ed2e12d2fa75c1b879316 100644 (file)
@@ -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
index c6a79774f38bdac65029de6589e58f95c47f99c1..fc6dccbad20130e1d0d631123d16fb049ac9a14b 100644 (file)
@@ -2355,19 +2355,10 @@ stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
 
 @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