> It does half of the job. I need the .hi files to go to <blah> too.
> And except using sed, the only way i found to arrange this is to set
>
> compilationKeys = -iblah -odir blah $($*_flags) ...
>
> *and* add to Makefile 60 lines of kind
> source/Categs_flags = -ohi $(E)/Categs.hi
> source/auxil/Set__flags = -ohi $(E)/Set_.hi
> ...
> These 60 lines almost duplicate the lines of Makefile where the files
> are listed subjected to the rule .hs -> .o
>
> The question was what is the most natural way to avoid this
> duplication.
Use pattern rules and GNU makeisms? Something like
%.o : %.lhs
$(HC) -odir blah -ohi blah/$(patsubst source,blah,$*).hi
I guess -odir should probably do the right thing w/ respect to .hi files,
though.
Cheers,
Simon