[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gcc on xemacs
Floyd L. Davidson
Re: gcc on xemacs
Sun, 05 Jun 2005 23:40:28 -0800
gnus 5.10.6/XEmacs 21.4.15/Linux 2.6.5
>how do i compile a single c/c++ file using gcc on xemacs in the
>minibuffer. on clicking compile in menubar i get "make -k" in
>minibuffer, but i want to change this command permanently so that it
>displays "gcc -Wall" followed by the current active buffer file.c or
>file.cpp. i donot know howto edit that custom settings elisp file in a
That certainly can be done, but it really is not a very good
idea, simply because it is *way* too restrictive.
It means, for example, that you can't change the options given
to gcc, and trust me that -Wall is *not* what you really want to
run gcc with, normally. You can't compile multi-file programs,
for example. You can't turn on any of the several other options
that you really should be running gcc with almost by default.
But worse yet, gcc would be the *only* command you could compile
with! Bad idea.
If you leave it at "make -k" you merely need to have a skeleton
Makefile somewhere that you can copy into any directory where you
want to run a compile. It could indeed have "gcc -Wall" as the
default command, though I would suggest something like:
gcc -g -O -pipe -ansi -pedantic -Wall -W \
-Wcast-align -Wcast-qual -Wshadow -Wnested-externs \
-Wstrict-prototypes -Waggregate-return -Wmissing-prototypes \
-Wbad-function-cast -Wmissing-declarations -c
would be better, and that the top line part would be the minimum
to use as a default.
But even more, gcc is not the only "compile" you might want to do
from within (X)Emacs. For example, LateX or TeX documents, and
perhaps other programs such as dvi2ps or ghostscript are all things
which lend themselves to processing with a complex set of commands
that can be reduced to "make -k" with a useful Makefile.
By having a generic command like "make -k" you can use either a
nice simple default Makefile, or if the occassion demands, you can
use a very complext Makefile. That's functionality worth keeping.
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) address@hidden