Jonathan Baccash wrote:
Some commands create more than one result, and make (3.81beta3)
behaves funny when I try to account for this. For example:
#-------------
a: b
touch a
b: c
c: d
touch c
touch b
#-------------
Now, if file d exists, this works fine the first time. But then I
touch d and get weird results:
$ touch d
$ make
touch c
touch b
$ make
touch a
$ make
make: `a' is up to date.
I can make the "b: c" rule touch b to get it to work more properly,
but is there a make bug here?... I'm expecting output more like:
Not a bug, but the fact that Make doesn't know about the 'touch b'. You
should read Paul's rule for Makefiles:
http://make.paulandlesley.org/rules.html
"2 Every non-.PHONY rule must update a file with the exact name of
its target.
Make sure every command script touches the file "$@"-- not "../$@",
or "$(notdir $@)", but exactly [EMAIL PROTECTED] That way you and GNU make
always
agree."
Basically Make's doing what you told it to and you have a side effect in
the rule that builds c. Essentially the answer here is don't do that,
or if you do do it be aware of the consequence that Make doesn't know
about b and may behave in an unexpected way.
Why do you need the rule for c to make b?
John.
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make