Build only required dirs.