Create target directory when needed.