automake
[Top][All Lists]
Advanced

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

Re: Source files generation


From: Andrew Suffield
Subject: Re: Source files generation
Date: Sun, 31 Jul 2005 00:56:05 +0100
User-agent: Mutt/1.5.9i

On Sat, Jul 30, 2005 at 03:26:43PM +0200, Thomas Degris wrote:
> lib_LTLIBRARIES = libtoto.la
> 
> dist_libtoto_la_SOURCES = src/toto.stc
> libtoto_la_SOURCES =src/toto01.cxx src/toto02.cxx src/toto.cpp
> 
> %.cxx: src/diary.xml
> 
> src/diary.xml: src/toto.stc
>    gencxx src/toto.stc
> 
> The problem with this approach is that make returns the error :
> *** No rule to make target 'src/toto01.cxx', needed by 
> 'libtoto_la-toto01.lo'. Stop.
> So, I guess the pattern %.cxx is not correct but I tried different 
> things and I can't make it work. Any ideas ?

You need some actual dependencies. Add something like this:

$(cxx_files): src/diary.xml

Pattern rules that don't have any actions are generally of limited
use, partly because make tends to ignore them.

Also, this makefile can get stuck. If src/diary.xml is up to date WRT
src/toto.stc but the cxx files are not, for whatever reason (like
somebody mangling the tree by hand), then make has nothing to do but
the cxx files won't get built. So it breaks.

One way to write this better is like this:

src/diary.xml $(cxx_files): cxx_stamp

cxx_stamp: src/toto.stc
        gencxx src/toto.stc
        touch cxx_stamp

CLEANFILES += cxx_stamp

I think that'll do what you want.

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'                          |
   `-             -><-          |

Attachment: signature.asc
Description: Digital signature


reply via email to

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