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

Reply via email to