automake
[Top][All Lists]
Advanced

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

Re: pre- and post-compilation hooks


From: Ralf Wildenhues
Subject: Re: pre- and post-compilation hooks
Date: Tue, 18 Nov 2008 19:54:34 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

* Baurzhan Ismagulov wrote on Tue, Nov 18, 2008 at 04:22:38PM CET:
> This does work:

Good.

> maude_SOURCES = maude/maude.processed.cpp
> 
> EXTRA_maude_SOURCES = maude/maude.cpp
> 
> .cpp.processed.cpp:
>       python $(top_srcdir)/myscript.py $<
>       mkdir -p `dirname address@hidden
>       cp $< $@
> 
> SUFFIXES = .cpp .processes.cpp
> 
> However, I would really like to avoid duplicating every source file in
> maude_SOURCES and EXTRA_maude_SOURCES (the necessity to write a custom
> make clean and duplicated TAGS entries being other minor points).

You can write
  maude_SOURCES = $(EXTRA_maude_SOURCES:.cpp=.processed.cpp)

(or vice versa (expressing EXTRA_maude_SOURCES from maude_SOURCES),
however you like).  Yes you have to add stuff for cleaning.

I suppose to fix TAGS you may need to rename EXTRA_maude_SOURCES to a
macro name not specially recognized by automake.  In that case, you have
to take care of distribution of those files yourself, though.

> Is adding pre-compilation hooks to automake a good idea? Or is there
> any other way to do that?

Not sure if any more question remain open here.

> > > Hmm, a nice trick! However, the preprocessor reads .cpp files, possibly
> > > updates them and another tool's input file, and writes them back as
> > > .cpp.
> > 
> > What a brain-damaged design.  Can you give it options to write to a
> > different file?  Does it at least update the file atomically?
> 
> I'm aware of the limitations of this approach. Do you see an alternative
> for the described use case?

Complain to the vendor?

Cheers,
Ralf




reply via email to

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