Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C-mode

0 views
Skip to first unread message

Daniel Piche

unread,
Sep 24, 1996, 3:00:00 AM9/24/96
to

I am trying to modify the compile command so that
it does the following:

make -k filename.make


where filename.c is the main program file.

Anyone have a suggestion?

Thanks,
Dan

--
Daniel Piche
University of Waterloo
E-mail/courrier electronique: dgp...@mercator.uwaterloo.ca
Phone/tel: (519) 885-1211 Extension: 6668

Nat Makarevitch

unread,
Sep 28, 1996, 3:00:00 AM9/28/96
to Daniel Piche

Daniel Piche writes:

> I am trying to modify the compile command

(setq compile-command "make")

--
Nat Linux

Kai Grossjohann

unread,
Sep 28, 1996, 3:00:00 AM9/28/96
to Daniel Piche

>>>>> Daniel Piche writes:

Dan> I am trying to modify the compile command so that
Dan> it does the following:
Dan> make -k filename.make
Dan> where filename.c is the main program file.

Put the following lines at the end of each .c and .h file:

/* Local Variables: */
/* compile-command: "make -k foo" */
/* End: */

Of course, you should put the right compile command in there.

kai
--
Life is hard and then you die.

Nat Makarevitch

unread,
Sep 29, 1996, 3:00:00 AM9/29/96
to Daniel Piche

Daniel Piche writes:

> I am trying to modify the compile command so that it does the following:

> make -k filename.make

> where filename.c is the main program file.

copy this snippet in your ~/.emacs:

-=-=-=-
(defun my-compile ()
"Call `compile' with 'make -kf BUFFER-NAME.make'"
(interactive)
(compile (concat "make -kf " (file-name-sans-extension (or (file-name-nondirectory (or (buffer-file-name) (buffer-name))))) ".make"))
)

(global-set-key [f12] 'my-compile)
=-=-=-

you can then use F12 when the current buffer is the main program file.

naming the compilation buffer like the project may be useful
(in order to be able to invoke many simultaneous compilations)

-=-=-=
(defun compilation-buffer-name-function-Nat (Q)
"Establish the name of the buffer created by `compile'"
(concat "*" (file-name-sans-extension (or (file-name-nondirectory (or (buffer-file-name) (buffer-name))))) ".compil*"))

(setq compilation-buffer-name-function 'compilation-buffer-name-function-Nat)
=-=-=-

--
Nat Linux

Kevin Rodgers

unread,
Sep 30, 1996, 3:00:00 AM9/30/96
to

Daniel Piche (dgp...@mercator.math.uwaterloo.ca) wrote:
>I am trying to modify the compile command so that
>it does the following:
>
> make -k filename.make
>
>where filename.c is the main program file.

(add-hook 'c-mode-hook
(lambda ()
(set (make-local-variable 'compile-command)
(format "make -k -f %s.make"
(file-name-sans-extension
(file-name-nondirectory buffer-file-name))))))
--
Kevin Rodgers <kevin....@ihs.com> Project Engineer
Information Handling Services Electronic Systems Development
15 Inverness Way East, M/S A201 GO BUFFS!
Englewood CO 80112-5776 USA 1+ (303) 397-2807[voice]/754-3975[fax]

0 new messages