Automatic inheritance of per director vars

Add an option to allow automatic inheritance of per directory variables.
You can do that globally (via INHERIT_DIR_VARS or per directory via
INHERIT_DIR_VARS_$(d)).  To turn off this feature just set
INHERIT_DIR_VARS_$(d) to empty value.

WARNING - backward incompatible change of name for the variable holding
parent director from "parent" to "parent_dir".  I don't expect this to
be used often and I prefer this more specific name - sorry if this
breaks anything in your build system, please just do search&replace.