Hi.

I'm currently massaging my `Makefile.am's to allow building in a
separate directory.  However, I have a problem which I cannot find
how to solve.

I have a few source (`.c' and `.h') files which are generated at
build time from another source using a custom utility.  When the
build directory is the same as the source directory, everything is
fine.  However, with separate build directory things go hairy,
because the generated sources are placed into the build directory,
while `make' looks for them in the source directory.

Automake pseudo-code looks like this:


noinst_LIBRARIES = libfoo.a

BUILT_SOURCES =         \
        foo.c           \
                        \
        foo.h

PARSE_LIST = ./parse-list$(EXEEXT)

foo.c foo.h : $(srcdir)/foo.list $(PARSE_LIST)
        $(PARSE_LIST) $(srcdir)/foo.list foo.h foo.c    \
          || (rm -f foo.c foo.h ; exit 1)

libfoo_a_SOURCES = ...

nodist_libfoo_a_SOURCES = $(BUILT_SOURCES)


plus the lines to build the parser utility and other non-important
stuff.

Paul



Reply via email to