Make mk_cache generic for any directory

Signed-off-by: Michael Barton <mail@michaelbarton.me.uk>