On Thu, Sep 03, 2009 at 12:06:56AM +0530, narendra babu wrote:
> I have lot of makefiles , by default gcc geneartes 64 bit executable on 64
> machine but i need to change to 32 bit , dont want to change the makefiles .
>
> Instead is there anyway i can change default flags at command line for gcc
>
> Can i set environment variable
> export CFLAGS=-m32 CXX=-m32 so that by gcc takes CFLAGS or CXX to generate
> 32bit code instead of 64 bit code by default .
>
> So in simple i want to chnage the gcc default flag settings
>
> Like $CFLAGS=-m32 gcc hello.c should generate me 32 bit code on a 64 bit
> machine instead of 64 bit .
>
> Note : As by default all my makefiles can take the default CFLAGS which is
> set as environment variable .
Well, why don't you try it?
Consider this Makefile:
all:
echo CFLAGS are $(CFLAGS)
Now, this is the result of running it:
[$ /tmp] make
echo CFLAGS are
CFLAGS are
[$ /tmp] CFLAGS=-m32 make
echo CFLAGS are -m32
CFLAGS are -m32
HTH.
Kumar
_______________________________________________
To unsubscribe, email [email protected] with
"unsubscribe <password> <address>"
in the subject or body of the message.
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc