help-make
[Top][All Lists]
Advanced

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

Re: srcdir != buildir woes


From: Angus Leeming
Subject: Re: srcdir != buildir woes
Date: Tue, 26 Jul 2005 15:24:48 +0100
User-agent: KMail/1.7.1

On Tuesday 26 July 2005 14:10, Dave Hylands wrote:
> Hi Angus,
>
> > $(objdir)/%.h: $(srcdir)/%.ui
> > $(objdir)/%.moc: $(srcdir)/%.h
> >
> > However, here's the rub. When my srcdir != buildir the generated
> > .h files are not in the srcdir and so the .h -> .moc step is
> > failing. For obvious reasons.
>
> You need to decide where you want your headers to go and and use
> the SAME thing to describe your headers.
>
> You've used $(objdir)/%.h in one instance and $(srcdir)/%.h in the
> second. Either that or you're going to have to add a rule like:
>
> ifneq($(srcdir),$(objdir))
> $(srcdir)/%.h : $(objdir)/%.h
>     cp $< $@
> endif

Urggggssss! ;-)

> > Why is it removing these (generated in two steps) .moc files:
> >     .ui -> .h
> >     .h -> .moc
>
> Declare the .moc files as precious (see the section in the make
> documentation on intermediate files):
>
> .PRECIOUS: $(objdir)/%.moc

Bingo!

Thank you.
Angus




reply via email to

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