[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: builddir vs. srcdir
From: |
Paul Pogonyshev |
Subject: |
Re: builddir vs. srcdir |
Date: |
Wed, 9 Mar 2005 23:21:35 +0200 |
User-agent: |
KMail/1.4.3 |
Stepan Kasal wrote:
> Hello,
>
> On Tue, Mar 08, 2005 at 11:56:56PM +0200, Paul Pogonyshev wrote:
> > because the generated sources are placed into the build directory,
> > while `make' looks for them in the source directory.
>
> generally, make should look for them in both places.
Yes, and it does look in both places, but the dependencies make `foo.o'
depend on `$(srcdir)/foo.c', so `make' tells it has no rule to build the
latter. How do I make dependencies tell `foo.o' depends on
`$(builddir)/foo.c' instead?
> Let me point out several problems:
> > BUILT_SOURCES = \
> > foo.c \
> > foo.h
>
> You probably need only the foo.h file here.
Right.
> > foo.c foo.h : $(srcdir)/foo.list $(PARSE_LIST)
> > $(PARSE_LIST) $(srcdir)/foo.list foo.h foo.c \
> >
> > || (rm -f foo.c foo.h ; exit 1)
>
> This rule can break with parallel make.
>
> For details about these two issues, see
> http://sources.redhat.com/automake/automake.html#Built-sources-example
>
> You can solve the second issue by adding the dependency:
> foo.c: foo.h
>
> Yet it might be more readable if you change your generator so that it
> would generate .c and .h in separate runs.
I'd hate to hack the generator for such a goal. I'll better stick with
the `foo.c: foo.h' solution. Maybe generating two files at once is non-
standard, but it seems natural, since they are so closely related and
are built from one source file, and that's the way it works already.
> And I'd like to suggest that you use SUFFIXES to handle the .list
> source. Please look at the following example:
Well, my generator is even more non-standard, since I need to pass an
additional command-line parameter sometimes. So, `SUFFIXES' are not an
option, although I agree it would have been nicer to use them.
Paul
- builddir vs. srcdir, Paul Pogonyshev, 2005/03/09
- Re: builddir vs. srcdir, Stepan Kasal, 2005/03/09
- Re: builddir vs. srcdir,
Paul Pogonyshev <=
- Re: builddir vs. srcdir, Stepan Kasal, 2005/03/10
- Re: builddir vs. srcdir, Paul Pogonyshev, 2005/03/10
- Re: builddir vs. srcdir, Stepan Kasal, 2005/03/11
- Re: builddir vs. srcdir, Paul Pogonyshev, 2005/03/12
- Re: builddir vs. srcdir, Stepan Kasal, 2005/03/16
- Re: builddir vs. srcdir, Paul Pogonyshev, 2005/03/18
- Re: builddir vs. srcdir, Stepan Kasal, 2005/03/21
Re: builddir vs. srcdir, Harald Dunkel, 2005/03/10