automake
[Top][All Lists]
Advanced

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

Re: Putting intermediate files in the distribution?


From: Ronald Landheer-Cieslak
Subject: Re: Putting intermediate files in the distribution?
Date: Wed, 2 Apr 2003 17:29:05 +0200 (CEST)

Hello Bob,

What I usually do for generated source files is set the generated files in 
the sources as I would any other and add a rule to generate them if need 
be - and add the original files to EXTRA_DIST.

This will leave them there on `make clean` and distribute them as well as 
the sources' sources :)

i.e.:

bin_PROGRAMS=my_bin
EXTRA_DIST=scanner.yy parser.y
my_bin_SOURCES=scanner.c parser.c jail.c yyerror.c

scanner.c : scanner.yy
   flex -o$@ $<

parser.c : parser.y
   bison -o$@ $<

You can add the generated files to MAINTAINERCLEANFILES if you want to 
force them to be rebuilt..

HTH

rlc


On Wed, 2 Apr 2003, Bob Proulx wrote:
> I am autoconfiscating a moderately large legacy project.  A previously
> existing methodology in the project is to create a large number of .c
> and .h files by generating them with a script from a template.  I have
> created custom rules to do this and all builds fine.  I originally put
> the generated files into CLEANFILES since they are generated files.
> 
> But upon a clean build I notice that it takes longer to run the
> scripts to build those .c and .h files than it takes to compile the
> entire rest of the project!  Yes the scripts are slow and I can
> probably speed them up.  But for now I just want to work around the
> problem and put that task off until later.  The files are architecture
> independent and produce identical files on any platform.  Therefore I
> would like to include those into the distribution in order to save the
> rebuild time every time I recompile from scratch.
> 
> I have been thinking I should put the generated .c and .h files into
> both EXTRA_DIST and MAINTAINERCLEANFILES.  Then I could force a
> rebuild of those with maintainer-clean when I really want to force
> rebuild them.  They would get normal dependency management and be
> rebuilt when needed based upon their dependencies changing.  But they
> would avoid being rebuilt gratuitously.  I have tested this and it
> seems to do what I want but seems questionable to me.  I was looking
> for direction.  Does this scheme sound right?
> 
> For comparison how are lex and yacc intermediate .c and .h files
> handled?  I think my problem is similar should be handled similarly.
> 
> I will include an example structure at the end of this message.  It is
> functional and representative of the problem.  And perhaps someone
> will see obvious improvements to which I am blind.
> 
> Thanks
> Bob
> 
> Here is an example:
> 
> EXTRA_DIST = file1.d file1.h file1.c ../../include/file1.h ../../src/file1.c
> MAINTAINERCLEANFILES = file1.h file1.c ../../include/file1.h ../../src/file1.c
> 
> all: $(MAINTAINERCLEANFILES)
> 
> file1.c: file1.d
>        a_script file1.d
> 
> file1.h: file1.d
>        a_script file1.d
> 
> ../../src/file1.c: file1.c
>         cp file1.c ../../src/
> 
> ../../include/file1.h: file1.h
>         cp file1.h ../../include/
> 





reply via email to

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