Giving profiled object files a different extension (was: RE: Profiling suggestion)

Ketil Z. Malde
13 May 2002 08:57:18 +0200

"Simon Marlow" <> writes:

> The proposal, therefore, is to extend the meaning of '-prof' to mean
> '-prof -osuf p_o -hisuf p_hi' or similar.

I wasn't aware of these ('-*suf') options.  Are they respected by the
linker stage?  I.e. will ghc --make when invoked with -osuf and -hisuf
entirely ignore .o's and only link the specified suffixes?  Going to
have to try that..., great!  Nevermind I asked, and thank you!

>   - win: you could store profiled and normal objects in the same
>     directory.

That'd be nice, of course, but any solution that kept me from linking
profiling and non-profiling objects would be great.  (With my current
setup, I have targets for normal, -O and -prof compilation, but I need
to 'make clean' before I change targets...and I'd rather not do that
for *every* compile, of course)

>   - win: you'd be less likely to mix up profiled and normal objects.

>   - lose: Makefile writing gets harder.  Extra suffix rules [...]
>     If you're using ghc --make this doesn't affect you.

I'm using Makefiles, but with ghc --make in them.  So, another
solution for *my* problem (but perhaps not others') would be for ghc
--make to check for profiling/non-profilng objects and recompile them
if they don't match the current options.  A bit more compilation, a
bit less directory clutter.  Perhaps harder to implement?

(A third option might be to put object files in a separate directory
from the source.)

If I haven't seen further, it is by standing in the footprints of giants