This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Built header in different dir?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]