Fix profiling targets
authorIustin Pop <iustin@google.com>
Fri, 14 Dec 2012 19:39:18 +0000 (20:39 +0100)
committerIustin Pop <iustin@google.com>
Wed, 19 Dec 2012 11:10:22 +0000 (12:10 +0100)
commit675f65b75b27c899573b57f390fbeea42bc4ae89
tree661c21217e441b98881a46c1ad4dc3cd2833144b
parent0d57ce24288c649c7fe1b0b4f6c9824698964910
Fix profiling targets

As noted by Guido, there are problems when using the hs-prof and
hs-prof-quick targets in the default configuration (compiling all
programs). The errors manifest in the form of wrong symbols during
compilation.

I knew that the hs-prof targets, which compiled multiple objects with
the '.o' suffix, could be problematic; but the objects that are
actually needed in the Template Haskell phase are very standard and
don't differ between the binaries (Constants, BasicTypes, JSON,
THH). What I didn't realise (although it's obvious) is that also the
hs_prof_quick targets (the final binaries) are also compiled with a
single suffix ('.prof_o'), which means that the object files are
actually compiled for the last binary.

This means that targets later in the HS_ALL_PROGS list would work
correct, but early targets, especially htools/htools, would fail.

So the obvious, and the single simple solution is to make these two
rules only work on a single binary at a time. This should be fine,
since one is looking at a specific problem usually, and it has the
advantage that the hs-prof step is much faster (since it wasn't
buildable in parallel anyway).

Thanks to Guido for finding and making the initial diagnose on this!

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Makefile.am