Skip to contentSkip to conversation

Remove CFLAGS parameter in cc-option

Qemu-devel Thomas Monjalon 1 participant 1 message Sep 11, 2009

lore
Share & tools
lore
#0 lore raw
Quoted 21 lines · Juan Quintela
Quoted 9 lines · Thomas Monjalon
Quoted 3 lines · Anthony Liguori

What I'd prefer is for someone to figure out the root cause of += not working for us. If we can't, I'd like a big fat comment stating that it's a known deficiency and we'll move on.

"make" complains about an infinite recursive assignment because the first assignment of CFLAGS defines a recursively-expanded variable and the right value is a macro which uses the CFLAGS.

Quoted 6 lines

As explained in
http://www.gnu.org/software/make/manual/html_node/Appending.html , it can be fixed by making CFLAGS a simply-expanded variable at its first assignment.

I have submitted a patch.

Thanks for the explanation.
I haven't yet seen your patch, but I agree that right thing to do is do the 1st assignment as QEMU_CFLAGS := foo

Quoted 6 lines

We can't really use CFLAGS, because CFLAGS need to work from the command line

make CFLAGS="-O0 -g"

or I am lossing something obvious?

In order to use the variable from the command line, we should use the syntax "override" before each CFLAGS modification. This way, it is possible to append options after the user ones.
If override is not used, "make" expand the variable by using the command line value in priority, which overwrites the Makefile value.

I could send another patch for that but it seems that my mails are filtered out by the mailing list.

Signature · 1 line
Thomas