[Top][All Lists]

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

Re: Autoconfisticating a multi-directory, non-recursive, GNU-make specif

From: Duncan Gibson
Subject: Re: Autoconfisticating a multi-directory, non-recursive, GNU-make specific project
Date: Thu, 16 Feb 2006 17:15:39 +0100

Ralf Wildenhues kindly provided me with 4 out of the 5 critical pieces
of information that I needed:

> --- ---
> AM_INIT_AUTOMAKE([1.9 subdir-objects])

1. subdir-objects to build x/y/z.o from x/y/z.c instead of just z.o
   see the last paragraph describing 'maude_SOURCES' in the manual at:

> --- ---
> bin_PROGRAMS =
> include lib1/
> include lib2/
> include app1/
> include app2/

2. initialise variables in, and then add actual values to
   them in the */

3. include */ to create one big Makefile, instead of using
   AC_CONFIG_FILES([Makefile lib1/Makefile ...]) in which
   generates completely separate Makefiles

> --- app2/ ---
> bin_PROGRAMS += app2/app2
> app2_app2_SOURCES = app2/main.cpp
> app2_app2_LDADD = lib2/lib2.a
> --- lib2/ ---
> lib_LIBRARIES += lib2/lib2.a
> lib2_lib2_a_SOURCES = lib2/file-in-lib2.cpp

4. provide the correct magic {directory, /, _} combinations to match
   the correct targets in different directories.

And the last critical point?

5. I had tried every combination I could think of to build lib2/lib2.a
   and then link it into app2 but I always got an undefined reference.
   But this was down to a major 'thinko' on my part so I wasn't also
   linking against lib1/lib1.a.

   I've been going in circles trying to solve the wrong problem :-(
   Talk about not being able to see the wood for the trees!

Thank you for your help. I do believe I have the foundation I need.


reply via email to

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