On 07/06/2011 11:51 PM, manuel "lonely wolf" wolfshant wrote:
> On 07/06/2011 11:16 PM, Adrian Sevcenco wrote:
>> Salut! stie cineva o posibilitate prin care pot exporta niste variabile
>> de env astfel incit la compilare gcc-ul sa ia automat de ex -O2
>> -march=native ?
>> Multumesc,
>> Adrian
> export CFLAGS="-O2 -alte-argumente". eventual se mai pot folosi, in
> functie de context CPPFLAGS si LDFLAGS
Mie nu-mi merge cu definirea variabilei de mediu CFLAGS[1].
Variabila e folosită, însă, de make[2].
Răzvan
[1]
---
razvan@valhalla:/tmp$ cat test.c
#include <stdio.h>
int main(void)
{
int a = 1;
if (a = 1)
printf("Hello, World!\n");
return 0;
}
razvan@valhalla:/tmp$ gcc -o test test.c
razvan@valhalla:/tmp$ export CFLAGS=-Wall
razvan@valhalla:/tmp$ gcc -o test test.c
razvan@valhalla:/tmp$ gcc -Wall -o test test.c
test.c: In function 'main':
test.c:7:2: warning: suggest parentheses around assignment used as truth
value [-Wparentheses]
---
[2]
---
razvan@valhalla:/tmp$ make test
cc test.c -o test
razvan@valhalla:/tmp$ rm test
razvan@valhalla:/tmp$ CFLAGS=-Wall make test
cc -Wall test.c -o test
test.c: In function 'main':
test.c:7:2: warning: suggest parentheses around assignment used as truth
value [-Wparentheses]
---
_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug