gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] Build System links/ recommendations


From: Jan Hudec
Subject: Re: [Gnu-arch-users] Build System links/ recommendations
Date: Fri, 3 Sep 2004 17:16:43 +0200
User-agent: Mutt/1.5.6+20040818i

On Fri, Sep 03, 2004 at 15:18:07 +0100, Andrew Suffield wrote:
> > But the monolithic one knew enough not to run it.
> > 
> > Recursive make:
> > 
> > make foobinary
> > - considering foobinary
> > - considering foolib/foolib.a
> > - will make foolib.a (because it does not know prerequisites, so it
> >   can't decide, so it has to run the recursive make)
> > make -C foolib foolib.a
> > Entering foolib
> > Nothing to be done for foolib.a
> > Leaving foolib
> > - will make foobinary (blindly, it had run a rule for a prerequisite,
> >   though the prerequisite is still older than the target)
> > ld $(LDFLAGS) -o foobinary $(fooobjs) foolib/foolib.a
> > 
> > Monolithic make:
> > 
> > make foobinary
> > - considering foobinary
> > - considering foolib/foolib.a
> > - considering $(foolibobjs)
> > - nothing to be done for $(foolibobjs)
> > - nothing to be done for foolib/foolib.a
> > - considering $(fooobjs)
> > - nothing to be done for $(fooobjs)
> > Nothing to be done for foobinary
> 
> Ah, I see what you've done here. Anyway, here's how to do it with
> recursive make:
> 
> foobinary: | foolib/foolib.a
> 
> foolib/foolib.a: 
>         $(MAKE) -C foolib foolib.a
> 
> Which should have been a single | added to the recursive makefile at
> the appropriate point. You needed to tell the recursive makefile that
> the recursion rules were recursing and not building.

Except it does not work...:

$ cat ,test.mk 
@foo : | @bar
        touch @foo

@bar :
        test -f @bar || touch @bar
$ make -f ,test.mk @foo 
test -f @bar || touch @bar
touch @foo
$ make -f ,test.mk @foo
make: address@hidden' is up to date.
$ touch @bar 
# So now @bar is newer than @foo and @foo must be remade...
$ make -f ,test.mk @foo
make: address@hidden' is up to date.
# Obviously wrong conclusion.
$

The fragment, as is, does do what is intended.

$ cat ,test.mk 
@foo : | @bar
        touch @foo

@bar :
        test -f @bar || touch @bar

.PHONY: @bar
$ touch @foo
$ make -f ,test.mk @foo
test -f @bar || touch @bar
$

This does not count either.

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec 
<address@hidden>

Attachment: signature.asc
Description: Digital signature


reply via email to

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