Make build products depend on their target directories.

This is an attempt to address Issue #3326 by adding [*order-only*][1]
prerequsites of each build product on the directory where it is to go.
It is important that the prerequisites be order-only, since the
timestamp on a parent directory is not relevant to whether a product
is out of date; the parent directory merely needs to exist.

(This use case of generating target directories was provided as an
[example][2] of how order-only prequisites are used.)

[1]: http://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html

[2]: http://www.kolpackov.net/pipermail/notes/2004-January/000001.html
Fix syntax: had to use escaped $$ to have an effect after first expansion.
Fix another goof: consistently use parent directory of target for rule.

(I wonder if there's a better way to write this in the rule itself;
i.e. something like `$$(dirname $$@)`.  But for now this will do.)
auto merge of #6235 : pnkfelix/rust/issue-3326-play-with-directory-orderonly-prereqs, r=z0w0

r? (for #3326)