* Paul Elliott wrote on Wed, Jul 20, 2011 at 08:34:11AM CEST: > On Saturday, June 25, 2011 03:47:56 PM you wrote: > > > I need to keep my source files (i.e. .c and .h ) in a different directory > > > tree > > > from the one that contains the autotools control files and the build > > > directory. > > > > > > That is, when building X.o or X.lo I need to tell it to always find the > > > source > > > file as > > > ../other/src/X.c not ./X.c. I do not control the contents of the > > > ../other/src/ > > > directory > > > so I can not create any Autotools control files there or any object files > > > there. > > > To me, that directory is read only. > > > > > > Is there a way to do this conveniently in automake? An implicit rule > > > perhaps? > > > > > you may try: > > > > DIR = $(top_srcdir)/../other/src > > > > to refer to that directory.
Who wrote this? It is not good advice. > I have moved all my .c and .h source to a defferent directory from the one > wherein I am building. I now get a lot of error messages of the form: > "linker input file unused because linking not done" > What am I doing wrong? Do I need some kind of flag to tell gcc where to look? > Thank You. Do not do it like that. > I now have the source and the include files in a different read only > directroy: > I am building a library: > > > --------from my Makefile.am------------- > > astrosrc = $(astrodienst)/src > > lib_LTLIBRARIES = libswe.la > > > > > > libswe_la_SOURCES = \ > > > > $(astrosrc)/swecl.c \ > > $(astrosrc)/swedate.c \ That's more complicated that you need to do. Please remove the astrosrc definition and all instances of $(astrosrc)/ from your Makefile.am, rerun autotools. Then, please create a fresh directory, enter it, and run configure from there: mkdir build cd build ../configure -C This will cause all objects, libraries and binaries to appear in the so-called 'build tree', below the directory you just named 'build'. Hope that helps. Cheers, Ralf