This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: how to build generated files?
- From: Alexandre Duret-Lutz <duret_g at lrde dot epita dot fr>
- To: Gary Hughes <geh at itga dot com dot au>
- Cc: automake at gnu dot org
- Date: Thu, 21 Feb 2002 11:01:51 +0100
- Subject: Re: how to build generated files?
- References: <3C71B02C.9010007@itga.com.au>
>>> "Gary" == Gary Hughes <geh@itga.com.au> writes:
[...]
Gary> lib_LTLIBRARIES = liboimsg.la
Gary> liboimsg_la_DEPENDENCIES = $(OI_DICTIONARY) \
Gary> $(OI_COMPILER) \
Gary> sourcefiles
Gary> liboimsg_la_SOURCES = $(wildcard *.cpp)
Gary> include_HEADERS = $(wildcard *.h)
Gary> The problem is that during a 'make install' all the headers are picked
Gary> up ok, during a make however none of the cpp files are being picked up
Gary> even if I have run the compiler myself so they are sitting in the
Gary> directory before make is run.
$(wildcard) is a GNU Make extension which Automake doesn't grok.
If you don't care about producing portable Makefiles, there are
some places where $(wildcard) is moderately safe to use
(e.g. _HEADERS), however _SOURCES is not one of them because
Automake must know its content.
There are at least two reasons why Automake needs to know the
content of liboimg_la_SOURCES:
1) it uses the sources extensions to decide which compiler and
linker should be used
2) it also uses it to derive liboimg_la_OBJECTS, the list of
objects that should be linked in liboimg.la
If you still want to go this way, here is a tricky setup that
may work (no garanty):
liboimsg_la_SOURCES = empty.cpp $(wildcard *.cpp)
liboimsg_la_LIBADD = $(liboimsg_la_SOURCES:.cpp=.lo)
include_HEADERS = $(wildcard *.h)
empty.cpp:
touch empty.cpp
The empty.cpp file is to workaround 1), and the _LIBADD
definition is for 2).
A better setup, as far portability and Automake are concerned,
would be to expand manually all those $(wildcard) in your
Makefile.am (or have a script that generate your Makefile.am).
[...]
--
Alexandre Duret-Lutz