(defun my-compile ()
"This command is meant to step out of the include/src directories on compilation. Useful for compiling projects without cd-ing to the correct Makefile path."
(let ((last-directory default-directory))
(if (string-match "\\(\/src\/\\|\/include\/\\)$" default-directory)
(cd (replace-regexp-in-string "\\(\/src\/\\|\/include\/\\)$" "/" default-directory)))
(define-key c++-mode-map (kbd "<f9>") 'my-compile)
Far from perfect, but it's a start and works very well for me.
On Sat, Jul 10, 2010 at 9:05 AM, Eli Zaretskii <address@hidden>
> Date: Fri, 9 Jul 2010 11:51:19 -0500
> From: =?ISO-8859-1?Q?St=E9phane_Maniaci?= <address@hidden>
Switch to the buffer that visits your top-level Makefile, before
> My project uses non-recursive Makefile, thus there is only (at the moment) a
> single Makefile in my project root tree, that compiles (with Autotools) all
> my sources files, located in the src/ directory.
> Now the problem is : when I'm editing my code and tries to compile it (M-x
> compile), I have to use 'make -k -C ../', which works fine, but Emacs
> doesn't know anymore which files contains error. When trying to move to last
> error, it outputs this :
> Find this error in (default src/ease-about-dialog.vala): ~/build/ease/src/
> Does anyone have a workaround for this ?
typing "M-x compile".
I. Physikalisches Institut B (RWTH Aachen)
Phone: +49 241 - 8027205