I often got to work with projects organized as follows:
Is there a way to teach emacs' "compile" function to always use that top-level Makefile regardless which file I'm editing in the current buffer? For example it can be any of
In all those cases I want "compile" command to go as many times "up" in hierarchy as necessary to get into top-level directory (the one in the directory with 'src', 'include' and 'tests' entries) and run Makefile in there. Additional problem is that any of sub directories can have Makefiles of its own.