automake
[Top][All Lists]
Advanced

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

Re: make depend problem with hello_SOURCES = ${SRCDIR}/hello.c


From: Stepan Kasal
Subject: Re: make depend problem with hello_SOURCES = ${SRCDIR}/hello.c
Date: Tue, 13 Sep 2005 14:21:43 +0200
User-agent: Mutt/1.4.1i

Hello Harald,

On Tue, Sep 13, 2005 at 12:58:45PM +0200, Harald Dunkel wrote:
> Of course I appreciate your workaround, but please remember
> that this thread is about generating a meaningfull error
> message for a construct that autoconf/automake cannot
> handle. But maybe there is a way to generate the *.Po files
> from the Makefile?

well, it's a shame to admit it, but it seems that only Alexandre,
the maintainer of Automake is able to do either of the fixes you
propose.  We don't know when he'll have time to get to it.

This list is a users' list.  If you want to make sure that your bug
report will not be forgotten, perhaps you could mail it also to
bug-automake.  Even better than that, you could enter it to the
Automake Gnats database:
http://sourceware.org/cgi-bin/gnatsweb.pl?database=automake

But mere mortals are limited to discuss workarounds:

> > - one single large Makefile.am with subdir-objects
> >   (see "info Automake Alternative")
...
> And a single Makefile.am file instead of one file for each
> module is not modular.

Ralf's formulation wasn't exact: he meant one big Makefile.
But it can be composed from many Makefile.am fragments, which are all
included by the main one.

That way you get the advantage of non-recursive build with fully
described dependencies, without sacrificing the modularity.

> The set of modules to build is not constant, either.

You don't need to modify SUBDIRS in order to choose which parts
are built and which are not.

> > linked_sources = common_interface.c more.c even-more.c
> > BUILT_SOURCES = $(linked_sources)
> > $(linked_sources):
> >         list='$(linked_sources)'; for file in $$list; do \
> >           rm -f $$file; $(LN_S) '$(INTERFACE_DIR)'/"$$file" "$$file"; \
> >         done

Ralf, you seem to forgot that
        foo bar:
                cmd..
is equivalent to two rules:
        foo:
                cmd..
        bar:
                cmd..

Moreover, the BUILT_SOURCES hack is necessary only for files which cannot
be handled by the normal dependencies, typically for headers.
So I'd suggest:

linked_sources = common_interface.h common_interface.c more.c even-more.c
BUILT_SOURCES = common_interface.h
$(linked_sources):
        $(LN_S) '$(INTERFACE_DIR)/$@' '$@'
CLEANFILES = $(linked_sources)

Hope this helps,
        Stepan Kasal




reply via email to

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