This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Built header in different dir?
- To: Automake <automake at gnu dot org>
- Subject: Re: Built header in different dir?
- From: "Lars J. Aas" <larsa at sim dot no>
- Date: Fri, 30 Mar 2001 13:33:06 +0200
- List-Id: Discussion list for automake <automake.gnu.org>
- References: <20010330111032.C4994@nmrc.ie>
On Fri, Mar 30, 2001 at 11:10:32AM +0100, Lars Hecking wrote:
: How do I define a dependency on a header file in a different directory, eg.
: the parent dir? I tried
:
: BUILT_SOURCES = ../header.h
Try something like this:
In ../Makefile.am:
BUILT_SOURCES = header.h
# build $(BUILT_SOURCES) before entering subdirs
Makefile: $(BUILT_SOURCES)
In ./Makefile.am:
../header.h: $(srcdir)/../header.h.in
@( cd ..; $(MAKE) header.h )
The latter isn't necessary for ordinary builds, but if you change
header.h.in and start make from the subdir, you need the latter rule
to trigger the rebuild.
Lars J