This is the final solution I've converged to. It's a bigger change than the previous version, but the implementation is actually cleaner. In nutshell, I've replaced all .sub files with .mk equivalent files which are included from the Makefile. I'm then filtering out all C object files which have assembly equivalent. This allowed me to simplify the build rules while we still support both in-tree and out-of-tree builds. Please let me know what you think, I'll be happy to iterate on this.
On Thu, Nov 12, 2015 at 10:35:07PM +0000, Petr Hosek wrote:
> >
> > What if we put the *.o files for arch asm in the arch dirs rather than
> > in the main src dirs. Is there some clean way we could write a rule to
> > remove the base .o files from OBJS when the arch-specific .o files are
> > there?
>
> That's what I had in mind and I've already implemented it, but I couldn't
> get the *.sub files to work in that setup. However, if we replace them with
> Makefile fragments as you suggested it might it might solve that problem.
> Let me try that out and I'll let you know whether this is a way to go.
I don't see why the same wouldn't work for .sub files: their .o files
could be put in their own dirs. But I'd rather get rid of them still
and just have the arch provide an ordered list, for the specific
subarch, of arch and subarch .s or .c files that should replace the .c
files "above" them in the tree. Do you have good ideas for how to do
this?
Rich