[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: file-specific optimization options?
From: |
Nicola Pero |
Subject: |
Re: file-specific optimization options? |
Date: |
Tue, 6 Nov 2001 16:00:44 +0000 (GMT) |
> You don't necessarily have to remove the flags, just modify/append to
> them.
> Here's a small example of how autoconf/automake does this to allow a
> file containing embedded asm code to be compiled without optimizations
> and without -fomit-frame-pointer (asm code doesn't compile well with
> this flag and any optimization):
Thanks for the example, pretty interesting
> > probably implement all this stuff but I'm not sure how much real use it
> > would be and how much would just be confusing and making gnustep-make
> > source code more obscure ... if anybody has convincing examples/real life
> > cases in which it might be useful to be able to add/remove specific flags
> > for a single file, please let me know! you might convince me to actually
> > implement it.
>
> it can be very useful if you ever want to add asm code in your project
> for example.
Yes - thanks for the example - I agree it can be useful - I implemented
this for gnustep-make, it's already on CVS.
To compile asm in the Objective-C file file.m you can now add to the
GNUmakefile
file.m_FILE_FILTER_OUT_FLAGS = -O% -fomit-frame-pointer
that will automatically instruct gnustep-make to filter-out -O% and
-fomit-frame-pointer from the flags when file.m is compiled. Flags for
other files won't be touched. No need to touch/redefine any internal
compilation rule.
(the same for C, C++, java files - for example
file.c_FILE_FILTER_OUT_FLAGS = -O% -fomit-frame-pointer
works the same)
you can also add flags (and they are added after the other ones), so I
guess
file.m_FILE_FLAGS = -O0 -fno-omit-frame-pointer
should have the same result because as you say the last flags should take
the precedence.