Re: CC ?= gcc

Alejandro Colomar <[email protected]> Tue, 16 Jul 2024 20:10:41 +0200
Newsgroups gmane.comp.gnu.make.general
Message-ID <p2s4l6ixv4n6sz64qifob22rk2cx42663v3vhcc6jvx35gwfn7@becwnmze36vi>
Hi Paul,

On Tue, Jul 16, 2024 at 01:56:46PM GMT, Paul Smith wrote:
> On Tue, 2024-07-16 at 19:43 +0200, Alejandro Colomar wrote:
> > I used the following:
> > 
> > < <
> > < <       alx@debian:~/tmp/make$ env | grep CC
> > < <       QT_ACCESSIBILITY=1
> > < <       alx@debian:~/tmp/make$ cat GNUmakefile
> > < <       GNUMAKEFLAGS += --no-builtin-rules
> > < <       GNUMAKEFLAGS += --no-builtin-variables
> 
> Sorry I didn't notice this.  When asking questions it helps to call out
> the important things explicitly rather than relying on the perennially
> distracted to notice all the nuances.

Sorry.  My fault.  :-)

> GNUMAKEFLAGS is only "special" when read from the environment.  It has
> no meaning inside a makefile; it's just a normal variable as far as
> make is concerned.  You must use the MAKEFLAGS variable inside a
> makefile, for it to have any effect.
> 
> I can see that the docs are not completely clear about this.  It should
> be made clearer.

Hmm, indeed.  I just patched my build system because someone said I
should use GNUMAKEFLAGS, since my flags are GNU-specific.  :D

I read the docs, which say

	If you’d like to run other implementations of make in addition
	to GNU make, and hence do not want to add GNU make-specific
	flags to the MAKEFLAGS variable, you can add them to the
	GNUMAKEFLAGS variable instead.  This variable is parsed just
	before MAKEFLAGS, in the same way as MAKEFLAGS.

Which clearly says GNUMAKEFLAGS is treated "in the same way as
MAKEFLAGS".  Either the docs or the code should be fixed.

On the other hand, I've been spelunkling the git-log(1), and found that
4.4.1 added support for '-r' in MAKEFLAGS, but '-R' was added after the
release.  Am I reading that correctly?  So, there's no release yet that
supports -R in the GNUmakefile, AFAICS.

If so, do you have plans to release soon-ish?  (Just wondering, no
pressure.)

For now, I think I'll ignore the environment, and use :=.  That will
force distros to pass all variables explicitly, which isn't too bad.

Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es/>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmaWt5sACgkQnowa+77/
2zK9Yg//ZHpJIDa9F+xV48+U97WQj/zqceaX1orXfV5tUx+rnoQZzmw29LO2WM5W
2NL3I9drM9qnKMl/ZgIL+18vKneTaHmH83e1vh2qUc1roS8sZ3/ubttgtWlkapFK
PWSrkqrT98FRTL6k8vqnrbpyONcV6hGvlxLdw/wGwJxd6eWVVZMZIFFZZ82g2RtV
sQomm576nipnjMctJ5XLXlK9iD/4R7rTGYuhP2LgpCapmVvzLBAQofD7ZFbEtIal
SO1K8LG35W18bbod9RiNQgfPTwnnAvkt/w633tZl6znud/R9PPxjjrMgrsjOAjyS
MvBfhJacyh/k70atywwIPIJKOp31v+oG1NJ7Enetw3m/RNLANUI6sww9+xTJoRsH
G3jnMk60a1a0cqZSl++JFekVBfMZ/kOybQrm8tCT0Lppf2PlSFAY5mclNUaPTN43
sn1fCAEvrPiSdta3mc3lzRSBVG6uHLqesuWX+4agYia8z/NAMmGuUNUCQRIb0K1N
5Y8HxCbnJBZisAtzTPC2uHHFkNifo5MdEE7qPKfR05EaqfWAS4fSncQELGRLB3Bh
9ze207W+ihoNg5fbuYKcxgSx1Ygxgc3cFt8VmlGPkH/yfI4T01+MG4lrD141hRjM
pGFds+yGdcqf1fej6tL6oZHkl65z8wVOo3GDPuYnSl4rcZliLm0=
=KVkX
-----END PGP SIGNATURE-----