automake
[Top][All Lists]
Advanced

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

builddir vs. srcdir


From: Paul Pogonyshev
Subject: builddir vs. srcdir
Date: Tue, 8 Mar 2005 23:56:56 +0200
User-agent: KMail/1.4.3

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

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