From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=PMvsJ1ZI; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 091495A061C for ; Thu, 28 Nov 2024 00:09:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1732748969; bh=nz5xMqeeouRztiYIAU7kZv1Oqbl61ZymQ7FtpiC3IJk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PMvsJ1ZIigbPNoZBCrhtVoHC9cd8SbCsGJlWClC9KmIAvumQrIIwu6/Om8y5DA3dU nqJOAkl0PQPxWYxu9M0mDFPtcE0hKOv4dpG9GZ2MUMl3RJlslaoBFhNaR8u/7/zeVK rVl5VPemuHxEMeu3CBh1gDdejCbvhF7P+SENLkCiKGqzE+xXooFp5QDyvcd0vScB/4 ZxQ2gZYXyV5WC6rgqMllK8Dfnc/MWCt8LR6+xztbK6aiKzC8PiUN8uqfjcf4EQ9tFn L66vtPzYgqRL58US9TVbJvjZldnRHTHpvkQ99TvTgLUcUQ/eDxT65AnfphFvGfbKAc fq2qfpYu65t3Q== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XzFWY0ythz4xSQ; Thu, 28 Nov 2024 10:09:29 +1100 (AEDT) Date: Thu, 28 Nov 2024 09:33:47 +1100 From: David Gibson To: Laurent Vivier Subject: Re: [PATCH] Makefile: Use make internal string functions Message-ID: References: <20241127161645.3649591-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="+XOcENzdig6IzCvz" Content-Disposition: inline In-Reply-To: <20241127161645.3649591-1-lvivier@redhat.com> Message-ID-Hash: XG74RJYUOQGIUSD2YGF6IF5NIR37PFWS X-Message-ID-Hash: XG74RJYUOQGIUSD2YGF6IF5NIR37PFWS X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --+XOcENzdig6IzCvz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 27, 2024 at 05:16:45PM +0100, Laurent Vivier wrote: > TARGET_ARCH is computed from '$(CC) -dumpmachine' using external > bash commands like echo, cut, tr and sed. This can be done using > make internal string functions. >=20 > Signed-off-by: Laurent Vivier Reviewed-by: David Gibson > --- > Makefile | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/Makefile b/Makefile > index cb7448079de5..1fce73707805 100644 > --- a/Makefile > +++ b/Makefile > @@ -17,8 +17,9 @@ DUAL_STACK_SOCKETS :=3D 1 > =20 > TARGET ?=3D $(shell $(CC) -dumpmachine) > # Get 'uname -m'-like architecture description for target > -TARGET_ARCH :=3D $(shell echo $(TARGET) | cut -f1 -d- | tr [A-Z] [a-z]) > -TARGET_ARCH :=3D $(shell echo $(TARGET_ARCH) | sed 's/powerpc/ppc/') > +TARGET_ARCH :=3D $(firstword $(subst -, ,$(TARGET))) > +TARGET_ARCH :=3D $(patsubst [:upper:],[:lower:],$(TARGET_ARCH)) > +TARGET_ARCH :=3D $(subst powerpc,ppc,$(TARGET_ARCH)) > =20 > # On some systems enabling optimization also enables source fortificatio= n, > # automagically. Do not override it. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --+XOcENzdig6IzCvz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmdHnj4ACgkQzQJF27ox 2Gfj1g//f5plaLqhsntwMFOVB9UrOxju8iLXCBgZLVzfwtoMDysPcbQptoAeWrlW OemEkFxnc2QVCpS6S8M5M9mUCVDLEZ0+6pgB7HRfV2ZuoAeFiyH1QgOemupTLnD2 7vf/J9AsqrLHSzgo+ZLvKl9FmgeHlL2rVn9HUr6K3Wr41v6GBB3Ca8/Ml9x72xVm 4ajgpeWRU941k/gh1CWJ4L10n9KR97vdoPEnc2SUaGT70a4UJlim1vHWjNxJmyKc 0CgPGAkudK/4F3/IYUU8zJxY/JewpIskeXu6F69xAz0cB96KEWfEcVJEqik+nH4p 8fkBV6L1wrdaxYUIIhOeyUEVmvxxKPMXTq2B9Sri1Y80gI/pV42T6vYZODwEl4AX xoZroJ0ZY28SS/CKuWzz+DfnAIPKTvNA+J0Y3XKqqidEgzgG9QreTL0TX5EVBz+6 HNITC8Hg/Wmqndc8Jjr4S9Fkhbmse8ldEFU2lVIi5Vb/MNE4TaMH+Yf2zUNIKsVv os1q3HYDe6hGD9/prI1fJNZBZlHWp+oln9wu4CM2+7XHeug6ELMazNLsSGONpk+t t0pdTSbJH4xOoBBiElDKz6/2M7OofsV2QmAaC/bx1HyhMU/TSszUfuBSYM6l3czl wxShjss2dDeAYYF4f75/mUU+DVqjhBf6lEPpXYXmCAPfWx7NDik= =NoLi -----END PGP SIGNATURE----- --+XOcENzdig6IzCvz--