automake
[Top][All Lists]
Advanced

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

Re: absolute or relative path for source files


From: Daniel Herring
Subject: Re: absolute or relative path for source files
Date: Mon, 16 May 2011 00:05:44 -0400 (EDT)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)

On Sun, 15 May 2011, Vincent Torri wrote:

in a Makefile.am that is in the "$(top_builddir)/path1/path3" directory, the
library uses a file that is in the "$(top_builddir)/path1/path2" directory.
Is it better to use absolute path:

mylib_SOURCES = $(top_builddir)/path1/path2/file.c

or relative path

mylib_SOURCES = ../path2/file.c

?

Technically, both are relative (and defined by autoconf IIRC). Use abs_top_builddir for an absolute path. Note that builddir should only be used to point to sources actually created by the build (srcdir for the others).

Not sure what the official story is. I treat these as any other absolute/relative path issue. Absolute paths break if the target moves, relative paths break if either target moves relative to the other. I generally prefer the shorter form, also preferring absolute paths if they appear in several directories.

The variable dereference can also be preferrable when including another makefile; it prevents automake from doing the include early.

- Daniel



reply via email to

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