Re: [PATCH] Makefile: Set CC/AR variable only if it doesn't have a value
From: Khem Raj <hidden>
Date: 2016-01-04 16:20:06
Attachments
- signature.asc [application/pgp-signature] 204 bytes
From: Khem Raj <hidden>
Date: 2016-01-04 16:20:06
On Jan 4, 2016, at 5:39 AM, Jeff Epler [off-list ref] wrote: I believe the patch does not have the desired effect, because make(1) always sets CC automatically: $ cat raj.mk CROSS_COMPILE=x86_64-linux-gnu- CC?=$(CROSS_COMPILE)gcc .PHONY: default default: @echo CC=$(CC) $ make -f raj.mk CC=cc With your patch, those who specify CROSS_COMPILE, or for whom gcc and cc are different, will get different (worse) behavior.
Right. I think if CC was used as such with out constructing out of CROSS_COMPILE in Makefile then my issue would be fixed too. However this would mean that cross compiling users now have to pass CC = <cross-compiler> themselves instead of CROSS_COMPILE prefix. Is that acceptable ?
I believe this idea has been discussed before, but it is hard to search for because few search engines will let you search on "CC ?=" and not just ignore the "?=". Also I am not sure why you are submitting this patch on -rt-users, it doesn't seem to be particularly relevant to the RT patchset.
See the MAINTAINERS file, I just followed whats in there.
Jeff