autoconf
[Top][All Lists]
Advanced

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

Re: objects direcotory


From: Bob Proulx
Subject: Re: objects direcotory
Date: Tue, 25 Sep 2007 19:01:16 -0600
User-agent: Mutt/1.5.9i

Hello Alexander,

In the future please keep the mailing list address in the To: or Cc:
fields so that the group can participate in the discussion and any
answers will be available to others who read the archives.  Thanks.

Александр Нескажу wrote:
> Hello, Bob.
> My name is Alexander.
> VPATH used for searching targets and precondition files. Am I rigth?

Used for searching for the source files.  The targets will be created
in the current directory.

> But the question is how to organize that:
> $ mkdir src build
> src/ contains *.c
> build/ contains nothing

Are you using autoconf and automake or is this something that you are
creating manually?

> $ make
> now:
> src/ contains *.c
> build/ contains *.o

Is this 'make' what you are doing now and already works?  Or is this
what you are hoping to create?

> So I can find my *.o in build/ over VPATH. But how can I put my *.o to the 
> build/.
> My be it should be organized over compiler options?

I think an example might help to make this more clear.  The GNU hello
world program is a good example so let's use it.  It is already set up
for this type of operation and is ready to go and so will be easier to
understand than if we try to convert your project which may not quite
be working yet.  So first an example and then second convert your
project.

Follow along here on your machine and try these commands.  If you do
not have 'wget' to "web-get" the files from that url then simply
download them with any web browser.

  wget http://ftp.gnu.org/gnu/hello/hello-2.3.tar.gz
  tar xzf hello-2.3.tar.gz
  cd hello-2.3
  mkdir build
  cd build
  ../configure
  make

In this example the hello-2.3/src directory contains all of the source
*.c and *.h files and the hello-2.3/build/src contains all of the *.o
files.  The choice of directory is your choice.  Simply use a path to
the source directory configure script from the build location that you
prefer.

Some people use multiple build directories and configure using
different options such as debugging and profiling.

Hope this helps,
Bob


Александр Нескажу wrote:
> 
> 
> -----Original Message-----
> From: address@hidden (Bob Proulx)
> To: Александр Нескажу <address@hidden>
> Date: Mon, 24 Sep 2007 12:45:56 -0600
> Subject: Re: objects direcotory
> 
> > 
> > Александр Нескажу wrote:
> > > How can I put all object files (*.o) in separate directory? Like 
> > > myproject/obj/. Not for shared library over libtool.
> > 
> > Use a "VPATH" build.  Create a directory specifically for the build
> > and the compile options that you prefer and then reference the
> > configure script by a path to it.
> > 
> >   mkdir obj
> >   cd obj
> >   ../configure CFLAGS=-g
> >   make
> > 
> > Bob
> > 
> Hello, Bob.
> My name is Alexander.
> VPATH used for searching targets and precondition files. Am I rigth?
> But the question is how to organize that:
> $ mkdir src build
> src/ contains *.c
> build/ contains nothing
> $ make
> now:
> src/ contains *.c
> build/ contains *.o
> So I can find my *.o in build/ over VPATH. But how can I put my *.o to the 
> build/.
> My be it should be organized over compiler options?
> 




reply via email to

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