unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mike Mattie <codermattie@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Help with makefile command line
Date: Tue, 25 Mar 2008 21:17:32 -0700	[thread overview]
Message-ID: <20080325211732.246fb67f@reforged> (raw)
In-Reply-To: <000101c88e79$ce6435c0$33160e98@ece.ncsu.edu>

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

On Tue, 25 Mar 2008 09:11:58 -0400
"Balaji V. Iyer" <bviyer@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
   ^^^ defun
>  (lambda ()
>    (unless (or (file-exists-p "makefile")
                                 ^^
                                 strange?
>                (file-exists-p "Makefile"))
>      (setq compile-command
       ^^^
       why modify a variable each time ? pass as an argument function ?
>            (concat "gcc -Wall -O3 -o"
>                    (file-name-sans-extension (file-name-nondirectory
> buffer-file -name))
             ^^
             broken ?

>                    " "
>                    (file-name-nondirectory buffer-file-name))))))
                      ^^^
                      computed twice, should bind.
>  
>  
>  
> Any help is greatly appreciated.

also concatenating arguments means that some external shell is going to have to split the args again,
usually better (no quoting issues), to simply pass off the arguments to exec without invoking the shell
if you can.

Hope that helps a bit.

> Oh, one thing..I am using emacs 21.2.1 on cygwin
>  
> Thanks,
>  

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-03-26  4:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 13:11 Help with makefile command line Balaji V. Iyer
2008-03-26  4:17 ` Mike Mattie [this message]
2008-03-26  9:05 ` Andreas Schwab
2008-03-26 13:50 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080325211732.246fb67f@reforged \
    --to=codermattie@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).