TODO
Factor out buildTarget
createDirectoryIfMissing on all the target output directories