From: Richard G Riley <rileyrgdev@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: help with makefile command line
Date: Fri, 28 Mar 2008 13:57:44 +0100 [thread overview]
Message-ID: <fsiq0a$jvh$1@registered.motzarella.org> (raw)
In-Reply-To: q9iub5-s47.ln1@invalid.net
stan <smoore@exis.net> writes:
> Richard G Riley wrote:
>> stan <smoore@exis.net> writes:
>>
>>> Richard G Riley wrote:
>>>> "Balaji V. Iyer" <bviyer@ncsu.edu> writes:
>>>>
>>>>> 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))))))
>>> <snip>
>>>
>>> Seems like it might be easier to write a makefile :)
>>
>> Sorry. I'm not sure I understand. You snipped all my code. Did it not
>> work for you? I use it on a daily basis.
>
> Sorry I confused with my snip. I'm not the op. I have my setup working
> pretty much the way I want ( is anyone ever really satisfied?)
But what has your setup and they way you want it got to do with the OP
wanting auto selection between Makefile and the gcc direct approach?
>>
>> Yes, I do know that. But why would I do that when I can automate it as
>> above depending on whether there is a Makefile or not?
>
> Again, our streams got crossed at my snip. Both of our comments should
> have been directed to the OP and not each other.
My comments were directed at you. It was your post I replied to
above. You replied to me. I replied to you.
I am still not sure what points you were trying to make though. Did you
understand the OPs want better now?
>>
>>>
>>> Another idea, if you don't like what Eli suggested earlier is to come up
>>> with a makefile template and use auto insert. I have a template that I
>>> only need to basically change the list of files in and it save a lot of
>>> time during the compile, run. scream. debug, edit cycle.
>>>
>>> Finally, you can edit the compile command for all time but it seems like
>>> a bad idea.
>>
>> I'm not sure I understand. I have makefiles for most of my projects. If
>> I don't have one it builds a compile and link command based on the c
>> file name which is what you requested.
>>
>> Sorry I can't be more help. Did you try my code?
>
> See above. I didn't snip this time for fear of losing you again :)
next prev parent reply other threads:[~2008-03-28 12:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.9409.1206451688.18990.help-gnu-emacs@gnu.org>
2008-03-27 15:36 ` help with makefile command line step
2008-03-27 17:28 ` Richard G Riley
2008-03-28 2:51 ` stan
2008-03-28 3:01 ` Richard G Riley
2008-03-28 7:11 ` stan
2008-03-28 12:57 ` Richard G Riley [this message]
2008-03-28 20:33 ` stan
2008-03-29 13:18 ` Richard G Riley
2008-03-29 15:33 ` Kevin Rodgers
2008-03-25 13:11 Help " Balaji V. Iyer
2008-03-26 4:17 ` Mike Mattie
2008-03-26 9:05 ` Andreas Schwab
2008-03-26 13:50 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2008-03-25 13:09 help " Balaji V. Iyer
2008-03-25 14:04 ` William Xu
2008-03-26 4:19 ` Eli Zaretskii
2008-03-26 4:25 ` Mike Mattie
2008-03-26 4:42 ` Mike Mattie
2008-03-26 4:57 ` Mike Mattie
2008-03-26 16:20 ` Nikolaj Schumacher
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='fsiq0a$jvh$1@registered.motzarella.org' \
--to=rileyrgdev@gmail.com \
--cc=help-gnu-emacs@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.