automake
[Top][All Lists]
Advanced

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

Re: Shipping generated file from generated generator


From: Stepan Kasal
Subject: Re: Shipping generated file from generated generator
Date: Fri, 22 Oct 2004 11:27:00 +0200
User-agent: Mutt/1.4.1i

Hello Akim,

On Thu, Oct 21, 2004 at 06:06:42PM +0200, Akim Demaille wrote:
>  > noinst_PROGRAMS = makedoc
>  > bin_PROGRAMS = ginfo infokey
> 
>  > makedoc_SOURCES = makedoc.c
>  > ginfo_SOURCES = echo-area.c echo-area.h ... \
>  >   doc.c funs.h
>  > infokey_SOURCES = infokey.c infokey.h key.c key.h funs.h
> 
>  > generated_sources = doc.c key.c funs.h
> 
>  > $(generated_sources): makedoc$(EXEEXT) $(cmd_sources)
>  >    rm -f $(generated_sources)
>  >    $(top_builddir)/$(native_tools)/info/makedoc $(cmd_sources)
> 
>  > cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c 
> $(srcdir)/infodoc.c \
>  >   $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
>  >   $(srcdir)/footnotes.c $(srcdir)/variables.c
> 
>  > # The following hack is necessary to hint make before the automatic
>  > # dependencies are built.  See the automake manual for a detailed 
> explanation.
>  > BUILT_SOURCES = funs.h
>  > ----------
> 
> Do this work?  The sources are never re-generated on the user side?

No, it doesn't, the files were always regenerated on the user side. [*]
I missed that, sorry.
I guess the following should fix it:

$(generated_sources): $(makedoc_SOURCES) $(cmd_sources)
        make $(AM_MAKEFLAGS) makedoc$(EXEEXT)
        rm -f $(generated_sources)
        ./makedoc $(cmd_sources)

This way the generated_sources shouldn't be regenerated, if they are new
enough.

> Hm, reading more carefully, I see no connection between the
> generated_sources and what they are used to.

The dependency of the wole program on eg. key.c is done by the automake
variable infokey_SOURCES.

> I would say your Makefile is missing dependencies, that's why it
> 'works'.  But an update of one of the cmd_sources will probably not
> update the whole set, as it should.

I have to admit that I haven't tested it, but I beleive the above
explains it.


And now to your suggestions to texinfo:

> Warning: Read the node `Multiple Outputs' in Automake.texi.

Yes, you are right, thank you very much for pointing out this. 

> Also, I see no provision to generate these files in srcdir.  Are you
> really sure you ship and use them?

I guess ``make dist'' was always called in the main tree, so this was not
a problem. [*]

Regards,
        Stepan

[*] Since I have convinced Karl that generated_sources should not be
distributed, this is not a problem any more for texinfo.




reply via email to

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