From 640105016c00c8741eed4da50edf8dc0d9fe41e8 Mon Sep 17 00:00:00 2001
From: Ben Avison <bavison@riscosopen.org>
Date: Tue, 26 Nov 2019 00:00:21 +0000
Subject: [PATCH] Tweak definition of `${MAKE}` when cross-compiling

When executing the makefile from within the `objs` directory, this now
includes an implicit `-C..` option. This makes it simpler to write agnostic
makefiles. For example,

	${MAKE} -f other${EXT}mk other_target

rather than

ifeq (,${MAKE_VERSION})
	${MAKE} -f other/mk other_target
else
	${MAKE} -f ../other.mk other_target
endif
---
 GNUmakefiles/StdTools | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/GNUmakefiles/StdTools b/GNUmakefiles/StdTools
index d4c9703..5f19d14 100644
--- a/GNUmakefiles/StdTools
+++ b/GNUmakefiles/StdTools
@@ -72,7 +72,11 @@ HDR2H           = perl ${TOOLSDIR}/Build/Hdr2H,102
 INSERTVERSION   = awk -f ${TOOLSDIR}/Build/AwkVers
 INSTRES         = perl ${TOOLSDIR}/Build/InstRes,102
 INSTVIARG       = perl ${TOOLSDIR}/Build/InstViaRG,102
+ifeq (objs,$(notdir ${CURDIR}))
+MAKE            = make -C..
+else
 MAKE            = make
+endif
 MODGEN          = modgen
 MODSQZ          = modsqz
 NOP             = #
-- 
GitLab