Emacs custom C ++ compilation support

I am using a wrapper around make to compile C ++ code in a project.

For example, project Foo is laid out like this:

Foo/ 
Foo/src/...
Foo/lib_1/..
Foo/lib_2/...
etc

      

where lib_1, lib_2 are the Foo library dependencies. There is one in the src directory, create a file that I run on the command line.

Is there a way to teach emacs to always run this file when I compile Mx? And figure out how to jump to an error in some other file buffer (or open a new buffer for a file) depending on what the error is when running make (g ++)?

Edit: I am assuming that I am asking for project support and support within a project to run a specific custom make file where the errors point to files in the project that emacs can navigate to.

+3


source to share


1 answer


See variable compile-command

. This is what Mx compiles by default, so you can configure it to run the makefile you want. For example.

cd /your/root/dir ; make

      



Also see the command recompile

if you don't want to always hit the enter key. It is also worth binding it to some key.

+4


source







All Articles