[Top][All Lists]

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

Re: BUILT_SOURCES: dependencies not copied to build_dir

From: Michael Biebl
Subject: Re: BUILT_SOURCES: dependencies not copied to build_dir
Date: Tue, 28 Mar 2006 12:16:18 +0200
User-agent: Mail/News 1.5 (X11/20060228)

Ralf Wildenhues wrote:
> Hi Michael, Tom,


thanks for you help so far.

> * tom fogal wrote on Mon, Mar 27, 2006 at 10:38:27PM CEST:
>>  <address@hidden>Michael Biebl writes:
>> <snip>
>>> ngcs_marshal.c: ngcs_marshal.ngci
>>>        $(srcdir)/ ngcs_marshal
>>> ngcs_marshal.h: ngcs_marshal.ngci
>>>        $(srcdir)/ ngcs_marshal
>> Not sure if it will work, but perhaps you could just use the .ngci file
>> without copying it?
> Yes, that was my thinking as well.  Copying is a bad idea, if that file
> ends up in the distribution tarball some make implementations will
> behave "interestingly" and subtly different when both source and build
> tree have different versions of this (described in the Autoconf manual).

This is the solution I came up with:

EXTRA_DIST = ngcs_marshal.ngci
CLEANFILES = ngcs_marshal.h ngcs_marshal.c

ngcs_marshal.c: ngcs_marshal.ngci
        $(srcdir)/ $(srcdir)/ngcs_marshal @

ngcs_marshal.h: ngcs_marshal.ngci
        $(srcdir)/ $(srcdir)/ngcs_marshal @

This way and ngcs_marshal.ngci are not copied to the builddir
and whenever they change one of them in the srcdir the header and c file
are regenerated.
I don't need srcdir in the dependency line, but if I omit them in the
build rule I either get:
make: Command not found
IOError: [Errno 2] No such file or directory: 'ngcs_marshal.ngci'

I also had to change to take an additional parameter (@) where I
can tell the location of the output file. Otherwise the file is created
in the srcdir. I wanted to avoid changing first (that's why the
copying) but it seemed not to be possible.

Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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