Re: per-directory compile command ?

Markus Heiser <[email protected]> Fri, 09 Dec 2005 14:36:21 +0100
Newsgroups gmane.emacs.xemacs.general
Organization Contact GmbH
Message-ID <[email protected]>
[email protected] schrieb:
> Hello !
>=20
> I have several source directories with different programming languages.=
=20
> When compiling source from a java directory, I have to call ant for=20
> compiling, in a c++ directory I call make and in a very special c++=20
> directory I call some script for compiling.
>=20
> Is there a way to put some config file in a directory so that each buff=
er=20
> from this directory knows its own compile command ?
>=20

... normaly this is a file named "Makefile"  ;-)

but I'am thinking you are looking forward for a major-mode
default when invoking the Emacs /compile/ command.

try this ...

(defun buildkit-ide-compile ()
   (interactive)
   (compile
    (if (or compilation-read-command current-prefix-arg)
        (read-shell-command "Compile command: "
                            (cond
                             ((string=3D major-mode "java-mode")
                              "ant -myopt")
                             ;;((string=3D major-mode "xyz-mode")
                             ;; "xyz -myopt")
                             (t
                              "make -k"
                              )))
      (list compile-command))))

If you won't (re)-bind your 'compile'-click

(global-set-key "\C-cc" 'buildkit-ide-compile)

... hope it helps.


> Mit freundlichen Gr=FC=DFen
>=20
> Markus Grunwald
> Softwareentwicklung
>=20
> PR=DCFTECHNIK Condition Monitoring GmbH
> Oskar-Messter-Stra=DFe 19-21
> 85737 Ismaning
> www.pruftechnik.com
> Tel: +49 (0)89 99616177
> Fax: +49 (0)89 99616200
>=20
>=20


--=20

Mit freundlichem Gruss

     -- M.Heiser --

  -----------------------------------------------------------------
     Markus Heiser                   Dipl. Ing. Physiktechnik (FH)
     CONTACT Software GmbH           Tel. : +49 (0) 421 20153 91
     Software Entwicklung            FAX  : +49 (0) 421 20153 41
     Wiener Str. 1-3                 eMail: [email protected]
     D-28359 Bremen                  www  : http://www.contact.de
  -----------------------------------------------------------------