Hi Stepan, Harald, * Stepan Kasal wrote on Tue, Sep 13, 2005 at 02:21:43PM CEST: > On Tue, Sep 13, 2005 at 12:58:45PM +0200, Harald Dunkel wrote: > > > > 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..
D'oh. Yes, thank you. > Moreover, the BUILT_SOURCES hack is necessary only for files which cannot > be handled by the normal dependencies, typically for headers. You don't need to copy headers. Just adjust the include path, as Harald had already done in one of his earlier examples. > 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) So you can leave out the BUILT_SOURCES line completely. But you need to "rm -f '$@'" before invoking $(LN_S). Thanks for the other corrections, by the way. And yes: I for one have neither the time, nor the ability, nor access to make changes to GNU Automake. There is a reason for an AUTHORS file, and the bug-* lists and the Automake GNATS bug database. Cheers, Ralf