[Top][All Lists]

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

Re: How to create only executable files

From: Ingo Krabbe
Subject: Re: How to create only executable files
Date: Mon, 24 Jan 2011 12:13:12 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Jan 24, 2011 at 07:42:25AM -0300, Sergio Belkin wrote:
> 2011/1/24 Ralf Wildenhues <address@hidden>
> > Hello Sergio,
> >
> > * Sergio Belkin wrote on Sun, Jan 23, 2011 at 11:13:16PM CET:
> > > I've found great the option "-no-install". But I wonder if is there a
> > > way to build directly the executables files, I mean that don't create
> > > object file "something.o" and only do something.o
> >
> > You mean creating an executable directly from source file(s)?
> > No, Automake doesn't really support that.  You can try to write
> > a rule that passes foo.c to 'libtool --mode=link', but since we
> > don't test that I'm guessing that it won't work reliably.
> >
> > What's the point of this anyway?  AFAIK the only thing you save
> > by omitting the object file is one fork&exec of the compiler driver,
> > which is often negligible compared with the actual work the compiler
> > and linker do.  You can 'make mostlyclean' to remove object files
> > you don't need again afterwards.
> >
> > Cheers,
> > Ralf
> >
> Sorry, I was no clear enough
> Let's say that you have a library and you have on build tree a
> source file fred.c. You've created a test target that creat (with
> -no-install flag)  the  ELF  executable fred (note that has no extension).
> But libtool create also fred.o "an ELF relocatable", is there a way that
> libtool create only the "ELF excutable"? What is the advantage of create an
> "intermediate file"? Please correct me if I have a wrong concept.

I think it's a quite seldom case to do so, but as simple as you call the
gcc link stage directly you can combine the libtool stages:

GCC: gcc -o test test.c
LIBTOOL: libtool --mode=link --tag=CC gcc -o test test.c

bye ingo

reply via email to

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