gcc questions

Dotan Cohen dotancohen at gmail.com
Sun Nov 27 20:39:01 UTC 2005


On 11/27/05, Matthew Miller <mattdm at mattdm.org> wrote:
> On Sat, Nov 26, 2005 at 01:16:25PM +0200, Dotan Cohen wrote:
> > Also, all files that gcc outputs are of the name a.out. I want it to
> > give the .out file the original name of the file, with a .out. I have
> > manned and discovered the -o option, whereby I can specify a filename,
> > but I would prefer that it would read the original filename and use
> > that. For instance:
> > $gcc mycode.c
> > $ls
> > mycode.c    mycode.out
> > How can I encourage this behaviour? Thank you.
>
>
> Oh, hey, I missed this part of the question. There's a neat trick if you
> have GNU Make, which you do on Fedora (and just about any Linux distro).
> If you have a simple C program with just one source file and no special
> linking needs, you can do this:
>
>    make mycode
>
> Note not mycode.c -- it'll automatically figure out that it can make the
> executable mycode from mycode.c. And you don't even have to have a Makefile!
>

That looks like what I'm looking for. When I did make file (not
file.c) I was informed that the file is already up to date. I checked
man make and I didn't see any information on how to compile, although
it does say that it is dealing with C files. I tried googling for
info.make but I can't get my hands on it.

I want to say thanks again for helping me on this OT thread. I learned
more from everybody's responses than I did in class!

Dotan
http://technology-sleuth.com/long_answer/what_is_a_cellphone.html
=




More information about the fedora-list mailing list