help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with makefile command line


From: step
Subject: Re: help with makefile command line
Date: Thu, 27 Mar 2008 08:36:15 -0700 (PDT)
User-agent: G2/1.0

On 3月25日, 下午9时09分, "Balaji V. Iyer" <bvi...@ncsu.edu> wrote:
> Hello Everyone,
>     I use the compile option extenstively in emacs. When I type "M-x
> compile" the default line is "make -k" Many times I do not have a make
> file thus I would lke the default line to be
>
> "gcc -ansi -O4 -Wall <c_source_file>"
>
> How do I do this?
>
> I tried the following command but it doesn't seem to work (If anyone
> have a better idea please let me know).
>
> (function
>  (lambda ()
>    (unless (or (file-exists-p "makefile")
>                (file-exists-p "Makefile"))
>      (setq compile-command
>            (concat "gcc -Wall -O3 -o"
>                    (file-name-sans-extension (file-name-nondirectory
> buffer-file -name))
>                    " "
>                    (file-name-nondirectory buffer-file-name))))))
>
> Any help is greatly appreciated.
>
> Thanks,
>
> --
>
> Balaji V. Iyer
> PhD Student,
> Center for Efficient, Scalable and Reliable Computing,
> Department of Electrical and Computer Engineering,
> North Carolina State University.

why don't use the smart-compile.el for emacs?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]