One way to do this:
Make a file in the root directory of your project .dir-locals.el
This will be read whenever you open a file in a directory or its subdirectories.
To back up to the root folder and run make as a compilation command, just put this in the .dir-locals.el .
((nil . ((compile-command . "cd ~/mycode/c/; make"))))
nil is a mode for setting local variables for (nil means any), therefore for this only for C ++ mode you can do it instead ...
((c++-mode . ((compile-command . "cd ~/mycode/c/; make"))))
Obviously, you can configure a list with a lot of parameters, for example, execute ant for java files, etc.
manual recording of emacs for directory locales
source share