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 $@
barbar:
echo "I might be changing lots of things!"
perl barbar.pl >> barbar.log
if [ $(cat barbar.log | wc -l) -gt 20 ]; then
cp barbar.log $@
rm barbar.log
fi
Michael
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make