[Top][All Lists]

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

Re: this is embarrasing... prerequisiste gets updated, but make still sa

From: Michael Ludwig
Subject: Re: this is embarrasing... prerequisiste gets updated, but make still says it is older than target
Date: Mon, 2 Apr 2012 19:31:03 +0200
User-agent: Mutt/1.5.20 (2009-12-10)

Paul Smith schrieb am 02.04.2012 um 10:09 (-0400):

> You still haven't described what you're trying to do.  However, I'll
> say that _probably_ the way to solve your problem is to go back to the
> original attempt, with the phony prerequisite, and just add an empty
> rule to foobar1:
> > > foobar: foobar1
> > >         touch $@
> > > 
> > > foobar1:  foobar_phony
> > > 
> > > .PHONY: foobar_phony
> > > foobar_phony:
> > >         touch foobar1
> Change the rule for foobar1 so there's a recipe there, even a "do
> nothing" recipe:
>         foobar1: foobar_phony
>               @:
> Now that make has a recipe that could potentially create foobar1 it
> will need to re-check the timestamp on foobar1.  It was only because
> there was no recipe for building foobar1, that make decided there was
> no way the timestamp on foobar1 could have changed and so it didn't
> re-check it.

But are phony targets meant to update real targets? Wouldn't it be more
make-like to have foobar1 depend on a non-phony target (some file, like
barbar) that might in fact be updated and so, in turn, trigger an update
of foobar1?

foobar: foobar1
        touch $@

foobar1: barbar
        touch $@

        echo "I might be changing lots of things!"
        perl >> barbar.log
        if [ $(cat barbar.log | wc -l) -gt 20 ]; then
                cp barbar.log $@
                rm barbar.log


reply via email to

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